diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 59cb434b4..1071f46cd 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -486,3 +486,7 @@ func (store *Store) isDeleted(key string) bool { _, ok := store.deleted.Load(key) return ok } + +func (store *Store) GetParent() types.KVStore { + return store.parent +} diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index 3a6d5ab53..65c3f4eaa 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -62,6 +62,9 @@ func TestCacheKVStore(t *testing.T) { st.Write() require.Empty(t, st.Get(keyFmt(1)), "Expected `key1` to be empty") require.Empty(t, mem.Get(keyFmt(1)), "Expected `key1` to be empty") + + // GetParent returns parent store + require.NotNil(t, st.GetParent()) } func TestCacheKVStoreNoNilSet(t *testing.T) {