message

package
v0.2202.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package message implements the supported runtime messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InMessagesHash added in v0.2200.0

func InMessagesHash(msgs []*IncomingMessage) (h hash.Hash)

InMessagesHash returns a hash of provided incoming runtime messages.

func MessagesHash

func MessagesHash(msgs []Message) (h hash.Hash)

MessagesHash returns a hash of provided runtime messages.

Types

type IncomingMessage added in v0.2200.0

type IncomingMessage struct {
	// ID is the unique identifier of the message.
	ID uint64 `json:"id"`

	// Caller is the address of the caller authenticated by the consensus layer.
	Caller staking.Address `json:"caller"`

	// Tag is an optional tag provided by the caller which is ignored and can be used to match
	// processed incoming message events later.
	Tag uint64 `json:"tag,omitempty"`

	// Fee is the fee sent into the runtime as part of the message being sent. The fee is
	// transferred before the message is processed by the runtime.
	Fee quantity.Quantity `json:"fee,omitempty"`

	// Tokens are any tokens sent into the runtime as part of the message being sent. The tokens are
	// transferred before the message is processed by the runtime.
	Tokens quantity.Quantity `json:"tokens,omitempty"`

	// Data is a runtime transaction.
	Data []byte `json:"data,omitempty"`
}

IncomingMessage is an incoming message.

type IncomingMessageQueueMeta added in v0.2200.0

type IncomingMessageQueueMeta struct {
	// Size contains the current size of the queue.
	Size uint32 `json:"size,omitempty"`

	// NextSequenceNumber contains the sequence number that should be used for the next queued
	// message.
	NextSequenceNumber uint64 `json:"next_sequence_number,omitempty"`
}

IncomingMessageQueueMeta is the incoming message queue metadata.

type Message

type Message struct {
	Staking  *StakingMessage  `json:"staking,omitempty"`
	Registry *RegistryMessage `json:"registry,omitempty"`
}

Message is a message that can be sent by a runtime.

func (*Message) ValidateBasic

func (m *Message) ValidateBasic() error

ValidateBasic performs basic validation of the runtime message.

type RegistryMessage

type RegistryMessage struct {
	cbor.Versioned

	UpdateRuntime *registry.Runtime `json:"update_runtime,omitempty"`
}

RegistryMessage is a runtime message that allows a runtime to perform staking operations.

func (*RegistryMessage) ValidateBasic

func (rm *RegistryMessage) ValidateBasic() error

ValidateBasic performs basic validation of the runtime message.

type StakingMessage

type StakingMessage struct {
	cbor.Versioned

	Transfer      *staking.Transfer      `json:"transfer,omitempty"`
	Withdraw      *staking.Withdraw      `json:"withdraw,omitempty"`
	AddEscrow     *staking.Escrow        `json:"add_escrow,omitempty"`
	ReclaimEscrow *staking.ReclaimEscrow `json:"reclaim_escrow,omitempty"`
}

StakingMessage is a runtime message that allows a runtime to perform staking operations.

func (*StakingMessage) ValidateBasic

func (sm *StakingMessage) ValidateBasic() error

ValidateBasic performs basic validation of the runtime message.

Jump to

Keyboard shortcuts

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