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")
)
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(consAddr, opAddr, consPubKey, selfDelegateAddress string, maxChangeRate, maxRate *sdk.Dec, description stakingtypes.Description, height int64, 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 v0.3.0
type ValidatorPrecommit struct { Timestamp time.Time ValidatorAddress string BlockIDFlag uint64 VotingPower int64 }
func NewValidatorPrecommitsFromTmSignatures ¶ added in v0.3.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 }