diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-19 07:35:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-19 07:35:32 +0800 |
commit | 489576b6f04585b33c8aedd8aa6e5a8d54e1a960 (patch) | |
tree | f9413f764cc5dc8ab20515423ef2c6154fa2077e /stack.go | |
parent | ee61cfcfa776a1626fe3de7138942c1d796afdca (diff) | |
download | dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar.gz dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar.bz2 dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar.lz dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar.xz dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.tar.zst dexon-489576b6f04585b33c8aedd8aa6e5a8d54e1a960.zip |
More opcodes
Diffstat (limited to 'stack.go')
-rw-r--r-- | stack.go | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/ethereum/ethutil-go" "math/big" ) @@ -135,14 +134,14 @@ type TxCallback func(opType OpType) bool // Simple push/pop stack mechanism type Stack struct { - data []string + data []*big.Int } func NewStack() *Stack { return &Stack{} } -func (st *Stack) Pop() string { +func (st *Stack) Pop() *big.Int { s := len(st.data) str := st.data[s-1] @@ -154,13 +153,13 @@ func (st *Stack) Pop() string { func (st *Stack) Popn() (*big.Int, *big.Int) { s := len(st.data) - strs := st.data[s-2:] + ints := st.data[s-2:] st.data = st.data[:s-2] - return ethutil.Big(strs[0]), ethutil.Big(strs[1]) + return ints[0], ints[1] } -func (st *Stack) Push(d string) { +func (st *Stack) Push(d *big.Int) { st.data = append(st.data, d) } func (st *Stack) Print() { |