diff --git a/docs/building-modules/errors.md b/docs/building-modules/errors.md index d1bc3682456..0eb3728a5e7 100644 --- a/docs/building-modules/errors.md +++ b/docs/building-modules/errors.md @@ -18,7 +18,7 @@ of errors is handled via the `types/errors` package. Example: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.38.1/x/distribution/types/errors.go#L1-L21 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0/x/distribution/types/errors.go#L1-L21 Each custom module error must provide the codespace, which is typically the module name (e.g. "distribution") and is unique per module, and a uint32 code. Together, the codespace and code diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 48c59d8da8d..f302d187308 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -238,12 +238,13 @@ func (store *Store) dirtyItems(start, end []byte) { // Only entrypoint to mutate store.cache. func (store *Store) setCacheValue(key, value []byte, deleted bool, dirty bool) { - store.cache[conv.UnsafeBytesToStr(key)] = &cValue{ + keyStr := conv.UnsafeBytesToStr(key) + store.cache[keyStr] = &cValue{ value: value, deleted: deleted, dirty: dirty, } if dirty { - store.unsortedCache[conv.UnsafeBytesToStr(key)] = struct{}{} + store.unsortedCache[keyStr] = struct{}{} } }