mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
Add conversions for bytearray and Int stack items
This commit is contained in:
parent
8d55ea12f0
commit
da0a56f922
3 changed files with 68 additions and 2 deletions
|
@ -70,7 +70,6 @@ func (ras *RandomAccess) Push(item Item) *RandomAccess {
|
|||
|
||||
// Insert will push a stackItem onto the stack at position `n`
|
||||
// Note; index 0 is the top of the stack, which is the end of slice
|
||||
// REDO:
|
||||
func (ras *RandomAccess) Insert(n uint16, item Item) (*RandomAccess, error) {
|
||||
|
||||
if n == 0 {
|
||||
|
@ -112,7 +111,6 @@ func (ras *RandomAccess) Peek(n uint16) (Item, error) {
|
|||
}
|
||||
|
||||
// Check that we are not peeking out of the bounds
|
||||
|
||||
if n > stackSize-1 {
|
||||
return nil, fmt.Errorf("Tried to peek at index %d when length of stack is %d", n, len(ras.vals))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue