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

Remove grandpa unit test contract, rm test_data. (backport #5150) #5257

Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading