aboutsummaryrefslogtreecommitdiffstats
path: root/vm/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/stack.go')
-rw-r--r--vm/stack.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm/stack.go b/vm/stack.go
index 6091479cb..b9eaa10cd 100644
--- a/vm/stack.go
+++ b/vm/stack.go
@@ -91,6 +91,12 @@ func (st *Stack) Get(amount *big.Int) []*big.Int {
return nil
}
+func (st *Stack) require(n int) {
+ if st.Len() < n {
+ panic(fmt.Sprintf("stack underflow (%d <=> %d)", st.Len(), n))
+ }
+}
+
func (st *Stack) Print() {
fmt.Println("### stack ###")
if len(st.data) > 0 {