Skip to content

Commit

Permalink
Remove grandpa unit test contract, rm test_data. (#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.

(cherry picked from commit c54ec07)
  • Loading branch information
DimitrisJim authored and mergify[bot] committed Nov 29, 2023
1 parent b15c86e commit ee0c1cb
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 @@ -113,7 +112,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 ee0c1cb

Please sign in to comment.