extrinsic

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthoritiesChangeType = 0
	TransferType          = 1
	IncludeDataType       = 2
	StorageChangeType     = 3
)

nolint

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthoritiesChangeExt

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

AuthoritiesChangeExt represents an Extrinsic::AuthoritiesChange

func NewAuthoritiesChangeExt

func NewAuthoritiesChangeExt(authorityIDs [][32]byte) *AuthoritiesChangeExt

NewAuthoritiesChangeExt returns an AuthoritiesChangeExt

func (*AuthoritiesChangeExt) Decode

func (e *AuthoritiesChangeExt) Decode(r io.Reader) error

Decode decodes the SCALE encoding into a AuthoritiesChangeExt

func (*AuthoritiesChangeExt) Encode

func (e *AuthoritiesChangeExt) Encode() ([]byte, error)

Encode returns the SCALE encoding of the AuthoritiesChangeExt

func (*AuthoritiesChangeExt) Type

func (e *AuthoritiesChangeExt) Type() int

Type returns AuthoritiesChangeType

type Extrinsic

type Extrinsic interface {
	Type() int
	Encode() ([]byte, error)
	Decode(r io.Reader) error
}

Extrinsic represents a runtime Extrinsic

func DecodeExtrinsic

func DecodeExtrinsic(r io.Reader) (Extrinsic, error)

DecodeExtrinsic decodes an Extrinsic from a Reader

type IncludeDataExt

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

IncludeDataExt represents an Extrinsic::IncludeData

func NewIncludeDataExt

func NewIncludeDataExt(data []byte) *IncludeDataExt

NewIncludeDataExt returns a IncludeDataExt

func (*IncludeDataExt) Decode

func (e *IncludeDataExt) Decode(r io.Reader) error

Decode decodes the SCALE encoding into a IncludeDataExt

func (*IncludeDataExt) Encode

func (e *IncludeDataExt) Encode() ([]byte, error)

Encode returns the SCALE encoding of the IncludeDataExt

func (*IncludeDataExt) Type

func (e *IncludeDataExt) Type() int

Type returns IncludeDataType

type StorageChangeExt

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

StorageChangeExt represents an Extrinsic::StorageChange

func NewStorageChangeExt

func NewStorageChangeExt(key []byte, value *optional.Bytes) *StorageChangeExt

NewStorageChangeExt returns a StorageChangesExt

func (*StorageChangeExt) Decode

func (e *StorageChangeExt) Decode(r io.Reader) error

Decode decodes the SCALE encoding into a StorageChangeExt

func (*StorageChangeExt) Encode

func (e *StorageChangeExt) Encode() ([]byte, error)

Encode returns the SCALE encoding of the StorageChangeExt

func (*StorageChangeExt) Key

func (e *StorageChangeExt) Key() []byte

Key returns the extrinsic's key

func (*StorageChangeExt) Type

func (e *StorageChangeExt) Type() int

Type returns StorageChangeType

func (*StorageChangeExt) Value

func (e *StorageChangeExt) Value() *optional.Bytes

Value returns the extrinsic's value

type Transfer

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

Transfer represents a runtime Transfer

func NewTransfer

func NewTransfer(from, to [32]byte, amount, nonce uint64) *Transfer

NewTransfer returns a Transfer

func (*Transfer) AsSignedExtrinsic

func (t *Transfer) AsSignedExtrinsic(key *sr25519.PrivateKey) (*TransferExt, error)

AsSignedExtrinsic returns a TransferExt that includes the transfer and a signature.

func (*Transfer) Decode

func (t *Transfer) Decode(r io.Reader) (err error)

Decode decodes the SCALE encoding into a Transfer

func (*Transfer) Encode

func (t *Transfer) Encode() ([]byte, error)

Encode returns the SCALE encoding of the Transfer

type TransferExt

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

TransferExt represents an Extrinsic::Transfer

func NewTransferExt

func NewTransferExt(transfer *Transfer, signature [sr25519.SignatureLength]byte) *TransferExt

NewTransferExt returns a TransferExt

func (*TransferExt) Decode

func (e *TransferExt) Decode(r io.Reader) error

Decode decodes the SCALE encoding into a TransferExt

func (*TransferExt) Encode

func (e *TransferExt) Encode() ([]byte, error)

Encode returns the SCALE encoding of the TransferExt

func (*TransferExt) Type

func (e *TransferExt) Type() int

Type returns TransferType

Jump to

Keyboard shortcuts

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