Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: use KVStoreService in x/auth #15520

Merged
merged 23 commits into from
Mar 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace for a single adapter
  • Loading branch information
facundomedica committed Mar 24, 2023
commit 3bb304dae46b2474ec2cee78bfffd6309786d316
9 changes: 0 additions & 9 deletions runtime/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,25 @@ type kvStoreAdapter struct {
store store.KVStore
}

// CacheWrap implements types.KVStore
func (kvStoreAdapter) CacheWrap() storetypes.CacheWrap {
panic("unimplemented")
}

// CacheWrapWithTrace implements types.KVStore
func (kvStoreAdapter) CacheWrapWithTrace(w io.Writer, tc storetypes.TraceContext) storetypes.CacheWrap {
panic("unimplemented")
}

// GetStoreType implements types.KVStore
func (kvStoreAdapter) GetStoreType() storetypes.StoreType {
panic("unimplemented")
}

// Delete implements types.KVStore
func (s kvStoreAdapter) Delete(key []byte) {
err := s.store.Delete(key)
if err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}
}

// Get implements types.KVStore
func (s kvStoreAdapter) Get(key []byte) []byte {
bz, err := s.store.Get(key)
if err != nil {
Expand All @@ -133,7 +128,6 @@ func (s kvStoreAdapter) Get(key []byte) []byte {
return bz
}

// Has implements types.KVStore
func (s kvStoreAdapter) Has(key []byte) bool {
has, err := s.store.Has(key)
if err != nil {
Expand All @@ -142,15 +136,13 @@ func (s kvStoreAdapter) Has(key []byte) bool {
return has
}

// Set implements types.KVStore
func (s kvStoreAdapter) Set(key []byte, value []byte) {
err := s.store.Set(key, value)
if err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}
}

// Iterator implements types.KVStore
func (s kvStoreAdapter) Iterator(start []byte, end []byte) dbm.Iterator {
it, err := s.store.Iterator(start, end)
if err != nil {
Expand All @@ -159,7 +151,6 @@ func (s kvStoreAdapter) Iterator(start []byte, end []byte) dbm.Iterator {
return it
}

// ReverseIterator implements types.KVStore
func (s kvStoreAdapter) ReverseIterator(start []byte, end []byte) dbm.Iterator {
it, err := s.store.ReverseIterator(start, end)
if err != nil {
Expand Down