Documentation
¶
Index ¶
- Constants
- Variables
- func DecToDuration(d sdkmath.LegacyDec) time.Duration
- func DefaultPeriodRatio() sdkmath.LegacyDec
- func DefaultThresholdRatio() sdkmath.LegacyDec
- func DurationToDec(d time.Duration) sdkmath.LegacyDec
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)
- func StoreKeys() (map[string]*storetypes.KVStoreKey, map[string]*storetypes.MemoryStoreKey, ...)
- func UpdateExpeditedParams(ctx context.Context, gov govkeeper.Keeper) error
- type App
- type ChainApp
- func (app *ChainApp) AppCodec() codec.Codec
- func (app *ChainApp) AutoCliOpts() autocli.AppOptions
- func (app *ChainApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *ChainApp) BlockedAddrs() map[string]bool
- func (app *ChainApp) Close() error
- func (app *ChainApp) DefaultGenesis() map[string]json.RawMessage
- func (app *ChainApp) EncodingConfig() appparams.EncodingConfig
- func (app *ChainApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *ChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *ChainApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *ChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *ChainApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *ChainApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *ChainApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *ChainApp) LegacyAmino() *codec.LegacyAmino
- func (app *ChainApp) LoadHeight(height int64) error
- func (app *ChainApp) ModuleAccountAddrs() map[string]bool
- func (app *ChainApp) Name() string
- func (app *ChainApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *ChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *ChainApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *ChainApp) RegisterTendermintService(clientCtx client.Context)
- func (app *ChainApp) RegisterTxService(clientCtx client.Context)
- func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec)
- func (app *ChainApp) SimulationManager() *module.SimulationManager
- func (app *ChainApp) TxConfig() client.TxConfig
- type GenesisState
- type HandlerOptions
- type RootMultiStore
- type ValidateMsgTransferDecorator
Constants ¶
const ( // MaxClassIDLength values chosen arbitrarily MaxClassIDLength = 2048 MaxTokenIds = 256 MaxTokenIDLength = 2048 MaximumReceiverLength = 2048 )
Variables ¶
var CircuitSuperAdmins = map[string][]string{
"chaintest": {
"cro1jgt29q28ehyc6p0fd5wqhwswfxv59lhppz3v65",
"cro1sjcrmp0ngft2n2r3r4gcva4llfj8vjdnefdg4m",
},
"testnet-croeseid-4": {
"tcro14thaw89nlpp8hjm83z6zp3w5ymlpgg2zejncw7",
"tcro19uhea66tnx78r5258sq5vdad8msk47w6vn8f06",
},
"crypto-org-chain-mainnet-dryrun-1": {
"cro1h704kvqdh48jzge7vvxpej9d6r9usvssehmxac",
"cro1gv6e77tq7l06904g9nuu4nvnwcynaannwjpuaj",
"cro160rhmah7kmfy9vg9jklkdqyv6nu9j7jnjpun9j",
},
"crypto-org-chain-mainnet-1": {
"cro160rhmah7kmfy9vg9jklkdqyv6nu9j7jnjpun9j",
},
}
CircuitSuperAdmins maps chain IDs to their super admin addresses
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string )
Functions ¶
func DefaultPeriodRatio ¶
func DefaultThresholdRatio ¶
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func StoreKeys ¶
func StoreKeys() ( map[string]*storetypes.KVStoreKey, map[string]*storetypes.MemoryStoreKey, map[string]*storetypes.TransientStoreKey, )
StoreKeys returns all the store keys to register in current app
Types ¶
type App ¶
type App interface {
// The assigned name of the app.
Name() string
// The application types codec.
// NOTE: This should be sealed before being returned.
LegacyAmino() *codec.LegacyAmino
// Application updates every begin block.
BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
// Application updates every end block.
EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
// Application update at chain (i.e app) initialization.
InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
// Loads the app at a given height.
LoadHeight(height int64) error
// Exports the state of the application for a genesis file.
ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs, modulesToExport []string,
) (servertypes.ExportedApp, error)
// All the registered module account addresses.
ModuleAccountAddrs() map[string]bool
}
App implements the common methods for a Cosmos SDK-based application specific blockchain. (Amino is still needed for Ledger at the moment)
type ChainApp ¶
type ChainApp struct {
*baseapp.BaseApp
// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
GroupKeeper groupkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
NFTTransferKeeper nfttransferkeeper.Keeper
SupplyKeeper supplykeeper.Keeper
NFTKeeper nftkeeper.Keeper
CircuitKeeper circuitkeeper.Keeper
MaxSupplyKeeper maxsupplykeeper.Keeper
// the module manager
ModuleManager *module.Manager
BasicModuleManager module.BasicManager
// contains filtered or unexported fields
}
ChainApp extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing. (Amino is still needed for Ledger at the moment)
func New ¶
func New( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *ChainApp
New returns a reference to an initialized Chain.
func (*ChainApp) AppCodec ¶
AppCodec returns Chain's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*ChainApp) AutoCliOpts ¶
func (app *ChainApp) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*ChainApp) BeginBlocker ¶
BeginBlocker application updates every begin block
func (*ChainApp) BlockedAddrs ¶
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*ChainApp) DefaultGenesis ¶
func (app *ChainApp) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*ChainApp) EncodingConfig ¶
func (app *ChainApp) EncodingConfig() appparams.EncodingConfig
func (*ChainApp) EndBlocker ¶
EndBlocker application updates every end block
func (*ChainApp) ExportAppStateAndValidators ¶
func (app *ChainApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*ChainApp) GetKey ¶
func (app *ChainApp) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*ChainApp) GetMemKey ¶
func (app *ChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*ChainApp) GetSubspace ¶
func (app *ChainApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*ChainApp) GetTKey ¶
func (app *ChainApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*ChainApp) InitChainer ¶
func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*ChainApp) InterfaceRegistry ¶
func (app *ChainApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Chain's InterfaceRegistry
func (*ChainApp) LegacyAmino ¶
func (app *ChainApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns ChainApp's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types. (Amino is still needed for Ledger at the moment)
func (*ChainApp) LoadHeight ¶
LoadHeight loads a particular height
func (*ChainApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*ChainApp) PreBlocker ¶
func (app *ChainApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker updates every pre begin block
func (*ChainApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*ChainApp) RegisterNodeService ¶
func (*ChainApp) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*ChainApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*ChainApp) RegisterUpgradeHandlers ¶
func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec)
func (*ChainApp) SimulationManager ¶
func (app *ChainApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type HandlerOptions ¶
type HandlerOptions struct {
ante.HandlerOptions
IBCKeeper *keeper.Keeper
CircuitKeeper circuitante.CircuitBreaker
}
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.
type RootMultiStore ¶
type RootMultiStore interface {
storetypes.MultiStore
// LatestVersion returns the latest version in the store
LatestVersion() int64
}
RootMultiStore this is source from https://github.com/crypto-org-chain/cosmos-sdk/blob/release/v0.50.x/store/types/store.go
type ValidateMsgTransferDecorator ¶
type ValidateMsgTransferDecorator struct{}
ValidateMsgTransferDecorator is a temporary decorator that limit the field length of MsgTransfer message.
func NewValidateMsgTransferDecorator ¶
func NewValidateMsgTransferDecorator() ValidateMsgTransferDecorator