diff --git a/pkg/core/stateroot/module.go b/pkg/core/stateroot/module.go index 34503d7eb..751e75d1b 100644 --- a/pkg/core/stateroot/module.go +++ b/pkg/core/stateroot/module.go @@ -80,11 +80,13 @@ func (s *Module) GetState(root util.Uint256, key []byte) ([]byte, error) { return tr.Get(key) } -// FindStates returns set of key-value pairs with key matching the prefix starting -// from the `prefix`+`start` path from MPT trie with the specified root. `max` is -// the maximum number of elements to be returned. If nil `start` specified, then -// item with key equals to prefix is included into result; if empty `start` specified, -// then item with key equals to prefix is not included into result. +// FindStates returns a set of key-value pairs with keys matching the prefix starting +// from the `prefix`+`start` path from MPT with the specified root. `max` is +// the maximum number of elements to be returned. If nil `start` is specified, then the +// item with the key equal to the prefix is included into the result; if empty `start` is specified, +// then the item with the key equal to the prefix is not included into the result. +// In case there are no results (prefix is unused, start is after the last available +// element) mpt.ErrNotFound is returned. func (s *Module) FindStates(root util.Uint256, prefix, start []byte, max int) ([]storage.KeyValue, error) { // Allow accessing old values, it's RO thing. tr := mpt.NewTrie(mpt.NewHashNode(root), s.mode&^mpt.ModeGCFlag, storage.NewMemCachedStore(s.Store))