program

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 6 modules, 5 packages

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 (
	Signature ProgramContextParameterType = 0
	CHECKSIG  byte                        = 0xAC
)

Variables

This section is empty.

Functions

func CreateProgramHash

func CreateProgramHash(pubKey []byte) (common.Uint160, error)

func CreateSignatureProgramCode

func CreateSignatureProgramCode(pubKey []byte) ([]byte, error)

CODE: len(publickey) + publickey + CHECKSIG

func GetPublicKeyFromCode

func GetPublicKeyFromCode(code []byte) ([]byte, error)

CODE: len(publickey) + publickey + CHECKSIG -------------------------------------------- Size: 1 32 1

func GetSignatureFromParameter

func GetSignatureFromParameter(parameter []byte) ([]byte, error)

Parameter: len(signature) + signature -------------------------------------------- Size: 1 64

func ProgramContextParameterTypeToByte

func ProgramContextParameterTypeToByte(c []ProgramContextParameterType) []byte

Types

type ProgramContext

type ProgramContext struct {

	//the program code,which will be run on VM or specific environment
	Code []byte

	//the ProgramContext Parameter type list
	// describe the number of program parameters and the parameter type
	Parameters []ProgramContextParameterType

	//The program hash as address
	ProgramHash common.Uint160

	//owner's pubkey hash indicate the owner of program
	OwnerPubkeyHash common.Uint160
}

func CreateSignatureProgramContext

func CreateSignatureProgramContext(ownerPubKey []byte) (*ProgramContext, error)

create a single signature program context for owner

func (*ProgramContext) Deserialize

func (c *ProgramContext) Deserialize(r io.Reader) error

func (*ProgramContext) NewProgram

func (c *ProgramContext) NewProgram(signature []byte) *pb.Program

Parameter: len(signature) + signature

func (*ProgramContext) Serialize

func (c *ProgramContext) Serialize(w io.Writer) error

func (*ProgramContext) ToArray

func (c *ProgramContext) ToArray() []byte

type ProgramContextParameterType

type ProgramContextParameterType byte

func ByteToProgramContextParameterType

func ByteToProgramContextParameterType(b []byte) []ProgramContextParameterType

Jump to

Keyboard shortcuts

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