Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfBlocksExist(end uint64) bool
- func GetAccountProof(dividendAccounts []hmTypes.DividendAccount, ...) ([]byte, error)
- func GetAccountRootHash(dividendAccounts []hmTypes.DividendAccount) ([]byte, error)
- func GetAccountTree(dividendAccounts []hmTypes.DividendAccount) (*merkletree.MerkleTree, error)
- func GetHeaders(start uint64, end uint64) ([]byte, error)
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func RegisterPulp(pulp *authTypes.Pulp)
- func ValidateCheckpoint(start uint64, end uint64, rootHash hmTypes.HeimdallHash) (bool, error)
- func ValidateGenesis(data GenesisState) error
- func VerifyAccountProof(dividendAccounts []hmTypes.DividendAccount, ...) (bool, error)
- type GenesisState
- type MsgCheckpoint
- type MsgCheckpointAck
- func (msg MsgCheckpointAck) GetLogIndex() uint64
- func (msg MsgCheckpointAck) GetSignBytes() []byte
- func (msg MsgCheckpointAck) GetSigners() []sdk.AccAddress
- func (msg MsgCheckpointAck) GetTxHash() types.HeimdallHash
- func (msg MsgCheckpointAck) Route() string
- func (msg MsgCheckpointAck) Type() string
- func (msg MsgCheckpointAck) ValidateBasic() sdk.Error
- type MsgCheckpointNoAck
- type Params
- type QueryCheckpointParams
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "checkpoint" // StoreKey is the store key string for bor StoreKey = ModuleName // RouterKey is the message route for bor RouterKey = ModuleName // QuerierRoute is the querier route for bor QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName )
const ( QueryParams = "params" QueryAckCount = "ack-count" QueryCheckpoint = "checkpoint" QueryCheckpointBuffer = "checkpoint-buffer" QueryLastNoAck = "last-no-ack" QueryCheckpointList = "checkpoint-list" )
query endpoints supported by the auth Querier
const (
DefaultCheckpointBufferTime time.Duration = 1000 * time.Second // Time checkpoint is allowed to stay in buffer (1000 seconds ~ 17 mins)
)
Default parameter values
Variables ¶
var ( EventTypeCheckpoint = "checkpoint" EventTypeCheckpointAck = "checkpoint-ack" EventTypeCheckpointNoAck = "checkpoint-noack" AttributeKeyProposer = "proposer" AttributeKeyStartBlock = "start-block" AttributeKeyEndBlock = "end-block" AttributeKeyHeaderIndex = "header-index" AttributeKeyNewProposer = "new-proposer" AttributeValueCategory = ModuleName )
Checkpoint tags
var (
KeyCheckpointBufferTime = []byte("CheckpointBufferTime")
)
Parameter keys
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout module
Functions ¶
func CheckIfBlocksExist ¶
CheckIfBlocksExist - check if latest block number is greater than end block
func GetAccountProof ¶
func GetAccountProof(dividendAccounts []hmTypes.DividendAccount, dividendAccountID hmTypes.DividendAccountID) ([]byte, error)
GetAccountProof returns proof of dividend Account
func GetAccountRootHash ¶
func GetAccountRootHash(dividendAccounts []hmTypes.DividendAccount) ([]byte, error)
GetAccountRootHash returns roothash of Validator Account State Tree
func GetAccountTree ¶
func GetAccountTree(dividendAccounts []hmTypes.DividendAccount) (*merkletree.MerkleTree, error)
GetAccountTree returns roothash of Validator Account State Tree
func RegisterCodec ¶
func RegisterPulp ¶
func ValidateCheckpoint ¶
ValidateCheckpoint - Validates if checkpoint rootHash matches or not
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of bor genesis data returning an error for any failed validation criteria.
func VerifyAccountProof ¶
func VerifyAccountProof(dividendAccounts []hmTypes.DividendAccount, dividendAccountID hmTypes.DividendAccountID, proofToVerify string) (bool, error)
VerifyAccountProof returns proof of dividend Account
Types ¶
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` BufferedCheckpoint *hmTypes.CheckpointBlockHeader `json:"buffered_checkpoint" yaml:"buffered_checkpoint"` LastNoACK uint64 `json:"last_no_ack" yaml:"last_no_ack"` AckCount uint64 `json:"ack_count" yaml:"ack_count"` Headers []hmTypes.CheckpointBlockHeader `json:"headers" yaml:"headers"` }
GenesisState is the checkpoint state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns staking GenesisState given raw application genesis state
func NewGenesisState ¶
func NewGenesisState( params Params, bufferedCheckpoint *hmTypes.CheckpointBlockHeader, lastNoACK uint64, ackCount uint64, headers []hmTypes.CheckpointBlockHeader, ) GenesisState
NewGenesisState creates a new genesis state.
type MsgCheckpoint ¶
type MsgCheckpoint struct { Proposer types.HeimdallAddress `json:"proposer"` StartBlock uint64 `json:"startBlock"` EndBlock uint64 `json:"endBlock"` RootHash types.HeimdallHash `json:"rootHash"` AccountRootHash types.HeimdallHash `json:"accountRootHash"` }
MsgCheckpoint represents checkpoint
func NewMsgCheckpointBlock ¶
func NewMsgCheckpointBlock( proposer types.HeimdallAddress, startBlock uint64, endBlock uint64, roothash types.HeimdallHash, accountRootHash types.HeimdallHash, ) MsgCheckpoint
NewMsgCheckpointBlock creates new checkpoint message using mentioned arguments
func (MsgCheckpoint) GetSignBytes ¶
func (msg MsgCheckpoint) GetSignBytes() []byte
func (MsgCheckpoint) GetSigners ¶
func (msg MsgCheckpoint) GetSigners() []sdk.AccAddress
GetSigners returns address of the signer
func (MsgCheckpoint) Route ¶
func (msg MsgCheckpoint) Route() string
func (MsgCheckpoint) ValidateBasic ¶
func (msg MsgCheckpoint) ValidateBasic() sdk.Error
type MsgCheckpointAck ¶
type MsgCheckpointAck struct { From types.HeimdallAddress `json:"from"` HeaderBlock uint64 `json:"headerBlock"` TxHash types.HeimdallHash `json:"tx_hash"` LogIndex uint64 `json:"log_index"` }
MsgCheckpointAck Add mainchain commit transaction hash to MsgCheckpointAck
func NewMsgCheckpointAck ¶
func NewMsgCheckpointAck(from types.HeimdallAddress, headerBlock uint64, txHash types.HeimdallHash, logIndex uint64) MsgCheckpointAck
func (MsgCheckpointAck) GetLogIndex ¶
func (msg MsgCheckpointAck) GetLogIndex() uint64
GetLogIndex Returns log index
func (MsgCheckpointAck) GetSignBytes ¶
func (msg MsgCheckpointAck) GetSignBytes() []byte
func (MsgCheckpointAck) GetSigners ¶
func (msg MsgCheckpointAck) GetSigners() []sdk.AccAddress
func (MsgCheckpointAck) GetTxHash ¶
func (msg MsgCheckpointAck) GetTxHash() types.HeimdallHash
GetTxHash Returns tx hash
func (MsgCheckpointAck) Route ¶
func (msg MsgCheckpointAck) Route() string
func (MsgCheckpointAck) Type ¶
func (msg MsgCheckpointAck) Type() string
func (MsgCheckpointAck) ValidateBasic ¶
func (msg MsgCheckpointAck) ValidateBasic() sdk.Error
type MsgCheckpointNoAck ¶
type MsgCheckpointNoAck struct {
From types.HeimdallAddress `json:"from"`
}
func NewMsgCheckpointNoAck ¶
func NewMsgCheckpointNoAck(from types.HeimdallAddress) MsgCheckpointNoAck
func (MsgCheckpointNoAck) GetSignBytes ¶
func (msg MsgCheckpointNoAck) GetSignBytes() []byte
func (MsgCheckpointNoAck) GetSigners ¶
func (msg MsgCheckpointNoAck) GetSigners() []sdk.AccAddress
func (MsgCheckpointNoAck) Route ¶
func (msg MsgCheckpointNoAck) Route() string
func (MsgCheckpointNoAck) Type ¶
func (msg MsgCheckpointNoAck) Type() string
func (MsgCheckpointNoAck) ValidateBasic ¶
func (msg MsgCheckpointNoAck) ValidateBasic() sdk.Error
type Params ¶
type Params struct {
CheckpointBufferTime time.Duration `json:"checkpoint_buffer_time" yaml:"checkpoint_buffer_time"`
}
Params defines the parameters for the auth module.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() subspace.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint
type QueryCheckpointParams ¶
type QueryCheckpointParams struct {
HeaderIndex uint64
}
QueryCheckpointParams defines the params for querying accounts.
func NewQueryCheckpointParams ¶
func NewQueryCheckpointParams(headerIndex uint64) QueryCheckpointParams
NewQueryCheckpointParams creates a new instance of QueryCheckpointHeaderIndex.