Skip to content

Commit

Permalink
Merge branch 'main' into jim/make-lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Nov 22, 2023
2 parents b927a6d + 34f5798 commit 0077b98
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 787 deletions.
766 changes: 0 additions & 766 deletions docs/.vuepress/config.js

This file was deleted.

14 changes: 5 additions & 9 deletions modules/light-clients/08-wasm/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package keeper_test

import (
"encoding/hex"
"os"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

wasmtesting "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/testing"
"github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
)

Expand All @@ -22,9 +22,7 @@ func (suite *KeeperTestSuite) TestQueryCode() {
"success",
func() {
signer := authtypes.NewModuleAddress(govtypes.ModuleName).String()
code, err := os.ReadFile("../test_data/ics10_grandpa_cw.wasm.gz")
suite.Require().NoError(err)
msg := types.NewMsgStoreCode(signer, code)
msg := types.NewMsgStoreCode(signer, wasmtesting.Code)

res, err := GetSimApp(suite.chainA).WasmClientKeeper.StoreCode(suite.chainA.GetContext(), msg)
suite.Require().NoError(err)
Expand All @@ -51,7 +49,7 @@ func (suite *KeeperTestSuite) TestQueryCode() {

for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.SetupTest()
suite.SetupWasmWithMockVM()

tc.malleate()

Expand Down Expand Up @@ -87,9 +85,7 @@ func (suite *KeeperTestSuite) TestQueryChecksums() {
"success with one checksum",
func() {
signer := authtypes.NewModuleAddress(govtypes.ModuleName).String()
code, err := os.ReadFile("../test_data/ics10_grandpa_cw.wasm.gz")
suite.Require().NoError(err)
msg := types.NewMsgStoreCode(signer, code)
msg := types.NewMsgStoreCode(signer, wasmtesting.Code)

res, err := GetSimApp(suite.chainA).WasmClientKeeper.StoreCode(suite.chainA.GetContext(), msg)
suite.Require().NoError(err)
Expand All @@ -102,7 +98,7 @@ func (suite *KeeperTestSuite) TestQueryChecksums() {

for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.SetupTest()
suite.SetupWasmWithMockVM()

tc.malleate()

Expand Down
3 changes: 1 addition & 2 deletions modules/light-clients/08-wasm/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"os"

wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (suite *KeeperTestSuite) TestMsgStoreCode() {
suite.SetupWasmWithMockVM()

signer = authtypes.NewModuleAddress(govtypes.ModuleName).String()
data, _ = os.ReadFile("../test_data/ics10_grandpa_cw.wasm.gz")
data = wasmtesting.Code

tc.malleate()

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/testing/wasm_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (endpoint *WasmEndpoint) CreateClient() error {
require.NoError(endpoint.Chain.TB, err)

clientState := types.NewClientState(contractClientState, checksum, clienttypes.NewHeight(0, 1))
consensusState := types.NewConsensusState(contractConsensusState, 0)
consensusState := types.NewConsensusState(contractConsensusState)

msg, err := clienttypes.NewMsgCreateClient(
clientState, consensusState, endpoint.Chain.SenderAccount.GetAddress().String(),
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/client_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (suite *TypesTestSuite) TestInitialize() {
suite.Require().NoError(err)

clientState = types.NewClientState([]byte{1}, checksum, clienttypes.NewHeight(0, 1))
consensusState = types.NewConsensusState([]byte{2}, 0)
consensusState = types.NewConsensusState([]byte{2})

clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), clientState.ClientType())
clientStore = suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), clientID)
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/consensus_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var _ exported.ConsensusState = (*ConsensusState)(nil)

// NewConsensusState creates a new ConsensusState instance.
func NewConsensusState(data []byte, timestamp uint64) *ConsensusState {
func NewConsensusState(data []byte) *ConsensusState {
return &ConsensusState{
Data: data,
}
Expand Down
8 changes: 3 additions & 5 deletions modules/light-clients/08-wasm/types/consensus_state_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package types_test

import (
"time"

"github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
)
Expand All @@ -15,17 +13,17 @@ func (suite *TypesTestSuite) TestConsensusStateValidateBasic() {
}{
{
"success",
types.NewConsensusState([]byte("data"), uint64(time.Now().Unix())),
types.NewConsensusState([]byte("data")),
true,
},
{
"data is nil",
types.NewConsensusState(nil, uint64(time.Now().Unix())),
types.NewConsensusState(nil),
false,
},
{
"data is empty",
types.NewConsensusState([]byte{}, uint64(time.Now().Unix())),
types.NewConsensusState([]byte{}),
false,
},
}
Expand Down
3 changes: 1 addition & 2 deletions modules/light-clients/08-wasm/types/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package types_test

import (
"crypto/rand"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -27,7 +26,7 @@ func TestValidateWasmCode(t *testing.T) {
{
"success",
func() {
code, _ = os.ReadFile("../test_data/ics10_grandpa_cw.wasm.gz")
code = wasmtesting.Code
},
nil,
},
Expand Down

0 comments on commit 0077b98

Please sign in to comment.