diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-05 22:14:01 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-05 22:14:01 +0800 |
commit | 5b34fa538e54320778314081df97da561f7c6314 (patch) | |
tree | dca15c858b8ac4cd79ed7b7733260ab3021bbd0c /core/vm/gas.go | |
parent | 8b865fa9bf75e728d5d76f5a1460e0c37d8b5f9e (diff) | |
parent | 7c7692933c21b77328a94eed714f66c276776197 (diff) | |
download | dexon-5b34fa538e54320778314081df97da561f7c6314.tar dexon-5b34fa538e54320778314081df97da561f7c6314.tar.gz dexon-5b34fa538e54320778314081df97da561f7c6314.tar.bz2 dexon-5b34fa538e54320778314081df97da561f7c6314.tar.lz dexon-5b34fa538e54320778314081df97da561f7c6314.tar.xz dexon-5b34fa538e54320778314081df97da561f7c6314.tar.zst dexon-5b34fa538e54320778314081df97da561f7c6314.zip |
Merge pull request #1756 from obscuren/core-refactor
core, core/vm: refactor
Diffstat (limited to 'core/vm/gas.go')
-rw-r--r-- | core/vm/gas.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/vm/gas.go b/core/vm/gas.go index b2f068e6e..bff0ac91b 100644 --- a/core/vm/gas.go +++ b/core/vm/gas.go @@ -37,6 +37,7 @@ var ( GasContractByte = big.NewInt(200) ) +// baseCheck checks for any stack error underflows func baseCheck(op OpCode, stack *stack, gas *big.Int) error { // PUSH and DUP are a bit special. They all cost the same but we do want to have checking on stack push limit // PUSH is also allowed to calculate the same price for all PUSHes @@ -63,6 +64,7 @@ func baseCheck(op OpCode, stack *stack, gas *big.Int) error { return nil } +// casts a arbitrary number to the amount of words (sets of 32 bytes) func toWordSize(size *big.Int) *big.Int { tmp := new(big.Int) tmp.Add(size, u256(31)) |