Skip to content

Commit

Permalink
Remove grandpa unit test contract, rm test_data. (cosmos#5150)
Browse files Browse the repository at this point in the history
* Remove stored wasm contract in test_data.

* Remove grandpa unit test contract, rm test_data.
  • Loading branch information
DimitrisJim committed Nov 21, 2023
1 parent 84ede5b commit c54ec07
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
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.
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 c54ec07

Please sign in to comment.