aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/stack.go')
-rw-r--r--ethchain/stack.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/ethchain/stack.go b/ethchain/stack.go
index 74f3d7ec9..e08f84082 100644
--- a/ethchain/stack.go
+++ b/ethchain/stack.go
@@ -159,6 +159,22 @@ func (st *Stack) Popn() (*big.Int, *big.Int) {
return ints[0], ints[1]
}
+func (st *Stack) Peek() *big.Int {
+ s := len(st.data)
+
+ str := st.data[s-1]
+
+ return str
+}
+
+func (st *Stack) Peekn() (*big.Int, *big.Int) {
+ s := len(st.data)
+
+ ints := st.data[s-2:]
+
+ return ints[0], ints[1]
+}
+
func (st *Stack) Push(d *big.Int) {
st.data = append(st.data, d)
}