From 667aec895e182c7fbd4bd1a67a7e6978deda80e6 Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:03:50 -0800 Subject: [PATCH] test: add WasmGasLimitQuery --- x/evm/precompile/test/export.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/evm/precompile/test/export.go b/x/evm/precompile/test/export.go index 3e04b949d..55d0eb4f8 100644 --- a/x/evm/precompile/test/export.go +++ b/x/evm/precompile/test/export.go @@ -25,6 +25,7 @@ import ( const ( WasmGasLimitInstantiate uint64 = 1_000_000 WasmGasLimitExecute uint64 = 10_000_000 + WasmGasLimitQuery uint64 = 200_000 ) // SetupWasmContracts stores all Wasm bytecode and has the "deps.Sender" @@ -186,7 +187,7 @@ func AssertWasmCounterState( &precompile.PrecompileAddr_Wasm, true, input, - WasmGasLimitInstantiate, + WasmGasLimitQuery, ) s.Require().NoError(err) s.Require().NotEmpty(ethTxResp.Ret) @@ -207,12 +208,11 @@ func AssertWasmCounterState( s.T().Log("Response is a JSON-encoded struct from the Wasm contract") var wasmMsg wasm.RawContractMessage - err = json.Unmarshal(queryResp, &wasmMsg) - s.NoError(err) + s.NoError(json.Unmarshal(queryResp, &wasmMsg)) s.NoError(wasmMsg.ValidateBasic()) + var typedResp QueryMsgCountResp - err = json.Unmarshal(wasmMsg, &typedResp) - s.NoError(err) + s.NoError(json.Unmarshal(queryResp, &typedResp)) s.EqualValues(wantCount, typedResp.Count) s.EqualValues(deps.Sender.NibiruAddr.String(), typedResp.Owner)