Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultCoinDenomRegex() string
- func MakeEncodingConfig() params.EncodingConfig
- type GenesisState
- type PetriApp
- func (app *PetriApp) AppCodec() codec.Codec
- func (app *PetriApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *PetriApp) BlockedModuleAccountAddrs() map[string]bool
- func (app *PetriApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *PetriApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *PetriApp) ExportGenesis(ctx sdk.Context) map[string]json.RawMessage
- func (app *PetriApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *PetriApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *PetriApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *PetriApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *PetriApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *PetriApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *PetriApp) LegacyAmino() *codec.LegacyAmino
- func (app *PetriApp) LoadHeight(height int64) error
- func (app *PetriApp) ModuleAccountAddrs() map[string]bool
- func (app *PetriApp) Name() string
- func (app *PetriApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *PetriApp) RegisterTendermintService(clientCtx client.Context)
- func (app *PetriApp) RegisterTxService(clientCtx client.Context)
- func (app *PetriApp) RegisterUpgradeHandler(planName string, upgrades *storetypes.StoreUpgrades, ...)
- func (app *PetriApp) RegisterUpgradePlan(cfg module.Configurator)
- func (app *PetriApp) SimulationManager() *module.SimulationManager
Constants ¶
const ( DefaultWeightMsgSend int = 100 DefaultWeightMsgMultiSend int = 10 DefaultWeightMsgSetWithdrawAddress int = 50 DefaultWeightMsgWithdrawDelegationReward int = 50 DefaultWeightMsgWithdrawValidatorCommission int = 50 DefaultWeightMsgFundCommunityPool int = 50 DefaultWeightMsgDeposit int = 100 DefaultWeightMsgVote int = 67 DefaultWeightMsgUnjail int = 100 DefaultWeightMsgCreateValidator int = 100 DefaultWeightMsgEditValidator int = 5 DefaultWeightMsgDelegate int = 100 DefaultWeightMsgUndelegate int = 100 DefaultWeightMsgBeginRedelegate int = 100 DefaultWeightCommunitySpendProposal int = 5 DefaultWeightTextProposal int = 5 DefaultWeightParamChangeProposal int = 5 )
Default simulation operation weights for messages and gov proposals
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, tibcclient.CreateClientProposalHandler, tibcclient.UpgradeClientProposalHandler, tibcclient.RegisterRelayerProposalHandler, tibcrouting.SetRoutingRulesProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, ica.AppModuleBasic{}, guardian.AppModuleBasic{}, token.AppModuleBasic{}, record.AppModuleBasic{}, nftmodule.AppModuleBasic{}, htlc.AppModuleBasic{}, coinswap.AppModuleBasic{}, service.AppModuleBasic{}, oracle.AppModuleBasic{}, random.AppModuleBasic{}, farm.AppModuleBasic{}, tibc.AppModuleBasic{}, tibcnfttransfer.AppModuleBasic{}, tibcmttransfer.AppModuleBasic{}, mt.AppModuleBasic{}, ) )
Functions ¶
func DefaultCoinDenomRegex ¶
func DefaultCoinDenomRegex() string
DefaultCoinDenomRegex returns the default regex string
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
Types ¶
type GenesisState ¶
type GenesisState map[string]json.RawMessage
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() GenesisState
NewDefaultGenesisState generates the default state for the application.
type PetriApp ¶
type PetriApp struct { *baseapp.BaseApp // cosmos FeeGrantKeeper feegrantkeeper.Keeper AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper EvidenceKeeper evidencekeeper.Keeper AuthzKeeper authzkeeper.Keeper //ibc IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly IBCTransferKeeper ibctransferkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper GuardianKeeper guardiankeeper.Keeper TokenKeeper tokenkeeper.Keeper RecordKeeper recordkeeper.Keeper NFTKeeper nftkeeper.Keeper MTKeeper mtkeeper.Keeper HTLCKeeper htlckeeper.Keeper CoinswapKeeper coinswapkeeper.Keeper ServiceKeeper servicekeeper.Keeper OracleKeeper oraclekeeper.Keeper RandomKeeper randomkeeper.Keeper FarmKeeper farmkeeper.Keeper TIBCKeeper *tibckeeper.Keeper TIBCNFTTransferKeeper tibcnfttransferkeeper.Keeper TIBCMTTransferKeeper tibcmttransferkeeper.Keeper // contains filtered or unexported fields }
PetriApp 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.
func NewPetriApp ¶
func NewPetriApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig petriappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *PetriApp
NewPetriApp returns a reference to an initialized PetriApp.
func (*PetriApp) AppCodec ¶
AppCodec returns PetriApp'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 (*PetriApp) BeginBlocker ¶
func (app *PetriApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*PetriApp) BlockedModuleAccountAddrs ¶
BlockedModuleAccountAddrs returns all the app's blocked module account addresses.
func (*PetriApp) EndBlocker ¶
func (app *PetriApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*PetriApp) ExportAppStateAndValidators ¶
func (app *PetriApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*PetriApp) ExportGenesis ¶
ExportGenesis returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*PetriApp) GetKey ¶
func (app *PetriApp) 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 (*PetriApp) GetMemKey ¶
func (app *PetriApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*PetriApp) GetSubspace ¶
func (app *PetriApp) 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 (*PetriApp) GetTKey ¶
func (app *PetriApp) 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 (*PetriApp) InitChainer ¶
func (app *PetriApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*PetriApp) InterfaceRegistry ¶
func (app *PetriApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns PetriApp's InterfaceRegistry
func (*PetriApp) LegacyAmino ¶
func (app *PetriApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns SimApp'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.
func (*PetriApp) LoadHeight ¶
LoadHeight loads a particular height
func (*PetriApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*PetriApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*PetriApp) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*PetriApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*PetriApp) RegisterUpgradeHandler ¶
func (app *PetriApp) RegisterUpgradeHandler( planName string, upgrades *storetypes.StoreUpgrades, upgradeHandler sdkupgrade.UpgradeHandler, )
RegisterUpgradeHandler implements the upgrade execution logic of the upgrade module
func (*PetriApp) RegisterUpgradePlan ¶
func (app *PetriApp) RegisterUpgradePlan(cfg module.Configurator)
RegisterUpgradePlan register a handler of upgrade plan
func (*PetriApp) SimulationManager ¶
func (app *PetriApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface