From 46d721c74e6c6eab43b939c4b1e1904747dc603c Mon Sep 17 00:00:00 2001 From: Pino' Surace Date: Thu, 12 Sep 2024 17:44:03 +0200 Subject: [PATCH] Fix some tests --- x/wasm/keeper/relay_test.go | 2 +- x/wasm/keeper/submsg_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x/wasm/keeper/relay_test.go b/x/wasm/keeper/relay_test.go index 69177a953..42746fcf9 100644 --- a/x/wasm/keeper/relay_test.go +++ b/x/wasm/keeper/relay_test.go @@ -427,7 +427,7 @@ func TestOnRecvPacket(t *testing.T) { }, "submessage reply can overwrite ack data": { contractAddr: example.Contract, - expContractGas: types.DefaultInstanceCostDiscount + myContractGas + storageCosts, + expContractGas: types.DefaultInstanceCost + myContractGas + storageCosts + 1_000, contractResp: &wasmvmtypes.IBCReceiveResult{ Ok: &wasmvmtypes.IBCReceiveResponse{ Acknowledgement: []byte("myAck"), diff --git a/x/wasm/keeper/submsg_test.go b/x/wasm/keeper/submsg_test.go index b5e4a879a..3bbf7fb70 100644 --- a/x/wasm/keeper/submsg_test.go +++ b/x/wasm/keeper/submsg_test.go @@ -243,14 +243,14 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { "send tokens": { submsgID: 5, msg: validBankSend, - resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(110_000, 112_000)}, + resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(110_000, 113_000)}, }, "not enough tokens": { submsgID: 6, msg: invalidBankSend, subMsgError: true, // uses less gas than the send tokens (cost of bank transfer) - resultAssertions: []assertion{assertGasUsed(78_000, 81_000), assertErrorString("codespace: sdk, code: 5")}, + resultAssertions: []assertion{assertGasUsed(78_000, 82_000), assertErrorString("codespace: sdk, code: 5")}, }, "out of gas panic with no gas limit": { submsgID: 7, @@ -263,7 +263,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { msg: validBankSend, gasLimit: &subGasLimit, // uses same gas as call without limit (note we do not charge the 40k on reply) - resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(110_000, 112_000)}, + resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(110_000, 113_000)}, }, "not enough tokens with limit": { submsgID: 16, @@ -271,7 +271,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { subMsgError: true, gasLimit: &subGasLimit, // uses same gas as call without limit (note we do not charge the 40k on reply) - resultAssertions: []assertion{assertGasUsed(78_000, 81_000), assertErrorString("codespace: sdk, code: 5")}, + resultAssertions: []assertion{assertGasUsed(78_000, 82_000), assertErrorString("codespace: sdk, code: 5")}, }, "out of gas caught with gas limit": { submsgID: 17, @@ -279,7 +279,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { subMsgError: true, gasLimit: &subGasLimit, // uses all the subGasLimit, plus the 52k or so for the main contract - resultAssertions: []assertion{assertGasUsed(subGasLimit+75_000, subGasLimit+77_000), assertErrorString("codespace: sdk, code: 11")}, + resultAssertions: []assertion{assertGasUsed(subGasLimit+75_000, subGasLimit+78_000), assertErrorString("codespace: sdk, code: 11")}, }, "instantiate contract gets address in data and events": { submsgID: 21,