program

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 4 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OP_APUSH = byte(iota + 1)
	OP_IPUSH
	OP_BUMP             // <value_to_bump: any> <any>*N <int N> => <any>*N <value_to_bump>
	OP_DELETE           // <value: not funding>
	OP_IADD             // <number> <number> => <number>
	OP_ISUB             // <number> <number> => <number>
	OP_PRINT            // <any>
	OP_FAIL             //
	OP_ASSET            // <asset | monetary | funding> => <asset>
	OP_MONETARY_NEW     // <asset> <number> => <monetary>
	OP_MONETARY_ADD     // <monetary> <monetary> => <monetary>   // panics if not same asset
	OP_MAKE_ALLOTMENT   // <portion>*N <int N> => <allotment(N)>
	OP_TAKE_ALL         // <source: account> <overdraft: monetary> => <funding>
	OP_TAKE_ALWAYS      // <source: account> <monetary> => <funding>   // takes amount from account unconditionally
	OP_TAKE             // <funding> <monetary> => <remaining: funding> <taken: funding> // fails with EXIT_INSUFFICIENT_FUNDS if not enough
	OP_TAKE_MAX         // <funding> <monetary> => <missing: monetary> <remaining: funding> <taken: funding> // Doesn't fail on insufficient funds. Either missing or remaining is zero.
	OP_FUNDING_ASSEMBLE // <funding>*N <int N> => <funding> (first has highest priority)
	OP_FUNDING_SUM      // <funding> => <funding> <sum: monetary>
	OP_FUNDING_REVERSE  // <funding> => <funding>
	OP_REPAY            // <funding>
	OP_ALLOC            // <monetary> <allotment(N)> => <monetary>*N
	OP_SEND             // <funding> <account>
	OP_TX_META          //
	OP_ACCOUNT_META     //
)

Variables

This section is empty.

Functions

func OpcodeName

func OpcodeName(op byte) string

Types

type Constant

type Constant struct {
	Inner core.Value
}

func (Constant) GetType

func (c Constant) GetType() core.Type

func (Constant) String

func (c Constant) String() string

type Program

type Program struct {
	Instructions   []byte
	Resources      []Resource
	NeededBalances map[core.Address]map[core.Address]struct{}
}

func (*Program) ParseVariables

func (p *Program) ParseVariables(vars map[string]core.Value) (map[string]core.Value, error)

func (*Program) ParseVariablesJSON

func (p *Program) ParseVariablesJSON(vars map[string]json.RawMessage) (map[string]core.Value, error)

func (Program) String

func (p Program) String() string

type Resource

type Resource interface {
	GetType() core.Type
}

type Variable added in v1.4.0

type Variable struct {
	Typ  core.Type
	Name string
}

func (Variable) GetType added in v1.4.0

func (p Variable) GetType() core.Type

func (Variable) String added in v1.4.0

func (p Variable) String() string

type VariableAccountBalance added in v1.4.0

type VariableAccountBalance struct {
	Name    string
	Account core.Address
	Asset   string
}

func (VariableAccountBalance) GetType added in v1.4.0

func (a VariableAccountBalance) GetType() core.Type

func (VariableAccountBalance) String added in v1.4.0

func (a VariableAccountBalance) String() string

type VariableAccountMetadata added in v1.4.0

type VariableAccountMetadata struct {
	Typ     core.Type
	Name    string
	Account core.Address
	Key     string
}

func (VariableAccountMetadata) GetType added in v1.4.0

func (m VariableAccountMetadata) GetType() core.Type

func (VariableAccountMetadata) String added in v1.4.0

func (m VariableAccountMetadata) String() string

Jump to

Keyboard shortcuts

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