messages

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: CC0-1.0 Imports: 9 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CosmosMessageAddressesParser = DefaultMessagesParser

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

Functions

func DefaultMessagesParser

func DefaultMessagesParser(tx *types.Tx) ([]string, error)

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

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 TrimLastChar

func TrimLastChar(s string) string

Types

type MessageAddressesParser

type MessageAddressesParser = func(tx *types.Tx) ([]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