Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Apr 1, 2024
1 parent 5f49509 commit 37956ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion store/cachemulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (cms Store) Restore(other Store) {
for k, v := range other.stores {
store, ok := cms.stores[k]
if !ok {
store = cms.initStore(k, v)
store = cms.initStore(k, cms.parentStore(k))
}

store.(types.BranchStore).Restore(v.(types.BranchStore))
Expand Down
1 change: 1 addition & 0 deletions store/cachemulti/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestRunAtomic(t *testing.T) {
return nil
})
require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key")))
require.Equal(t, []byte(nil), s.GetKVStore(keys["abc"]).Get([]byte("key-non-exist")))
require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string))

require.Error(t, s.RunAtomic(func(ms types.CacheMultiStore) error {
Expand Down

0 comments on commit 37956ee

Please sign in to comment.