Documentation ¶
Index ¶
- Variables
- func BytesToAddress(key []byte) cryptotypes.Address
- func ConvertAddressToBech32String(address cryptotypes.Address) (string, error)
- func ConvertValidatorPubKeyToBech32String(pubKey cometbftcrypto.PubKey) (string, error)
- type Account
- type BeginBlockerHandler
- type Block
- type BlockHandler
- type BlockerEvents
- type Coin
- type Coins
- type EndBlockerHandler
- type GenesisHandler
- type MessageHandler
- type Module
- type PubKey
- type RecursiveMessagesHandler
- type StakingValidator
- type TransactionHandler
- type Tx
- type Txs
- type Validator
- type ValidatorPreCommit
- type Validators
- type ValidatorsHandler
Constants ¶
This section is empty.
Variables ¶
var (
ErrBlockNotFound = errors.New("block not found")
)
var (
ErrNoEventFound = errors.New("no event found")
)
Functions ¶
func BytesToAddress ¶
func BytesToAddress(key []byte) cryptotypes.Address
func ConvertAddressToBech32String ¶
func ConvertAddressToBech32String(address cryptotypes.Address) (string, error)
func ConvertValidatorPubKeyToBech32String ¶
func ConvertValidatorPubKeyToBech32String(pubKey cometbftcrypto.PubKey) (string, error)
ConvertValidatorPubKeyToBech32String converts the given pubKey to Bech32 string
Types ¶
type Account ¶
Account represents a chain account
func NewAccount ¶
NewAccount builds a new Account instance
type BeginBlockerHandler ¶
type Block ¶
type Block struct { Timestamp time.Time Hash string ProposerAddress string ValidatorPreCommits []ValidatorPreCommit Evidence cometbfttypes.EvidenceData TxNum int TotalGas uint64 Height int64 }
func NewBlock ¶
func NewBlock(height int64, hash, proposerAddress string, txNum int, totalGas uint64, timestamp time.Time, evidence cometbfttypes.EvidenceData) *Block
func NewBlockFromTmBlock ¶
func NewBlockFromTmBlock(blk *cometbftcoretypes.ResultBlock, totalGas uint64) *Block
NewBlockFromTmBlock builds a new Block instance from a given ResultBlock object
type BlockHandler ¶
type BlockerEvents ¶
func NewBlockerEventsAttributes ¶
func NewBlockerEventsAttributes(events []abci.Event) BlockerEvents
type Coin ¶
func NewCoinFromCdk ¶
type EndBlockerHandler ¶
type GenesisHandler ¶
type GenesisHandler interface { Module // HandleGenesis handles a genesis state. HandleGenesis(ctx context.Context, doc *cometbfttypes.GenesisDoc, appState map[string]json.RawMessage) error }
type MessageHandler ¶
type Module ¶
type Module interface { // Name base implementation of Module interface. Name() string }
type RecursiveMessagesHandler ¶ added in v0.4.0
type StakingValidator ¶
type StakingValidator interface { GetConsAddr() string GetConsPubKey() string GetOperator() string GetSelfDelegateAddress() string GetMaxChangeRate() *sdk.Dec GetMaxRate() *sdk.Dec GetHeight() int64 GetMinSelfDelegation() int64 GetDescription() stakingtypes.Description }
func NewStakingValidator ¶
func NewStakingValidator( consensusAddr, operatorAddr, consensusPubKey, selfDelegateAddress string, maxChangeRate, maxRate *sdk.Dec, description stakingtypes.Description, height, minSelfDelegation int64, ) StakingValidator
NewStakingValidator allows to build a new Validator implementation having the given data
type TransactionHandler ¶
type Tx ¶
type Tx struct { *sdktx.Tx *sdk.TxResponse Signer string }
Tx represents an already existing blockchain transaction
func (Tx) FindAttributeByKey ¶
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 ¶
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 ¶
Successful tells whether this tx is successful or not
type Txs ¶
type Txs []*Tx
Txs - slice of transactions
func NewTxsFromTmTxs ¶
func NewTxsFromTmTxs(txs []*sdktx.GetTxResponse, cdc codec.Codec) Txs
type Validator ¶
func NewValidator ¶
NewValidator allows to build a new Validator instance
type ValidatorPreCommit ¶ added in v1.0.0
type ValidatorPreCommit struct { Timestamp time.Time ValidatorAddress string BlockIDFlag uint64 VotingPower int64 }
func NewValidatorPreCommitsFromTmSignatures ¶ added in v1.0.0
func NewValidatorPreCommitsFromTmSignatures(sigs []cometbfttypes.CommitSig) []ValidatorPreCommit
type Validators ¶
type Validators []*Validator
func NewValidatorsFromTmValidator ¶
func NewValidatorsFromTmValidator(tmVals *cometbftcoretypes.ResultValidators) Validators
type ValidatorsHandler ¶
type ValidatorsHandler interface { Module // HandleValidators handles of all validators in blockchain. HandleValidators(ctx context.Context, vals *cometbftcoretypes.ResultValidators) error }