Documentation ¶
Index ¶
- Constants
- func CreateProgramHash(pubkey *crypto.PubKey) (Uint160, error)
- func CreateSignatureProgramCode(pubkey *crypto.PubKey) ([]byte, error)
- func GetPublicKeyFromCode(code []byte) ([]byte, error)
- func GetSignatureFromParameter(parameter []byte) ([]byte, error)
- func ProgramContextParameterTypeToByte(c []ProgramContextParameterType) []byte
- type ProgramContext
- type ProgramContextParameterType
Constants ¶
View Source
const ( Signature ProgramContextParameterType = 0 CHECKSIG byte = 0xAC )
Variables ¶
This section is empty.
Functions ¶
func CreateProgramHash ¶
func CreateSignatureProgramCode ¶
CODE: len(publickey) + publickey + CHECKSIG
func GetPublicKeyFromCode ¶
CODE: len(publickey) + publickey + CHECKSIG -------------------------------------------- Size: 1 32 1
func GetSignatureFromParameter ¶
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 Uint160 //owner's pubkey hash indicate the owner of program OwnerPubkeyHash Uint160 }
func CreateSignatureProgramContext ¶
func CreateSignatureProgramContext(ownerPubKey *crypto.PubKey) (*ProgramContext, error)
create a Single Singature 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) ToArray ¶
func (c *ProgramContext) ToArray() []byte
type ProgramContextParameterType ¶
type ProgramContextParameterType byte
func ByteToProgramContextParameterType ¶
func ByteToProgramContextParameterType(b []byte) []ProgramContextParameterType
Click to show internal directories.
Click to hide internal directories.