Documentation ¶
Overview ¶
Package common provides common modules, constants and functions for the application.
Index ¶
- Constants
- func DivideCoins(coins sdk.Coins, dividend int64) sdk.Coins
- func GetCoinPercentage(coins sdk.Coins, percentage int64) sdk.Coins
- type AppModuleBasic
- func (amb AppModuleBasic) DefaultGenesis() json.RawMessage
- func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (amb AppModuleBasic) Name() string
- func (amb AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (amb AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
Constants ¶
View Source
const ( MicroCTKDenom = "uctk" MicroUnit = int64(1e6) )
View Source
const ( BlocksPerMinute = uint64(12) BlocksPerHour = BlocksPerMinute * 60 BlocksPerDay = BlocksPerHour * 24 BlocksPerWeek = BlocksPerDay * 7 BlocksPerMonth = BlocksPerDay * 30 BlocksPerYear = BlocksPerDay * 365 BlocksPerEpoch = BlocksPerWeek )
View Source
const ( // Bech32MainPrefix is the common prefix of all prefixes. Bech32MainPrefix = "certik" // Bech32PrefixAccAddr is the prefix of account addresses. Bech32PrefixAccAddr = Bech32MainPrefix // Bech32PrefixAccPub is the prefix of account public keys. Bech32PrefixAccPub = Bech32MainPrefix + sdk.PrefixPublic // Bech32PrefixValAddr is the prefix of validator operator addresses. Bech32PrefixValAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub is the prefix of validator operator public keys. Bech32PrefixValPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr is the prefix of consensus node addresses. Bech32PrefixConsAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub is the prefix of consensus node public keys. Bech32PrefixConsPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic )
Variables ¶
This section is empty.
Functions ¶
func DivideCoins ¶
DivideCoins divides the coins with certain number, discarding any remainders.
Types ¶
type AppModuleBasic ¶
type AppModuleBasic struct {
// contains filtered or unexported fields
}
AppModuleBasic defines common app module basics object.
func NewAppModuleBasic ¶
func NewAppModuleBasic( moduleName string, regCodec func(cdc *codec.Codec), modCdc *codec.Codec, defaultGenesisState interface{}, validateGenesis func(data json.RawMessage) error, storeKey string, registerRoutes func(cliCtx context.CLIContext, r *mux.Router, storeName string), getQueryCmd func(storeKey string, cdc *codec.Codec) *cobra.Command, getTxCmd func(cdc *codec.Codec) *cobra.Command, ) AppModuleBasic
NewAppModuleBasic create a new common AppModuleBasic object.
func (AppModuleBasic) DefaultGenesis ¶
func (amb AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns the default genesis state.
func (AppModuleBasic) GetQueryCmd ¶
func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd gets the root query command of this module.
func (AppModuleBasic) GetTxCmd ¶
func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd gets the root tx command of this module.
func (AppModuleBasic) RegisterCodec ¶
func (amb AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers module codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers REST routes for the module.
func (AppModuleBasic) ValidateGenesis ¶
func (amb AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis validates the module's genesis.
Click to show internal directories.
Click to hide internal directories.