From 17c8082eec9f9852a144af388b88e31d154454f4 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Mon, 29 Apr 2024 23:23:01 +0700 Subject: [PATCH] refactor: update payload --- tests/interchaintest/ibc_transfer_test.go | 4 ++-- .../interchaintest/push_wasm_client_code_test.go | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/interchaintest/ibc_transfer_test.go b/tests/interchaintest/ibc_transfer_test.go index 5fb933ed..5c47a5e3 100644 --- a/tests/interchaintest/ibc_transfer_test.go +++ b/tests/interchaintest/ibc_transfer_test.go @@ -327,11 +327,11 @@ func pushWasmContractViaGov(t *testing.T, ctx context.Context, centaurid *cosmos var getCodeQueryMsgRsp GetCodeQueryMsgResponse err = centaurid.QueryClientContractCode(ctx, codeHash, &getCodeQueryMsgRsp) - codeHashByte32 := sha256.Sum256(getCodeQueryMsgRsp.Code) + codeHashByte32 := sha256.Sum256(getCodeQueryMsgRsp.Data) codeHash2 := hex.EncodeToString(codeHashByte32[:]) t.Logf("Contract codeHash from code: %s", codeHash2) require.NoError(t, err) - require.NotEmpty(t, getCodeQueryMsgRsp.Code) + require.NotEmpty(t, getCodeQueryMsgRsp.Data) require.Equal(t, codeHash, codeHash2) return codeHash diff --git a/tests/interchaintest/push_wasm_client_code_test.go b/tests/interchaintest/push_wasm_client_code_test.go index f730c4ad..537058d9 100644 --- a/tests/interchaintest/push_wasm_client_code_test.go +++ b/tests/interchaintest/push_wasm_client_code_test.go @@ -23,7 +23,7 @@ import ( ) const ( - heightDelta = 20 + heightDelta = 30 votingPeriod = "20s" maxDepositPeriod = "10s" ) @@ -127,8 +127,11 @@ func TestPushWasmClientCode(t *testing.T) { centauridChain := centaurid.(*cosmos.CosmosChain) // Verify a normal user cannot push a wasm light client contract - _, err = centauridChain.StoreClientContract(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm") - require.ErrorContains(t, err, "invalid authority") + args := []string{"--title", "test", "--summary", "test", "--deposit", "500000000" + centauridChain.Config().Denom} + _, err = centauridChain.StoreClientContract(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm", args...) + fmt.Println(err) + // require.ErrorContains(t, err, "invalid authority") + require.NoError(t, err, "invalid authority") proposal := cosmos.TxProposalv1{ Metadata: "none", @@ -157,16 +160,16 @@ func TestPushWasmClientCode(t *testing.T) { var getCodeQueryMsgRsp GetCodeQueryMsgResponse err = centauridChain.QueryClientContractCode(ctx, codeHash, &getCodeQueryMsgRsp) - codeHashByte32 := sha256.Sum256(getCodeQueryMsgRsp.Code) + codeHashByte32 := sha256.Sum256(getCodeQueryMsgRsp.Data) codeHash2 := hex.EncodeToString(codeHashByte32[:]) t.Logf("Contract codeHash from code: %s", codeHash2) require.NoError(t, err) - require.NotEmpty(t, getCodeQueryMsgRsp.Code) + require.NotEmpty(t, getCodeQueryMsgRsp.Data) require.Equal(t, codeHash, codeHash2) } type GetCodeQueryMsgResponse struct { - Code []byte `json:"code"` + Data []byte `json:"data"` } func modifyGenesisShortProposals(votingPeriod, maxDepositPeriod string) func(ibc.ChainConfig, []byte) ([]byte, error) {