messages

package
v0.0.0-...-a08de0b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CosmosMessageAddressesParser = JoinMessageParsers(

	DefaultMessagesParser,
)

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

Functions

func DefaultMessagesParser

func DefaultMessagesParser(_ codec.Marshaler, tx types.Tx) ([]string, error)

DefaultMessagesParser represents the default messages parser that simply returns all account that mutate the state by the transaction

func MessageNotSupported

func MessageNotSupported(tx types.Tx) error

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

Types

type MessageAddressesParser

type MessageAddressesParser = func(cdc codec.Marshaler, 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.Marshaler, db db.Database) *Module

func (*Module) HandleEvent

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

HandleEvent 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