stack

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2023 The AmazeChain Authors This file is part of the AmazeChain library.

The AmazeChain library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The AmazeChain library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the AmazeChain library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnNormalStack

func ReturnNormalStack(s *Stack)

func ReturnRStack

func ReturnRStack(rs *ReturnStack)

Types

type ReturnStack

type ReturnStack struct {
	// contains filtered or unexported fields
}

ReturnStack is an object for basic return stack operations.

func NewReturnStack

func NewReturnStack() *ReturnStack

func (*ReturnStack) Data

func (st *ReturnStack) Data() []uint32

func (*ReturnStack) Pop

func (st *ReturnStack) Pop() (ret uint32)

A uint32 is sufficient as for code below 4.2G

func (*ReturnStack) Push

func (st *ReturnStack) Push(d uint32)

type Stack

type Stack struct {
	Data []uint256.Int
}

Stack is an object for basic stack operations. Items popped to the stack are expected to be changed and modified. stack does not take care of adding newly initialised objects.

func New

func New() *Stack

func (*Stack) Back

func (st *Stack) Back(n int) *uint256.Int

Back returns the n'th item in stack

func (*Stack) Cap

func (st *Stack) Cap() int

func (*Stack) Dup

func (st *Stack) Dup(n int)

func (*Stack) Len

func (st *Stack) Len() int

func (*Stack) Peek

func (st *Stack) Peek() *uint256.Int

func (*Stack) Pop

func (st *Stack) Pop() (ret uint256.Int)

func (*Stack) Print

func (st *Stack) Print()

Print dumps the content of the stack

func (*Stack) Push

func (st *Stack) Push(d *uint256.Int)

func (*Stack) PushN

func (st *Stack) PushN(ds ...uint256.Int)

func (*Stack) Reset

func (st *Stack) Reset()

func (*Stack) Swap

func (st *Stack) Swap(n int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL