Skip to content

Commit

Permalink
Update docs/core/store.md
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
  • Loading branch information
amaury1093 and robert-zaremba authored Nov 24, 2020
1 parent fe234e6 commit d2312c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/core/store.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Individual `KVStore`s are used by modules to manage a subset of the global state

+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/store/types/store.go#L189-L219

Apart from the traditional `Get` and `Set` methods, a `KVStore` is expected to implement an `Iterator()` method which returns an `Iterator` object. The `Iterator()` method is used to iterate over a domain of keys, typically keys that share a common prefix. This is a common pattern of using an `Iterator`, which might be found in a module's `keeper`; below is an example from the bank's module keeper, used to iterate over all account balances:
Apart from the traditional `Get` and `Set` methods, a `KVStore` must provide an `Iterator(start, end)` method which returns an `Iterator` object. It is used to iterate over a range of keys, typically keys that share a common prefix. Below is an example from the bank's module keeper, used to iterate over all account balances:

+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/bank/keeper/view.go#L115-L134

Expand Down

0 comments on commit d2312c7

Please sign in to comment.