messages

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: CC0-1.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

CosmosMessageAddressesParser represents a MessageAddressesParser that parses a Chain message and returns all the involved addresses (both accounts and validators)

Functions

func BankMessagesParser

func BankMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

BankMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/bank module

func CrisisMessagesParser

func CrisisMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

CrisisMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/crisis module

func DefaultMessagesParser

func DefaultMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

DefaultMessagesParser represents the default messages parser that simply returns the list of all the signers of a message

func DistributionMessagesParser

func DistributionMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

DistributionMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/distribution module

func EvidenceMessagesParser

func EvidenceMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

EvidenceMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/evidence module

func GovV1Beta1MessagesParser

func GovV1Beta1MessagesParser(cdc codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

GovV1Beta1MessagesParser returns the list of all the accounts involved in the given message if it's related to the x/gov v1beta1 module

func GovV1MessageParser

func GovV1MessageParser(cdc codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

GovV1MessageParser returns the list of all the accounts involved in the given message if it's related to the x/gov v1 module

func HandleMsg

func HandleMsg(
	index int, msg sdk.Msg, tx *types.Tx,
	parseAddresses MessageAddressesParser, cdc codec.Codec, db database.Database,
) error

HandleMsg represents a message handler that stores the given message inside the proper database table

func IBCTransferMessagesParser

func IBCTransferMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

IBCTransferMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/iBCTransfer module

func MessageNotSupported

func MessageNotSupported(msg sdk.Msg) error

MessageNotSupported returns an error telling that the given message is not supported

func SlashingMessagesParser

func SlashingMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

SlashingMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/slashing module

func StakingMessagesParser

func StakingMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)

StakingMessagesParser returns the list of all the accounts involved in the given message if it's related to the x/staking module

func TrimLastChar

func TrimLastChar(s string) string

Types

type MessageAddressesParser

type MessageAddressesParser = func(cdc codec.Codec, msg sdk.Msg) ([]string, error)

MessageAddressesParser represents a function that extracts all the involved addresses from a provided message (both accounts and validators)

func JoinMessageParsers

func JoinMessageParsers(parsers ...MessageAddressesParser) MessageAddressesParser

JoinMessageParsers joins together all the given parsers, calling them in order

type Module

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

Module represents the module allowing to store messages properly inside a dedicated table

func NewModule

func NewModule(parser MessageAddressesParser, cdc codec.Codec, db database.Database) *Module

func (*Module) HandleMsg

func (m *Module) HandleMsg(index int, msg sdk.Msg, tx *types.Tx) error

HandleMsg implements modules.MessageModule

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

Jump to

Keyboard shortcuts

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