iavl
iavl copied to clipboard
Consider dropping error result from ImmutableTree.Iterator
Right now every caller of ImmutableTree.Iterator
must handle its error
result, which in turn leads to errors being ignored:
https://github.com/cosmos/iavl/blob/64ffc2749400f762d6279db0fd1ccc2b22e69492/immutable_tree.go#L49
However, the only reason an error can be returned is if IsFastCacheEnabled
returns an error, which supposedly is very rare.
A better API is to fall back to NewIterator
when IsFastCacheEnabled
fails and remove the error
result. This benefits every caller, direct and indirect.
CC @odeke-em