File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ func TestAddPkgDeliverTxInsuffGas(t *testing.T) {
46
46
assert .True (t , abort )
47
47
assert .False (t , res .IsOK ())
48
48
gasCheck := gctx .GasMeter ().GasConsumed ()
49
- assert .True (t , gasCheck >= 3462 )
49
+ assert .Equal (t , int64 ( 3641 ), gasCheck )
50
50
} else {
51
51
t .Errorf ("should panic" )
52
52
}
@@ -71,7 +71,7 @@ func TestAddPkgDeliverTx(t *testing.T) {
71
71
assert .True (t , res .IsOK ())
72
72
73
73
// NOTE: let's try to keep this bellow 150_000 :)
74
- assert .True (t , gasDeliver >= 143845 )
74
+ assert .Equal (t , int64 ( 144024 ), gasDeliver )
75
75
}
76
76
77
77
// Enough gas for a failed transaction.
@@ -88,7 +88,7 @@ func TestAddPkgDeliverTxFailed(t *testing.T) {
88
88
gasDeliver := gctx .GasMeter ().GasConsumed ()
89
89
90
90
assert .False (t , res .IsOK ())
91
- assert .True (t , gasDeliver >= 1231 )
91
+ assert .Equal (t , int64 ( 1410 ), gasDeliver )
92
92
}
93
93
94
94
// Not enough gas for a failed transaction.
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ func (atgc *astTraversingGasCharger) consumeGas(amount storetypes.Gas) {
210
210
atgc .m .ConsumeGas (amount , "typeCheck" )
211
211
}
212
212
213
- const _BASIC_TYPECHECK_GAS_CHARGE = 5 // Arbitrary value.
213
+ const _BASIC_TYPECHECK_GAS_CHARGE = 5 // Arbitrary value, needs more research and derivation .
214
214
215
215
func (atgc * astTraversingGasCharger ) Visit (n ast.Node ) ast.Visitor {
216
216
switch n .(type ) {
@@ -273,7 +273,7 @@ func (atgc *astTraversingGasCharger) Visit(n ast.Node) ast.Visitor {
273
273
case nil :
274
274
atgc .consumeGas (_BASIC_TYPECHECK_GAS_CHARGE / 2 )
275
275
276
- default :
276
+ default : // IndexExpr, StarExpr et al, all fall under defaults here.
277
277
atgc .consumeGas (_BASIC_TYPECHECK_GAS_CHARGE * 3 )
278
278
}
279
279
You can’t perform that action at this time.
0 commit comments