You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
Keepers can use the store Iterator to retrieve all the items from the store by performing a callback function (eg an aggregator):
// IterateClients provides an iterator over all stored light client State// objects. For each State object, cb will be called. If the cb returns true,// the iterator will close and stop.func (kKeeper) IterateClients(ctx sdk.Context, cbfunc(types.State) bool) {
store:=prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixClient)
iterator:=sdk.KVStorePrefixIterator(store, nil)
deferiterator.Close()
for ; iterator.Valid(); iterator.Next() {
varclientState types.Statek.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &clientState)
ifcb(clientState) {
break
}
}
}
Then you can use the Iterator function above to retrieve all the objects from the store by aggregating them:
Keepers can use the store
Iterator
to retrieve all the items from the store by performing a callback function (eg an aggregator):Then you can use the Iterator function above to retrieve all the objects from the store by aggregating them:
Finally, we add the Querier method:
where
QueryAllClientsParams
contains only the pagination parameters:This is a pretty standard way on the SDK which would be helpful to support on the scaffold.
The text was updated successfully, but these errors were encountered: