mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
Add Invocation stack - convenience RAS
This commit is contained in:
parent
1ff0caf40e
commit
f954e6f2ca
3 changed files with 65 additions and 2 deletions
|
@ -119,3 +119,15 @@ func (ras *RandomAccess) Peek(n uint16) (Item, error) {
|
|||
|
||||
return ras.vals[index], nil
|
||||
}
|
||||
|
||||
// Convenience Functions
|
||||
|
||||
// PopInt will remove the last stack item that was added
|
||||
// And cast it to an integer
|
||||
func (ras *RandomAccess) PopInt() (*Int, error) {
|
||||
item, err := ras.Pop()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return item.Integer()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue