Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func GetCheckpointKey(checkpointNumber uint64) []byte
- func GetMilestoneKey(milestoneNumber uint64) []byte
- func GetMilestoneNoAckKey(milestoneId string) []byte
- func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState)
- func NewHandler(k Keeper, contractCaller helper.IContractCaller) sdk.Handler
- func NewPostTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.PostTxHandler
- func NewQuerier(keeper Keeper, stakingKeeper staking.Keeper, topupKeeper topup.Keeper, ...) sdk.Querier
- func NewSideTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.SideTxHandler
- func PostHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint, ...) sdk.Result
- func PostHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, ...) sdk.Result
- func PostHandleMsgCheckpointAdjust(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAdjust, ...) sdk.Result
- func PostHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, ...) sdk.Result
- func SideHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgCheckpointAdjust(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAdjust, ...) (result abci.ResponseDeliverSideTx)
- func SideHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, ...) (result abci.ResponseDeliverSideTx)
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (AppModule) GenerateGenesisState(simState *hmModule.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewPostTxHandler() hmTypes.PostTxHandler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) NewSideTxHandler() hmTypes.SideTxHandler
- func (AppModule) ProposalContents(simState hmModule.SimulationState) []simTypes.WeightedProposalContent
- func (AppModule) QuerierRoute() string
- func (AppModule) RandomizedParams(r *rand.Rand) []simTypes.ParamChange
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) RegisterStoreDecoder(sdr hmModule.StoreDecoderRegistry)
- func (AppModule) Route() string
- func (AppModule) WeightedOperations(_ hmModule.SimulationState) []simTypes.WeightedOperation
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- func (AppModuleBasic) VerifyGenesis(bz map[string]json.RawMessage) error
- type Keeper
- func (k *Keeper) AddCheckpoint(ctx sdk.Context, checkpointNumber uint64, checkpoint hmTypes.Checkpoint) error
- func (k *Keeper) AddMilestone(ctx sdk.Context, milestone hmTypes.Milestone) error
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k *Keeper) FlushCheckpointBuffer(ctx sdk.Context)
- func (k Keeper) GetACKCount(ctx sdk.Context) uint64
- func (k *Keeper) GetCheckpointByNumber(ctx sdk.Context, number uint64) (hmTypes.Checkpoint, error)
- func (k *Keeper) GetCheckpointFromBuffer(ctx sdk.Context) (*hmTypes.Checkpoint, error)
- func (k *Keeper) GetCheckpointList(ctx sdk.Context, page uint64, limit uint64) ([]hmTypes.Checkpoint, error)
- func (k *Keeper) GetCheckpoints(ctx sdk.Context) []hmTypes.Checkpoint
- func (k *Keeper) GetLastCheckpoint(ctx sdk.Context) (hmTypes.Checkpoint, error)
- func (k *Keeper) GetLastMilestone(ctx sdk.Context) (*hmTypes.Milestone, error)
- func (k *Keeper) GetLastMilestoneTimeout(ctx sdk.Context) uint64
- func (k *Keeper) GetLastNoAck(ctx sdk.Context) uint64
- func (k *Keeper) GetLastNoAckMilestone(ctx sdk.Context) string
- func (k *Keeper) GetMilestoneBlockNumber(ctx sdk.Context) int64
- func (k *Keeper) GetMilestoneByNumber(ctx sdk.Context, number uint64) (*hmTypes.Milestone, error)
- func (k *Keeper) GetMilestoneCount(ctx sdk.Context) uint64
- func (k *Keeper) GetNoAckMilestone(ctx sdk.Context, milestoneId string) bool
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) HasStoreValue(ctx sdk.Context, key []byte) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MilestoneLogger(ctx sdk.Context) log.Logger
- func (k *Keeper) PruneMilestone(ctx sdk.Context, number uint64)
- func (k *Keeper) SetCheckpointBuffer(ctx sdk.Context, checkpoint hmTypes.Checkpoint) error
- func (k *Keeper) SetLastMilestoneTimeout(ctx sdk.Context, timestamp uint64)
- func (k *Keeper) SetLastNoAck(ctx sdk.Context, timestamp uint64)
- func (k *Keeper) SetMilestoneBlockNumber(ctx sdk.Context, number int64)
- func (k *Keeper) SetMilestoneCount(ctx sdk.Context, number uint64)
- func (k *Keeper) SetNoAckMilestone(ctx sdk.Context, milestoneId string)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpdateACKCount(ctx sdk.Context)
- func (k Keeper) UpdateACKCountWithValue(ctx sdk.Context, value uint64)
- type ModuleCommunicator
Constants ¶
This section is empty.
Variables ¶
var ( DefaultValue = []byte{0x01} // Value to store in CacheCheckpoint and CacheCheckpointACK & ValidatorSetChange Flag ACKCountKey = []byte{0x11} // key to store ACK count BufferCheckpointKey = []byte{0x12} // Key to store checkpoint in buffer CheckpointKey = []byte{0x13} // prefix key for when storing checkpoint after ACK LastNoACKKey = []byte{0x14} // key to store last no-ack )
var ( MilestoneKey = []byte{0x20} // Key to store milestone CountKey = []byte{0x30} //Key to store the count MilestoneNoAckKey = []byte{0x40} //Key to store the NoAckMilestone MilestoneLastNoAckKey = []byte{0x50} //Key to store the Latest NoAckMilestone LastMilestoneTimeout = []byte{0x60} //Key to store the Last Milestone Timeout BlockNumberKey = []byte{0x70} //Key to store the count )
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func GetCheckpointKey ¶ added in v0.2.0
GetCheckpointKey appends prefix to checkpointNumber
func GetMilestoneKey ¶ added in v1.0.1
GetMilestoneKey appends prefix to milestoneNumber
func GetMilestoneNoAckKey ¶ added in v1.0.1
GetMilestoneKey appends prefix to milestoneNumber
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState)
InitGenesis sets distribution information for genesis.
func NewHandler ¶
func NewHandler(k Keeper, contractCaller helper.IContractCaller) sdk.Handler
NewHandler creates new handler for handling messages for checkpoint module
func NewPostTxHandler ¶ added in v0.1.7
func NewPostTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.PostTxHandler
NewPostTxHandler returns a side handler for "bank" type messages.
func NewQuerier ¶
func NewQuerier(keeper Keeper, stakingKeeper staking.Keeper, topupKeeper topup.Keeper, contractCaller helper.IContractCaller) sdk.Querier
NewQuerier creates a querier for auth REST endpoints
func NewSideTxHandler ¶ added in v0.1.7
func NewSideTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.SideTxHandler
NewSideTxHandler returns a side handler for "bank" type messages.
func PostHandleMsgCheckpoint ¶ added in v0.1.7
func PostHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgCheckpoint handles msg checkpoint
func PostHandleMsgCheckpointAck ¶ added in v0.1.7
func PostHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgCheckpointAck handles msg checkpoint ack
func PostHandleMsgCheckpointAdjust ¶ added in v0.2.3
func PostHandleMsgCheckpointAdjust(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAdjust, sideTxResult abci.SideTxResultType, contractCaller helper.IContractCaller) sdk.Result
PostHandleMsgCheckpointAdjust handles msg checkpoint adjust
func PostHandleMsgMilestone ¶ added in v1.0.1
func PostHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgMilestone handles msg milestone
func SideHandleMsgCheckpoint ¶ added in v0.1.7
func SideHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgCheckpoint handles MsgCheckpoint message for external call
func SideHandleMsgCheckpointAck ¶ added in v0.1.7
func SideHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgCheckpointAck handles MsgCheckpointAck message for external call
func SideHandleMsgCheckpointAdjust ¶ added in v0.2.3
func SideHandleMsgCheckpointAdjust(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAdjust, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgCheckpointAdjust handles MsgCheckpointAdjust message for external call
func SideHandleMsgMilestone ¶ added in v1.0.1
func SideHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgMilestone handles MsgMilestone message for external call
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the checkpoint module.
func NewAppModule ¶
func NewAppModule(keeper Keeper, sk staking.Keeper, tk topup.Keeper, contractCaller helper.IContractCaller) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the auth module.
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the auth module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the auth module.
func (AppModule) GenerateGenesisState ¶ added in v0.1.8
func (AppModule) GenerateGenesisState(simState *hmModule.SimulationState)
GenerateGenesisState creates a randomized GenState of the Staking module
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the auth module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the module.
func (AppModule) NewPostTxHandler ¶ added in v0.1.7
func (am AppModule) NewPostTxHandler() hmTypes.PostTxHandler
NewPostTxHandler side tx handler
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the auth module sdk.Querier.
func (AppModule) NewSideTxHandler ¶ added in v0.1.7
func (am AppModule) NewSideTxHandler() hmTypes.SideTxHandler
NewSideTxHandler side tx handler
func (AppModule) ProposalContents ¶ added in v0.1.8
func (AppModule) ProposalContents(simState hmModule.SimulationState) []simTypes.WeightedProposalContent
ProposalContents doesn't return any content functions.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the auth module's querier route name.
func (AppModule) RandomizedParams ¶ added in v0.1.8
func (AppModule) RandomizedParams(r *rand.Rand) []simTypes.ParamChange
RandomizedParams creates randomized param changes for the simulator.
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants performs a no-op.
func (AppModule) RegisterStoreDecoder ¶ added in v0.1.8
func (AppModule) RegisterStoreDecoder(sdr hmModule.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for chainmanager module's types
func (AppModule) WeightedOperations ¶ added in v0.1.8
func (AppModule) WeightedOperations(_ hmModule.SimulationState) []simTypes.WeightedOperation
WeightedOperations doesn't return any chainmanager module operation.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the auth module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the auth module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the auth module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the auth module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the auth module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the auth module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the auth module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the auth module.
func (AppModuleBasic) VerifyGenesis ¶
func (AppModuleBasic) VerifyGenesis(bz map[string]json.RawMessage) error
VerifyGenesis performs verification on auth module state.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper stores all related data
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace subspace.Subspace, codespace sdk.CodespaceType, stakingKeeper staking.Keeper, chainKeeper chainmanager.Keeper, moduleCommunicator ModuleCommunicator, ) Keeper
NewKeeper create new keeper
func (*Keeper) AddCheckpoint ¶
func (k *Keeper) AddCheckpoint(ctx sdk.Context, checkpointNumber uint64, checkpoint hmTypes.Checkpoint) error
AddCheckpoint adds checkpoint into final blocks
func (*Keeper) AddMilestone ¶ added in v1.0.1
AddMilestone adds milestone in the store
func (Keeper) Codespace ¶
func (k Keeper) Codespace() sdk.CodespaceType
Codespace returns the codespace
func (*Keeper) FlushCheckpointBuffer ¶
FlushCheckpointBuffer flushes Checkpoint Buffer
func (Keeper) GetACKCount ¶
GetACKCount returns current ACK count
func (*Keeper) GetCheckpointByNumber ¶ added in v0.1.8
GetCheckpointByNumber to get checkpoint by checkpoint number
func (*Keeper) GetCheckpointFromBuffer ¶
GetCheckpointFromBuffer gets checkpoint in buffer
func (*Keeper) GetCheckpointList ¶
func (k *Keeper) GetCheckpointList(ctx sdk.Context, page uint64, limit uint64) ([]hmTypes.Checkpoint, error)
GetCheckpointList returns all checkpoints with params like page and limit
func (*Keeper) GetCheckpoints ¶ added in v0.1.8
func (k *Keeper) GetCheckpoints(ctx sdk.Context) []hmTypes.Checkpoint
GetCheckpoints get checkpoint all checkpoints
func (*Keeper) GetLastCheckpoint ¶
GetLastCheckpoint gets last checkpoint, checkpoint number = TotalACKs
func (*Keeper) GetLastMilestone ¶ added in v1.0.1
GetLastMilestone gets last milestone, milestone number = GetCount()
func (*Keeper) GetLastMilestoneTimeout ¶ added in v1.0.1
GetLastMilestoneTimeout returns lastMilestone timeout time
func (*Keeper) GetLastNoAck ¶
GetLastNoAck returns last no ack
func (*Keeper) GetLastNoAckMilestone ¶ added in v1.0.1
GetLastNoAckMilestone returns last no ack milestone
func (*Keeper) GetMilestoneBlockNumber ¶ added in v1.0.1
GetMilestoneBlockNumber returns the block number when the latest milestone enter the handler
func (*Keeper) GetMilestoneByNumber ¶ added in v1.0.1
GetMilestoneByNumber to get milestone by milestone number
func (*Keeper) GetMilestoneCount ¶ added in v1.0.1
GetCount returns milestone count
func (*Keeper) GetNoAckMilestone ¶ added in v1.0.1
GetLastNoAckMilestone returns last no ack milestone
func (*Keeper) HasStoreValue ¶
HasStoreValue check if value exists in store or not
func (Keeper) MilestoneLogger ¶ added in v1.0.1
Logger returns a module-specific logger
func (*Keeper) PruneMilestone ¶ added in v1.0.1
PruneMilestone remove the milestone from the db based on number
func (*Keeper) SetCheckpointBuffer ¶
SetCheckpointBuffer flushes Checkpoint Buffer
func (*Keeper) SetLastMilestoneTimeout ¶ added in v1.0.1
SetLastMilestoneTimeout set lastMilestone timeout time
func (*Keeper) SetLastNoAck ¶
SetLastNoAck set last no-ack object
func (*Keeper) SetMilestoneBlockNumber ¶ added in v1.0.1
SetMilestoneBlockNumber set the block number when the latest milestone enter the handler
func (*Keeper) SetMilestoneCount ¶ added in v1.0.1
SetCount set the count number
func (*Keeper) SetNoAckMilestone ¶ added in v1.0.1
SetLastNoAck set last no-ack object
func (Keeper) UpdateACKCount ¶
UpdateACKCount updates ACK count by 1
type ModuleCommunicator ¶ added in v0.1.7
type ModuleCommunicator interface {
GetAllDividendAccounts(ctx sdk.Context) []hmTypes.DividendAccount
}
ModuleCommunicator manages different module interaction