Documentation
¶
Index ¶
Constants ¶
View Source
const ( // module name ModuleName = "global" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
View Source
const ( // Default epoch length based on seconds DefaultEpochLength int64 = 60 // Default lower bound of block time diff DefaultBlkTimeDiffLower int64 = 2 // Default upper bound of block time diff DefaultBlkTimeDiffUpper int64 = 15 // Default number of blocks to confirm a block is safe DefaultConfirmationCount uint64 = 5 )
global params default values
View Source
const ( QueryLatestBlock = "latestBlock" QuerySecureBlockNum = "secureBlockNum" QueryEpoch = "epoch" QueryParameters = "parameters" )
View Source
const RouterKey = ModuleName // this was defined in your key.go file
View Source
const (
TypeMsgSyncBlock = "sync_block"
)
Variables ¶
View Source
var ( LatestBlockKey = []byte{0x01} // Key for lastest block EpochKeyPrefix = []byte{0x21} // Key prefix for epoch LatestEpochKey = []byte{0x22} // Key for latest epoch )
View Source
var ( KeyEpochLength = []byte("EpochLength") KeyBlkTimeDiffLower = []byte("KeyBlkTimeDiffLower") KeyBlkTimeDiffUpper = []byte("KeyBlkTimeDiffUpper") KeyConfirmationCount = []byte("KeyConfirmationCount") )
nolint - Keys for parameter access
View Source
var ModuleCdc = codec.New()
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type Epoch ¶
type MsgSyncBlock ¶
type MsgSyncBlock struct {
BlockNumber uint64 `json:"blockNumber"`
Sender sdk.AccAddress `json:"sender"`
}
MsgSyncBlock defines a SyncBlock message
func NewMsgSyncBlock ¶
func NewMsgSyncBlock(blockNumber uint64, sender sdk.AccAddress) MsgSyncBlock
NewMsgSyncBlock is a constructor function for MsgSyncBlock
func (MsgSyncBlock) GetSignBytes ¶
func (msg MsgSyncBlock) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSyncBlock) GetSigners ¶
func (msg MsgSyncBlock) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSyncBlock) Route ¶
func (msg MsgSyncBlock) Route() string
Route should return the name of the module
func (MsgSyncBlock) ValidateBasic ¶
func (msg MsgSyncBlock) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type Params ¶
type Params struct {
EpochLength int64 `json:"epochLength" yaml:"epochLength"` // epoch length based on seconds
BlkTimeDiffLower int64 `json:"blkTimeDiffLower" yaml:"blkTimeDiffLower"` // The lower bound of block time diff
BlkTimeDiffUpper int64 `json:"blkTimeDiffUpper" yaml:"blkTimeDiffUpper"` // The upper bound of block time diff
ConfirmationCount uint64 `json:"confirmationCount" yaml:"confirmationCount"` // Number of blocks to confirm a block is safe
}
Params defines the high level settings for global
func MustUnmarshalParams ¶
unmarshal the current global params value from store key or panic
func NewParams ¶
func NewParams(epochLength, blkTimeDiffLower, blkTimeDiffUpper int64, confirmationCount uint64) Params
NewParams creates a new Params instance
func UnmarshalParams ¶
unmarshal the current global params value from store key
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryEpochParams ¶
type QueryEpochParams struct {
EpochId int64
}
func NewQueryEpochParams ¶
func NewQueryEpochParams(epochId int64) QueryEpochParams
Click to show internal directories.
Click to hide internal directories.