types

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: CC0-1.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlagsLoadViper added in v0.0.9

func BindFlagsLoadViper(cmd *cobra.Command, _ []string) error

BindFlagsLoadViper binds all flags and read the config into viper

func ConvertValidatorAddressToBech32String added in v0.0.9

func ConvertValidatorAddressToBech32String(address types.Address) string

ConvertValidatorAddressToBech32String converts the given validator address to its Bech32 string representation

func ConvertValidatorPubKeyToBech32String added in v0.0.9

func ConvertValidatorPubKeyToBech32String(pubKey tmcrypto.PubKey) (string, error)

ConvertValidatorPubKeyToBech32String converts the given pubKey to a Bech32 string

func FindAttributeByKey added in v0.0.9

func FindAttributeByKey(event abci.Event, attrKey string) (abci.EventAttribute, error)

func FindEventByType added in v0.0.9

func FindEventByType(events []abci.Event, eventType string) (abci.Event, error)

func FindEventsByType added in v0.0.9

func FindEventsByType(events []abci.Event, eventType string) []abci.Event

Types

type Block added in v0.0.9

type Block struct {
	Height          int64
	Hash            string
	TxNum           int
	TotalGas        uint64
	ProposerAddress string
	Timestamp       time.Time
}

Block contains the data of a single chain block

func NewBlock added in v0.0.9

func NewBlock(
	height int64, hash string, txNum int, totalGas uint64, proposerAddress string, timestamp time.Time,
) *Block

NewBlock allows to build a new Block instance

func NewBlockFromTmBlock added in v0.0.9

func NewBlockFromTmBlock(blk *tmctypes.ResultBlock, totalGas uint64) *Block

NewBlockFromTmBlock builds a new Block instance from a given ResultBlock object

type CobraCmdFunc added in v0.0.9

type CobraCmdFunc func(cmd *cobra.Command, args []string) error

CobraCmdFunc represents a cobra command function

func ConcatCobraCmdFuncs added in v0.0.9

func ConcatCobraCmdFuncs(fs ...CobraCmdFunc) CobraCmdFunc

ConcatCobraCmdFuncs returns a single function that calls each argument function in sequence RunE, PreRunE, PersistentPreRunE, etc. all have this same signature

type CommitSig added in v0.0.9

type CommitSig struct {
	Height           int64
	ValidatorAddress string
	VotingPower      int64
	ProposerPriority int64
	Timestamp        time.Time
}

CommitSig contains the data of a single validator commit signature

func NewCommitSig added in v0.0.9

func NewCommitSig(validatorAddress string, votingPower, proposerPriority, height int64, timestamp time.Time) *CommitSig

NewCommitSig allows to build a new CommitSign object

type HeightQueue added in v0.0.9

type HeightQueue chan int64

HeightQueue is a simple type alias for a (buffered) channel of block heights.

func NewQueue

func NewQueue(size int) HeightQueue

type Message added in v0.0.9

type Message struct {
	TxHash    string
	Index     int
	Type      string
	Value     string
	Addresses []string
}

Message represents the data of a single message

func NewMessage added in v0.0.9

func NewMessage(txHash string, index int, msgType string, value string, addresses []string) *Message

NewMessage allows to build a new Message instance

type Tx

type Tx struct {
	*tx.Tx
	*sdk.TxResponse
}

Tx represents an already existing blockchain transaction

func NewTx

func NewTx(txResponse *sdk.TxResponse, tx *tx.Tx) (*Tx, error)

NewTx allows to create a new Tx instance from the given txResponse

func (Tx) FindAttributeByKey

func (tx Tx) FindAttributeByKey(event sdk.StringEvent, attrKey string) (string, error)

FindAttributeByKey searches inside the specified event of the given tx to find the attribute having the given key. If the specified event does not contain a such attribute, returns an error instead.

func (Tx) FindEventByType

func (tx Tx) FindEventByType(index int, eventType string) (sdk.StringEvent, error)

FindEventByType searches inside the given tx events for the message having the specified index, in order to find the event having the given type, and returns it. If no such event is found, returns an error instead.

func (Tx) Successful

func (tx Tx) Successful() bool

Successful tells whether this tx is successful or not

type Validator added in v0.0.9

type Validator struct {
	ConsAddr   string
	ConsPubKey string
}

Validator contains the data of a single validator

func NewValidator added in v0.0.9

func NewValidator(consAddr string, consPubKey string) *Validator

NewValidator allows to build a new Validator instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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