From 44e84a594363b42df8967f801862093dc5ba47d1 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 15 Mar 2023 22:55:19 +0300 Subject: [PATCH] stateroot: fix spelling and enhance FindStates doc, fix #2925 --- pkg/core/stateroot/module.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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))