Minor improvements

* Moved gas and mem size to its own function
This commit is contained in:
obscuren
2014-12-31 11:12:40 +01:00
parent 4b4e082102
commit 4547a05a68
2 changed files with 169 additions and 162 deletions

View File

@ -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 {