messages

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: CC0-1.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.Transaction) ([]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 types.Message, tx *types.Transaction,
	parseAddresses MessageAddressesParser, 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.Transaction) ([]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, db database.Database) *Module

func (*Module) HandleMsg

func (m *Module) HandleMsg(index int, msg types.Message, tx *types.Transaction) 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