Changed context and ADDMOD, MULMOD
* Cleaned up VM execution. VM run now takes a context * ADDMOD/MULMOD - removed incorrect cast
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package vm
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethutil"
|
||||
@ -117,3 +118,10 @@ func toValue(val *big.Int) interface{} {
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
func getCode(code []byte, start, size uint64) []byte {
|
||||
x := uint64(math.Min(float64(start), float64(len(code))))
|
||||
y := uint64(math.Min(float64(x+size), float64(len(code))))
|
||||
|
||||
return ethutil.RightPadBytes(code[x:y], int(size))
|
||||
}
|
||||
|
Reference in New Issue
Block a user