-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(store): migrate db backends to store/db
and remove the cosmos-db
deps completely
#21765
Changes from 1 commit
c55385d
1014345
b76e45b
26ab11e
f52e9d3
f117d52
539cb60
276a8b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ package testkv | |
import ( | ||
"testing" | ||
|
||
dbm "github.com/cosmos/cosmos-db" | ||
"gotest.tools/v3/assert" | ||
|
||
"cosmossdk.io/orm/model/ormtable" | ||
dbm "cosmossdk.io/store/db" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine if orm imports cosmos-db. Nothing here imports orm anyway, and it would allow us to remove the extra file in store |
||
) | ||
|
||
func NewGoLevelDBBackend(tb testing.TB) ormtable.Backend { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,14 @@ import ( | |
"path/filepath" | ||
"testing" | ||
|
||
dbm "github.com/cosmos/cosmos-db" | ||
"github.com/stretchr/testify/require" | ||
|
||
dbm "cosmossdk.io/store/db" | ||
) | ||
|
||
func Test_OpenDB(t *testing.T) { | ||
t.Parallel() | ||
_, err := OpenDB(t.TempDir(), dbm.GoLevelDBBackend) | ||
_, err := OpenDB(t.TempDir(), dbm.DBTypeGoLevelDB) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Update remaining occurrences of The rename from
Please update these files to use Analysis chainVerify the consistency of the The change from Run the following script to verify the consistency of the change: Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the consistency of the `GoLevelDBBackend` rename across the codebase.
# Test: Search for the old usage. Expect: No occurrences of `GoLevelDBBackend`.
rg --type go $'GoLevelDBBackend' || echo "No occurrences of 'GoLevelDBBackend' found."
# Test: Search for the new usage. Expect: Only occurrences of `DBTypeGoLevelDB`.
rg --type go -A 5 $'DBTypeGoLevelDB'
Length of output: 2848 |
||
require.NoError(t, err) | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,14 @@ import ( | |
"path/filepath" | ||
|
||
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" | ||
dbm "github.com/cosmos/cosmos-db" | ||
"google.golang.org/grpc" | ||
"google.golang.org/protobuf/proto" | ||
"google.golang.org/protobuf/reflect/protodesc" | ||
"google.golang.org/protobuf/reflect/protoregistry" | ||
"google.golang.org/protobuf/types/descriptorpb" | ||
|
||
"cosmossdk.io/log" | ||
dbm "cosmossdk.io/store/db" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really need to use a real db here? Cannot it be a memdb? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let me check again |
||
storetypes "cosmossdk.io/store/types" | ||
|
||
bam "github.com/cosmos/cosmos-sdk/baseapp" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this and use a pseudo version?