Skip to content

Commit

Permalink
08-wasm: pin ibc-go v8.0 (#5392)
Browse files Browse the repository at this point in the history
* pin ibc-go v8.0

* go mod tidy

* fix error

* add mock key path and height

* mock fixes
  • Loading branch information
crodriguezvega committed Dec 13, 2023
1 parent cffbd67 commit 57fcdb9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
2 changes: 0 additions & 2 deletions modules/light-clients/08-wasm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/cosmos/ibc-go/modules/light-clients/08-wasm

go 1.21

replace github.com/cosmos/ibc-go/v8 => ../../../

replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

require (
Expand Down
2 changes: 2 additions & 0 deletions modules/light-clients/08-wasm/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so=
github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc=
github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE=
github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco=
github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg=
github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
Expand Down
27 changes: 27 additions & 0 deletions modules/light-clients/08-wasm/testing/mock/mock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mock

import (
"github.com/cosmos/ibc-go/v8/modules/core/exported"
)

var _ exported.Path = KeyPath{}

// KeyPath defines a placeholder struct which implements the exported.Path interface
type KeyPath struct{}

// String implements the exported.Path interface
func (KeyPath) String() string {
return ""
}

// Empty implements the exported.Path interface
func (KeyPath) Empty() bool {
return false
}

var _ exported.Height = Height{}

// Height defines a placeholder struct which implements the exported.Height interface
type Height struct {
exported.Height
}
4 changes: 2 additions & 2 deletions modules/light-clients/08-wasm/testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ func NewSimApp(
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
wasm.NewAppModule(app.WasmClientKeeper),
ibctm.AppModuleBasic{},
solomachine.AppModuleBasic{},
ibctm.NewAppModule(),
solomachine.NewAppModule(),
mockModule,
)

Expand Down
12 changes: 6 additions & 6 deletions modules/light-clients/08-wasm/types/client_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/cosmos/ibc-go/modules/light-clients/08-wasm/internal/ibcwasm"
wasmtesting "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/testing"
mock "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/testing/mock"
"github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
Expand All @@ -19,7 +20,6 @@ import (
"github.com/cosmos/ibc-go/v8/modules/core/exported"
solomachine "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine"
ibctesting "github.com/cosmos/ibc-go/v8/testing"
ibcmock "github.com/cosmos/ibc-go/v8/testing/mock"
)

func (suite *TypesTestSuite) TestStatus() {
Expand Down Expand Up @@ -137,7 +137,7 @@ func (suite *TypesTestSuite) TestGetTimestampAtHeight() {
{
"error: invalid height",
func() {
height = ibcmock.Height{}
height = mock.Height{}
},
ibcerrors.ErrInvalidType,
},
Expand Down Expand Up @@ -438,14 +438,14 @@ func (suite *TypesTestSuite) TestVerifyMembership() {
{
"invalid path argument",
func() {
path = ibcmock.KeyPath{}
path = mock.KeyPath{}
},
ibcerrors.ErrInvalidType,
},
{
"proof height is invalid type",
func() {
proofHeight = ibcmock.Height{}
proofHeight = mock.Height{}
},
ibcerrors.ErrInvalidType,
},
Expand Down Expand Up @@ -579,14 +579,14 @@ func (suite *TypesTestSuite) TestVerifyNonMembership() {
{
"invalid path argument",
func() {
path = ibcmock.KeyPath{}
path = mock.KeyPath{}
},
ibcerrors.ErrInvalidType,
},
{
"proof height is invalid type",
func() {
proofHeight = ibcmock.Height{}
proofHeight = mock.Height{}
},
ibcerrors.ErrInvalidType,
},
Expand Down

0 comments on commit 57fcdb9

Please sign in to comment.