context

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Script     util.Uint160
	Parameters []smartcontract.Parameter
	Signatures map[string][]byte
}

Item represents a transaction context item.

func (*Item) AddSignature

func (it *Item) AddSignature(pub *keys.PublicKey, sig []byte)

AddSignature adds a signature for pub.

func (*Item) GetSignature

func (it *Item) GetSignature(pub *keys.PublicKey) []byte

GetSignature returns signature for pub if present.

func (Item) MarshalJSON

func (it Item) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Item) UnmarshalJSON

func (it *Item) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type ParameterContext

type ParameterContext struct {
	// Type is a type of a verifiable item.
	Type string
	// Verifiable is an object which can be (de-)serialized.
	Verifiable io.Serializable
	// Items is a map from script hashes to context items.
	Items map[util.Uint160]*Item
}

ParameterContext represents smartcontract parameter's context.

func NewParameterContext

func NewParameterContext(typ string, verif io.Serializable) *ParameterContext

NewParameterContext returns ParameterContext with the specified type and item to sign.

func (*ParameterContext) AddSignature

func (c *ParameterContext) AddSignature(ctr *wallet.Contract, pub *keys.PublicKey, sig []byte) error

AddSignature adds a signature for the specified contract and public key.

func (*ParameterContext) GetWitness

func (c *ParameterContext) GetWitness(ctr *wallet.Contract) (*transaction.Witness, error)

GetWitness returns invocation and verification scripts for the specified contract.

func (ParameterContext) MarshalJSON

func (c ParameterContext) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*ParameterContext) UnmarshalJSON

func (c *ParameterContext) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

Jump to

Keyboard shortcuts

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