Skip to content

Commit 84d96d1

Browse files
committed
Address review feedback and add TODOs
1 parent b24aee1 commit 84d96d1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gno.land/pkg/sdk/vm/gas_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestAddPkgDeliverTxInsuffGas(t *testing.T) {
4646
assert.True(t, abort)
4747
assert.False(t, res.IsOK())
4848
gasCheck := gctx.GasMeter().GasConsumed()
49-
assert.True(t, gasCheck >= 3462)
49+
assert.Equal(t, int64(3641), gasCheck)
5050
} else {
5151
t.Errorf("should panic")
5252
}
@@ -71,7 +71,7 @@ func TestAddPkgDeliverTx(t *testing.T) {
7171
assert.True(t, res.IsOK())
7272

7373
// NOTE: let's try to keep this bellow 150_000 :)
74-
assert.True(t, gasDeliver >= 143845)
74+
assert.Equal(t, int64(144024), gasDeliver)
7575
}
7676

7777
// Enough gas for a failed transaction.
@@ -88,7 +88,7 @@ func TestAddPkgDeliverTxFailed(t *testing.T) {
8888
gasDeliver := gctx.GasMeter().GasConsumed()
8989

9090
assert.False(t, res.IsOK())
91-
assert.True(t, gasDeliver >= 1231)
91+
assert.Equal(t, int64(1410), gasDeliver)
9292
}
9393

9494
// Not enough gas for a failed transaction.

gnovm/pkg/gnolang/gotypecheck.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (atgc *astTraversingGasCharger) consumeGas(amount storetypes.Gas) {
210210
atgc.m.ConsumeGas(amount, "typeCheck")
211211
}
212212

213-
const _BASIC_TYPECHECK_GAS_CHARGE = 5 // Arbitrary value.
213+
const _BASIC_TYPECHECK_GAS_CHARGE = 5 // Arbitrary value, needs more research and derivation.
214214

215215
func (atgc *astTraversingGasCharger) Visit(n ast.Node) ast.Visitor {
216216
switch n.(type) {
@@ -273,7 +273,7 @@ func (atgc *astTraversingGasCharger) Visit(n ast.Node) ast.Visitor {
273273
case nil:
274274
atgc.consumeGas(_BASIC_TYPECHECK_GAS_CHARGE / 2)
275275

276-
default:
276+
default: // IndexExpr, StarExpr et al, all fall under defaults here.
277277
atgc.consumeGas(_BASIC_TYPECHECK_GAS_CHARGE * 3)
278278
}
279279

0 commit comments

Comments
 (0)