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

fix(server/v2/cometbft): fix mock store (backport #22293) #22298

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
4 changes: 2 additions & 2 deletions server/v2/cometbft/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
cosmossdk.io/server/v2 v2.0.0-20241014060734-0b43fcc2164c // main
cosmossdk.io/server/v2/appmanager v0.0.0-20241008175849-325728a9fd6c // main
cosmossdk.io/server/v2/stf v0.0.0-20241008175849-325728a9fd6c // main
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c // main
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b // main
cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000
github.com/cometbft/cometbft v1.0.0-rc1.0.20240908111210-ab0be101882f
github.com/cometbft/cometbft/api v1.0.0-rc.1
Expand Down Expand Up @@ -139,7 +139,7 @@ require (
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions server/v2/cometbft/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cosmossdk.io/server/v2/stf v0.0.0-20241008175849-325728a9fd6c h1:thOij3diZWxwfKa
cosmossdk.io/server/v2/stf v0.0.0-20241008175849-325728a9fd6c/go.mod h1:MjuTMonZ319tZQX6CV2O5E/+F85KrkNUj5U5ObrrkWs=
cosmossdk.io/store v1.0.0-rc.0.0.20241009154331-597e0fac1173 h1:MlvTcx2h4zmZZtIDg35B6bovbb5iUAExPmvaPE1Zci4=
cosmossdk.io/store v1.0.0-rc.0.0.20241009154331-597e0fac1173/go.mod h1:lrhcXu/hRXrLJP4L8syVbs68GJU1WSRBFO3mmjn5oGc=
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c h1:X/vNG/8Vn4Du7tMDwrMi0gz5K1yPpYz9QRe0VxbGCzw=
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c/go.mod h1:0vAEKMFFcv3GXLzyVtISL3S/+THN0zydwztuRafgf90=
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b h1:epPBD1ebUwat6Ruw40rsEU4N9CHJ2ZN0ev8EGoNYBvE=
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b/go.mod h1:BVn9FGr34kAIQKkrhA0aeFDVYdVEKw2FmSD+3FrayUE=
cosmossdk.io/x/tx v0.13.4-0.20241003111526-30003f667944 h1:HLWNcAuIe0/5m4EyPWC+bLkJrxpN5xKpzQGeqLmdF5Y=
cosmossdk.io/x/tx v0.13.4-0.20241003111526-30003f667944/go.mod h1:PpXcKmCpvC3vmWE8ha8MwAxsFT7sOG4t57Octwnm8k0=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
Expand Down Expand Up @@ -423,8 +423,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand Down
8 changes: 4 additions & 4 deletions server/v2/cometbft/internal/mock/mock_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
)

type MockStore struct {
Storage storev2.VersionedDatabase
Storage storev2.VersionedWriter
Committer storev2.Committer
}

func NewMockStorage(logger log.Logger, dir string) storev2.VersionedDatabase {
func NewMockStorage(logger log.Logger, dir string) storev2.VersionedWriter {
storageDB, _ := sqlite.New(dir)
ss := storage.NewStorageStore(storageDB, logger)
return ss
Expand All @@ -36,7 +36,7 @@ func NewMockCommiter(logger log.Logger, actors ...string) storev2.Committer {
return sc
}

func NewMockStore(ss storev2.VersionedDatabase, sc storev2.Committer) *MockStore {
func NewMockStore(ss storev2.VersionedWriter, sc storev2.Committer) *MockStore {
return &MockStore{Storage: ss, Committer: sc}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ func (s *MockStore) StateAt(version uint64) (corestore.ReaderMap, error) {
return NewMockReaderMap(version, s), nil
}

func (s *MockStore) GetStateStorage() storev2.VersionedDatabase {
func (s *MockStore) GetStateStorage() storev2.VersionedWriter {
return s.Storage
}

Expand Down
4 changes: 2 additions & 2 deletions simapp/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
cosmossdk.io/runtime/v2 v2.0.0-20241014060734-0b43fcc2164c // main
cosmossdk.io/server/v2 v2.0.0-20241014060734-0b43fcc2164c // main
cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c // main
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b // main
cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000
cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e
cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -183,7 +183,7 @@ require (
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions simapp/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ cosmossdk.io/server/v2/stf v0.0.0-20241008175849-325728a9fd6c h1:thOij3diZWxwfKa
cosmossdk.io/server/v2/stf v0.0.0-20241008175849-325728a9fd6c/go.mod h1:MjuTMonZ319tZQX6CV2O5E/+F85KrkNUj5U5ObrrkWs=
cosmossdk.io/store v1.0.0-rc.0.0.20240913190136-3bc707a5a214 h1:UUW0+2UgbDwQ452o2aw4DrVSWmowcad7DB7Vln+N94I=
cosmossdk.io/store v1.0.0-rc.0.0.20240913190136-3bc707a5a214/go.mod h1:ct8HATr+s48YYTRXEyP3HF33v9qEVWHMxwOL8P/v4iQ=
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c h1:X/vNG/8Vn4Du7tMDwrMi0gz5K1yPpYz9QRe0VxbGCzw=
cosmossdk.io/store/v2 v2.0.0-20241014060734-0b43fcc2164c/go.mod h1:0vAEKMFFcv3GXLzyVtISL3S/+THN0zydwztuRafgf90=
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b h1:epPBD1ebUwat6Ruw40rsEU4N9CHJ2ZN0ev8EGoNYBvE=
cosmossdk.io/store/v2 v2.0.0-20241017091405-f01baf302e2b/go.mod h1:BVn9FGr34kAIQKkrhA0aeFDVYdVEKw2FmSD+3FrayUE=
cosmossdk.io/x/tx v0.13.4-0.20241003111526-30003f667944 h1:HLWNcAuIe0/5m4EyPWC+bLkJrxpN5xKpzQGeqLmdF5Y=
cosmossdk.io/x/tx v0.13.4-0.20241003111526-30003f667944/go.mod h1:PpXcKmCpvC3vmWE8ha8MwAxsFT7sOG4t57Octwnm8k0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -743,8 +743,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand Down
Loading