aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNalin Bhardwaj <nalinbhardwaj@nibnalin.me>2019-01-24 19:14:02 +0800
committerFelix Lange <fjl@users.noreply.github.com>2019-01-24 19:14:02 +0800
commitb8f9b3779fbdc62d5a935b57f1360608fa4600b4 (patch)
tree30083a63ea69a486bb7f1a4dffd2a0327bd7b3f1 /core
parentfa34429a2695f57bc0a96cd78f25e86700d8ee44 (diff)
downloadgo-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar.gz
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar.bz2
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar.lz
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar.xz
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.tar.zst
go-tangerine-b8f9b3779fbdc62d5a935b57f1360608fa4600b4.zip
core/vm: fix typos and use ExpGas for EXP (#18400)
This replaces the GasSlowStep constant with params.ExpGas. Both constants have value 10.
Diffstat (limited to 'core')
-rw-r--r--core/vm/gas_table.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go
index 9203e10a7..f22463c33 100644
--- a/core/vm/gas_table.go
+++ b/core/vm/gas_table.go
@@ -22,7 +22,7 @@ import (
"github.com/ethereum/go-ethereum/params"
)
-// memoryGasCosts calculates the quadratic gas for memory expansion. It does so
+// memoryGasCost calculates the quadratic gas for memory expansion. It does so
// only for the memory region that is expanded, not the total memory.
func memoryGasCost(mem *Memory, newMemSize uint64) (uint64, error) {
@@ -382,7 +382,7 @@ func gasExp(gt params.GasTable, evm *EVM, contract *Contract, stack *Stack, mem
gas = expByteLen * gt.ExpByte // no overflow check required. Max is 256 * ExpByte gas
overflow bool
)
- if gas, overflow = math.SafeAdd(gas, GasSlowStep); overflow {
+ if gas, overflow = math.SafeAdd(gas, params.ExpGas); overflow {
return 0, errGasUintOverflow
}
return gas, nil