Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func GetCheckpointKey(checkpointNumber uint64) []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 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)
- 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) 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) GetLastNoAck(ctx sdk.Context) uint64
- 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) SetCheckpointBuffer(ctx sdk.Context, checkpoint hmTypes.Checkpoint) error
- func (k *Keeper) SetLastNoAck(ctx sdk.Context, timestamp uint64)
- 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 )
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func GetCheckpointKey ¶
GetCheckpointKey appends prefix to checkpointNumber
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 ¶
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 ¶
func NewSideTxHandler(k Keeper, contractCaller helper.IContractCaller) hmTypes.SideTxHandler
NewSideTxHandler returns a side handler for "bank" type messages.
func PostHandleMsgCheckpoint ¶
func PostHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgCheckpoint handles msg checkpoint
func PostHandleMsgCheckpointAck ¶
func PostHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, sideTxResult abci.SideTxResultType) sdk.Result
PostHandleMsgCheckpointAck handles msg checkpoint ack
func SideHandleMsgCheckpoint ¶
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 ¶
func SideHandleMsgCheckpointAck(ctx sdk.Context, k Keeper, msg types.MsgCheckpointAck, contractCaller helper.IContractCaller) (result abci.ResponseDeliverSideTx)
SideHandleMsgCheckpointAck handles MsgCheckpointAck 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 ¶
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 ¶
func (am AppModule) NewPostTxHandler() hmTypes.PostTxHandler
NewPostTxHandler side tx handler
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the auth module sdk.Querier.
func (AppModule) NewSideTxHandler ¶
func (am AppModule) NewSideTxHandler() hmTypes.SideTxHandler
NewSideTxHandler side tx handler
func (AppModule) ProposalContents ¶
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 ¶
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 ¶
func (AppModule) RegisterStoreDecoder(sdr hmModule.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for chainmanager module's types
func (AppModule) WeightedOperations ¶
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) 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 ¶
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 ¶
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) GetLastNoAck ¶
GetLastNoAck returns last no ack
func (*Keeper) HasStoreValue ¶
HasStoreValue check if value exists in store or not
func (*Keeper) SetCheckpointBuffer ¶
SetCheckpointBuffer flushes Checkpoint Buffer
func (*Keeper) SetLastNoAck ¶
SetLastNoAck set last no-ack object
func (Keeper) UpdateACKCount ¶
UpdateACKCount updates ACK count by 1
type ModuleCommunicator ¶
type ModuleCommunicator interface {
GetAllDividendAccounts(ctx sdk.Context) []hmTypes.DividendAccount
}
ModuleCommunicator manages different module interaction