feat: replace the cosmos-db usecases in the tests with core/testing (backport #21525) (#21720)

Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2024-09-13 20:18:05 +00:00
committed by GitHub
co-authored by cool-developer Julien Robert
parent 64beb97259
commit 150d17c3fc
84 changed files with 576 additions and 523 deletions
+3 -3
View File
@@ -4,11 +4,11 @@ import (
"context"
"testing"
db "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
"cosmossdk.io/collections"
"cosmossdk.io/core/store"
coretesting "cosmossdk.io/core/testing"
)
func TestCollectionPagination(t *testing.T) {
@@ -163,7 +163,7 @@ func TestCollectionPagination(t *testing.T) {
}
type testStore struct {
db db.DB
db store.KVStoreWithBatch
}
func (t testStore) OpenKVStore(ctx context.Context) store.KVStore {
@@ -197,6 +197,6 @@ func (t testStore) ReverseIterator(start, end []byte) (store.Iterator, error) {
var _ store.KVStore = testStore{}
func deps() (store.KVStoreService, context.Context) {
kv := db.NewMemDB()
kv := coretesting.NewMemDB()
return &testStore{kv}, context.Background()
}
+2 -2
View File
@@ -4,10 +4,10 @@ import (
"fmt"
"math"
db "github.com/cosmos/cosmos-db"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/store/types"
)
@@ -126,7 +126,7 @@ func Paginate(
return res, nil
}
func getIterator(prefixStore types.KVStore, start []byte, reverse bool) db.Iterator {
func getIterator(prefixStore types.KVStore, start []byte, reverse bool) corestore.Iterator {
if reverse {
var end []byte
if start != nil {