types

package
v0.0.1-rc-1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExtrinsicFormatVersion is the current version of the [`UncheckedExtrinsic`] encoded format.
	//
	// This version needs to be bumped if the encoded representation changes.
	// It ensures that if the representation is changed and the format is not known,
	// the decoding fails.
	ExtrinsicFormatVersion = 4
	ExtrinsicBitSigned     = 0b1000_0000
	ExtrinsicUnmaskVersion = 0b0111_1111
)

Variables

This section is empty.

Functions

func DecodeCall

func DecodeCall(buffer *bytes.Buffer) primitives.Call

Types

type Block

type Block struct {
	Header     types.Header
	Extrinsics sc.Sequence[UncheckedExtrinsic]
}

func DecodeBlock

func DecodeBlock(buffer *bytes.Buffer) Block

func (Block) Bytes

func (b Block) Bytes() []byte

func (Block) Encode

func (b Block) Encode(buffer *bytes.Buffer)

type CheckedExtrinsic

type CheckedExtrinsic struct {
	Version sc.U8

	// Who this purports to be from and the number of extrinsics have come before
	// from the same signer, if anyone (note this is not a signature).
	Signed   sc.Option[primitives.AccountIdExtra]
	Function primitives.Call
}

CheckedExtrinsic is the definition of something that the external world might want to say; its existence implies that it has been checked and is good, particularly with regards to the signature.

TODO: make it generic generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

func (CheckedExtrinsic) Bytes

func (cxt CheckedExtrinsic) Bytes() []byte

func (CheckedExtrinsic) Encode

func (cxt CheckedExtrinsic) Encode(buffer *bytes.Buffer)

type UncheckedExtrinsic

type UncheckedExtrinsic struct {
	Version sc.U8

	// The signature, address, number of extrinsics have come before from
	// the same signer and an era describing the longevity of this transaction,
	// if this is a signed extrinsic.
	Signature sc.Option[primitives.ExtrinsicSignature]
	Function  primitives.Call
}

func DecodeUncheckedExtrinsic

func DecodeUncheckedExtrinsic(buffer *bytes.Buffer) UncheckedExtrinsic

func NewSignedUncheckedExtrinsic

func NewSignedUncheckedExtrinsic(function primitives.Call, address primitives.MultiAddress, signature primitives.MultiSignature, extra primitives.SignedExtra) UncheckedExtrinsic

NewSignedUncheckedExtrinsic returns a new instance of a signed extrinsic.

func NewUncheckedExtrinsic

func NewUncheckedExtrinsic(function primitives.Call, signedData sc.Option[primitives.ExtrinsicSignature]) UncheckedExtrinsic

func NewUnsignedUncheckedExtrinsic

func NewUnsignedUncheckedExtrinsic(function primitives.Call) UncheckedExtrinsic

NewUnsignedUncheckedExtrinsic returns a new instance of an unsigned extrinsic.

func (UncheckedExtrinsic) Bytes

func (uxt UncheckedExtrinsic) Bytes() []byte

func (UncheckedExtrinsic) Encode

func (uxt UncheckedExtrinsic) Encode(buffer *bytes.Buffer)

func (UncheckedExtrinsic) IsSigned

func (uxt UncheckedExtrinsic) IsSigned() sc.Bool

func (UncheckedExtrinsic) UnmaskedVersion

func (uxt UncheckedExtrinsic) UnmaskedVersion() sc.U8

Jump to

Keyboard shortcuts

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