Fix gas prices

This commit is contained in:
Ethan Frey
2021-04-12 21:49:43 +02:00
parent 6189e17271
commit 84a6c4d7f4
3 changed files with 13 additions and 13 deletions

View File

@@ -283,7 +283,7 @@ func TestInstantiate(t *testing.T) {
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0x11ca8), gasAfter-gasBefore)
require.Equal(t, uint64(0x1229f), gasAfter-gasBefore)
}
// ensure it is stored properly
@@ -516,7 +516,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(0x12963), gasAfter-gasBefore)
require.Equal(t, uint64(0x129d6), 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_074
GasNoWork uint64 = 44_072
// Note: about 100 SDK gas (10k wasmer gas) for each round of sha256
GasWork50 uint64 = 49_744 // this is a little shy of 50k gas - to keep an eye on the limit
GasWork50 uint64 = 49_763 // this is a little shy of 50k gas - to keep an eye on the limit
GasReturnUnhashed uint64 = 287
GasReturnHashed uint64 = 262
GasReturnUnhashed uint64 = 283
GasReturnHashed uint64 = 258
)
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 = 272_797 // = InstanceCost + x // we have 6x gas used in cpu than in the instance
GasWork2k uint64 = 273_566 // = InstanceCost + x // we have 6x gas used in cpu than in the instance
// This is overhead for calling into a sub-contract
GasReturnHashed uint64 = 265
GasReturnHashed uint64 = 262
)
cases := map[string]struct {

View File

@@ -59,8 +59,8 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) {
reflectSend := ReflectHandleMsg{
ReflectSubCall: &reflectSubPayload{
Msgs: []wasmvmtypes.SubMsg{{
ID: 7,
Msg: msg,
ID: 7,
Msg: msg,
ReplyOn: wasmvmtypes.ReplyAlways,
}},
},
@@ -323,7 +323,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
ID: tc.submsgID,
Msg: msg,
GasLimit: tc.gasLimit,
ReplyOn: wasmvmtypes.ReplyAlways,
ReplyOn: wasmvmtypes.ReplyAlways,
}},
},
}
@@ -423,8 +423,8 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) {
reflectSend := ReflectHandleMsg{
ReflectSubCall: &reflectSubPayload{
Msgs: []wasmvmtypes.SubMsg{{
ID: 7,
Msg: msg,
ID: 7,
Msg: msg,
ReplyOn: wasmvmtypes.ReplyAlways,
}},
},