Skip to content

Commit

Permalink
Merge branch 'master' into am/middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 authored Aug 24, 2021
2 parents 74167e9 + a87d4dc commit 0bb9c48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/building-modules/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions store/cachekv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{}
}
}

0 comments on commit 0bb9c48

Please sign in to comment.