program

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxProgramCodeSize is the maximum allowed length of program code.
	MaxProgramCodeSize = 10000

	// MaxProgramParamSize is the maximum allowed length of program parameter.
	MaxProgramParamSize = MaxProgramCodeSize * 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.2.2

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

func NewProgramBuilder added in v0.2.2

func NewProgramBuilder() *Builder

func (*Builder) AddCodes added in v0.2.2

func (pb *Builder) AddCodes(codes []byte)

func (*Builder) AddOp added in v0.2.2

func (pb *Builder) AddOp(op vm.OpCode)

func (*Builder) PushData added in v0.2.2

func (pb *Builder) PushData(data []byte)

func (*Builder) PushNumber added in v0.2.2

func (pb *Builder) PushNumber(number *big.Int)

func (*Builder) ToArray added in v0.2.2

func (pb *Builder) ToArray() []byte

type Program

type Program struct {
	//the contract program code,which will be run on VM or specific environment
	Code []byte

	//the program code's parameter
	Parameter []byte
}

func (*Program) Deserialize

func (p *Program) Deserialize(w io.Reader) error

Deserialize the Program

func (*Program) Serialize

func (p *Program) Serialize(w io.Writer) error

Serialize the Program

func (Program) String

func (p Program) String() string

Jump to

Keyboard shortcuts

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