Adjust gas prices in tests

This commit is contained in:
Ethan Frey 2021-07-28 01:54:36 +02:00
parent 774034f862
commit b34290772b
3 changed files with 9 additions and 9 deletions

View File

@ -284,7 +284,7 @@ func TestInstantiate(t *testing.T) {
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0x12280), gasAfter-gasBefore)
require.Equal(t, uint64(0x12206), gasAfter-gasBefore)
}
// ensure it is stored properly
@ -517,7 +517,7 @@ func TestExecute(t *testing.T) {
// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0x12afd), gasAfter-gasBefore)
require.Equal(t, uint64(0x12aef), gasAfter-gasBefore)
}
// ensure bob now exists and got both payments released
bobAcct = accKeeper.GetAccount(ctx, bob)

View File

@ -57,12 +57,12 @@ func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.Acc
func TestGasCostOnQuery(t *testing.T) {
const (
GasNoWork uint64 = 44_240
GasNoWork uint64 = 44_149
// Note: about 100 SDK gas (10k wasmer gas) for each round of sha256
GasWork50 uint64 = 49_901 // this is a little shy of 50k gas - to keep an eye on the limit
GasWork50 uint64 = 49_809 // this is a little shy of 50k gas - to keep an eye on the limit
GasReturnUnhashed uint64 = 197
GasReturnHashed uint64 = 173
GasReturnUnhashed uint64 = 256
GasReturnHashed uint64 = 232
)
cases := map[string]struct {
@ -221,9 +221,9 @@ func TestLimitRecursiveQueryGas(t *testing.T) {
const (
// Note: about 100 SDK gas (10k wasmer gas) for each round of sha256
GasWork2k uint64 = 273_170 // = NewContractInstanceCosts + x // we have 6x gas used in cpu than in the instance
GasWork2k uint64 = 273_076 // = NewContractInstanceCosts + x // we have 6x gas used in cpu than in the instance
// This is overhead for calling into a sub-contract
GasReturnHashed uint64 = 177
GasReturnHashed uint64 = 236
)
cases := map[string]struct {

View File

@ -411,7 +411,7 @@ func TestOnRecvPacket(t *testing.T) {
},
"submessage reply can overwrite ack data": {
contractAddr: example.Contract,
expContractGas: myContractGas + 10 + DefaultInstanceCost + 3708,
expContractGas: myContractGas + 10 + DefaultInstanceCost + 3707,
contractResp: &wasmvmtypes.IBCReceiveResponse{
Acknowledgement: []byte("myAck"),
Messages: []wasmvmtypes.SubMsg{{ReplyOn: wasmvmtypes.ReplyAlways, Msg: wasmvmtypes.CosmosMsg{Bank: &wasmvmtypes.BankMsg{}}}},