feat: replace the cosmos-db.DB interface with core/store interface (#21450)
This commit is contained in:
+2
-2
@@ -6,9 +6,9 @@ import (
|
||||
"io"
|
||||
"path/filepath"
|
||||
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/spf13/cast"
|
||||
|
||||
corestore "cosmossdk.io/core/store"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"cosmossdk.io/x/auth/ante/unorderedtx"
|
||||
|
||||
@@ -34,7 +34,7 @@ func (a *AppBuilder) DefaultGenesis() map[string]json.RawMessage {
|
||||
}
|
||||
|
||||
// Build builds an *App instance.
|
||||
func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App {
|
||||
func (a *AppBuilder) Build(db corestore.KVStoreWithBatch, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App {
|
||||
for _, option := range a.app.baseAppOptions {
|
||||
baseAppOptions = append(baseAppOptions, option)
|
||||
}
|
||||
|
||||
+2
-4
@@ -4,8 +4,6 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
|
||||
"cosmossdk.io/core/store"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
|
||||
@@ -162,7 +160,7 @@ func (s kvStoreAdapter) Set(key, value []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s kvStoreAdapter) Iterator(start, end []byte) dbm.Iterator {
|
||||
func (s kvStoreAdapter) Iterator(start, end []byte) store.Iterator {
|
||||
it, err := s.store.Iterator(start, end)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -170,7 +168,7 @@ func (s kvStoreAdapter) Iterator(start, end []byte) dbm.Iterator {
|
||||
return it
|
||||
}
|
||||
|
||||
func (s kvStoreAdapter) ReverseIterator(start, end []byte) dbm.Iterator {
|
||||
func (s kvStoreAdapter) ReverseIterator(start, end []byte) store.Iterator {
|
||||
it, err := s.store.ReverseIterator(start, end)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ require (
|
||||
github.com/cockroachdb/pebble v1.1.0 // indirect
|
||||
github.com/cockroachdb/redact v1.1.5 // indirect
|
||||
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
|
||||
github.com/cosmos/cosmos-db v1.0.2 // indirect
|
||||
github.com/cosmos/cosmos-db v1.0.3-0.20240829004618-717cba019b33 // indirect
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
|
||||
github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect
|
||||
github.com/cosmos/ics23/go v0.11.0 // indirect
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ
|
||||
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
|
||||
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs=
|
||||
github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
|
||||
github.com/cosmos/cosmos-db v1.0.3-0.20240829004618-717cba019b33 h1:NnqmEOIzUPazzBrhGenzI1AQCBtJ0Hbnb/DDoykpko0=
|
||||
github.com/cosmos/cosmos-db v1.0.3-0.20240829004618-717cba019b33/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
|
||||
github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro=
|
||||
|
||||
Reference in New Issue
Block a user