Documentation ¶
Index ¶
- Constants
- Variables
- func AutoCLIOpts() (autocli.AppOptions, error)
- func GetMaccPerms() map[string][]string
- func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
- func MakeEncodingConfig() params.EncodingConfig
- func RegisterSwaggerAPI(rtr *mux.Router)
- type GenesisState
- func (genState GenesisState) AddMarketData(cdc codec.JSONCodec, ac address.Codec) GenesisState
- func (genState GenesisState) ConfigureAuctionFee(cdc codec.JSONCodec, denom string) GenesisState
- func (genState GenesisState) ConfigureIBCAllowedClients(cdc codec.JSONCodec) GenesisState
- func (genState GenesisState) ConfigureICA(cdc codec.JSONCodec) GenesisState
- func (genState GenesisState) ConfigureMinGasPrices(cdc codec.JSONCodec) GenesisState
- type MilkyWayApp
- func (app *MilkyWayApp) AppCodec() codec.Codec
- func (app *MilkyWayApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *MilkyWayApp) BlacklistedModuleAccountAddrs() map[string]bool
- func (app *MilkyWayApp) CheckTx(req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error)
- func (app *MilkyWayApp) Close() error
- func (app *MilkyWayApp) Configurator() module.Configurator
- func (app *MilkyWayApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *MilkyWayApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *MilkyWayApp) GetAccountKeeper() *authkeeper.AccountKeeper
- func (app *MilkyWayApp) GetBaseApp() *baseapp.BaseApp
- func (app *MilkyWayApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *MilkyWayApp) GetICAAuthKeeper() *icaauthkeeper.Keeper
- func (app *MilkyWayApp) GetICAControllerKeeper() *icacontrollerkeeper.Keeper
- func (app *MilkyWayApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *MilkyWayApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *MilkyWayApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *MilkyWayApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
- func (app *MilkyWayApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *MilkyWayApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *MilkyWayApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *MilkyWayApp) LegacyAmino() *codec.LegacyAmino
- func (app *MilkyWayApp) LoadHeight(height int64) error
- func (app *MilkyWayApp) ModuleAccountAddrs() map[string]bool
- func (app *MilkyWayApp) Name() string
- func (app *MilkyWayApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *MilkyWayApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *MilkyWayApp) RegisterExecutorChangePlans() error
- func (app *MilkyWayApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *MilkyWayApp) RegisterTendermintService(clientCtx client.Context)
- func (app *MilkyWayApp) RegisterTxService(clientCtx client.Context)
- func (app *MilkyWayApp) RegisterUpgradeHandlers()
- func (app *MilkyWayApp) SetCheckTx(handler blockchecktx.CheckTx)
- func (app *MilkyWayApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error)
- func (app *MilkyWayApp) TxConfig() client.TxConfig
Constants ¶
const ( // FeeDeductionGasAmount is a estimated gas amount of fee payment FeeDeductionGasAmount = 50_000 // AccountAddressPrefix is the prefix of bech32 encoded address AccountAddressPrefix = "init" // AppName is the application name AppName = "milkyway" // EnvPrefix is environment variable prefix for the app EnvPrefix = "MILKYWAY" // CoinType is the Cosmos Chain's coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md) CoinType = 118 // UpgradeName gov proposal name UpgradeName = "0.0.0" )
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string ModuleBasics = module.NewBasicManager( auth.AppModule{}, bank.AppModule{}, crisis.AppModule{}, opchild.AppModule{}, capability.AppModule{}, feegrantmodule.AppModule{}, upgrade.AppModule{}, authzmodule.AppModule{}, groupmodule.AppModule{}, consensus.AppModule{}, wasm.AppModule{}, auction.AppModule{}, tokenfactory.AppModule{}, ibc.AppModule{}, ibctransfer.AppModule{}, ica.AppModule{}, icaauth.AppModule{}, ibcfee.AppModule{}, ibctm.AppModule{}, solomachine.AppModule{}, packetforward.AppModule{}, ibchooks.AppModule{}, forwarding.AppModule{}, ratelimit.AppModule{}, oracle.AppModule{}, marketmap.AppModule{}, stakeibc.AppModule{}, epochs.AppModule{}, interchainquery.AppModule{}, records.AppModule{}, icacallbacks.AppModule{}, services.AppModule{}, operators.AppModule{}, pools.AppModule{}, restaking.AppModule{}, assets.AppModule{}, rewards.AppModule{}, liquidvesting.AppModule{}, ) )
Functions ¶
func AutoCLIOpts ¶ added in v1.2.0
func AutoCLIOpts() (autocli.AppOptions, error)
AutoCLIOpts returns the options for the auto-generated CLI
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeCodecs ¶ added in v1.2.0
func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
MakeCodecs creates the necessary testing codecs for Amino and Protobuf
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
Types ¶
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.Codec, mbm module.BasicManager, denom string) GenesisState
NewDefaultGenesisState generates the default state for the application.
func (GenesisState) AddMarketData ¶
func (genState GenesisState) AddMarketData(cdc codec.JSONCodec, ac address.Codec) GenesisState
func (GenesisState) ConfigureAuctionFee ¶
func (genState GenesisState) ConfigureAuctionFee(cdc codec.JSONCodec, denom string) GenesisState
func (GenesisState) ConfigureIBCAllowedClients ¶
func (genState GenesisState) ConfigureIBCAllowedClients(cdc codec.JSONCodec) GenesisState
func (GenesisState) ConfigureICA ¶
func (genState GenesisState) ConfigureICA(cdc codec.JSONCodec) GenesisState
func (GenesisState) ConfigureMinGasPrices ¶
func (genState GenesisState) ConfigureMinGasPrices(cdc codec.JSONCodec) GenesisState
ConfigureMinGasPrices generates the default state for the application.
type MilkyWayApp ¶
type MilkyWayApp struct { *baseapp.BaseApp // keepers // TODO: add gov keeper AccountKeeper *authkeeper.AccountKeeper BankKeeper *bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper GroupKeeper *groupkeeper.Keeper ConsensusParamsKeeper *consensusparamkeeper.Keeper CrisisKeeper *crisiskeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly TransferKeeper *ibctransferkeeper.Keeper AuthzKeeper *authzkeeper.Keeper FeeGrantKeeper *feegrantkeeper.Keeper ICAHostKeeper *icahostkeeper.Keeper ICAControllerKeeper *icacontrollerkeeper.Keeper ICAAuthKeeper *icaauthkeeper.Keeper IBCFeeKeeper *ibcfeekeeper.Keeper WasmKeeper *wasmkeeper.Keeper OPChildKeeper *opchildkeeper.Keeper AuctionKeeper *auctionkeeper.Keeper // x/auction keeper used to process bids for POB auctions PacketForwardKeeper *packetforwardkeeper.Keeper OracleKeeper *oraclekeeper.Keeper // x/oracle keeper used for the connect oracle MarketMapKeeper *marketmapkeeper.Keeper TokenFactoryKeeper *tokenfactorykeeper.Keeper IBCHooksKeeper *ibchookskeeper.Keeper ForwardingKeeper *forwardingkeeper.Keeper RateLimitKeeper ratelimitkeeper.Keeper EpochsKeeper epochskeeper.Keeper InterchainQueryKeeper icqkeeper.Keeper ICACallbacksKeeper icacallbackskeeper.Keeper RecordsKeeper recordskeeper.Keeper StakeIBCKeeper stakeibckeeper.Keeper ServicesKeeper *serviceskeeper.Keeper OperatorsKeeper *operatorskeeper.Keeper PoolsKeeper *poolskeeper.Keeper RestakingKeeper *restakingkeeper.Keeper AssetsKeeper *assetskeeper.Keeper RewardsKeeper *rewardskeeper.Keeper LiquidVestingKeeper *liquidvestingkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAAuthKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper ScopedFetchPriceKeeper capabilitykeeper.ScopedKeeper // the module manager ModuleManager *module.Manager BasicModuleManager module.BasicManager // contains filtered or unexported fields }
MilkyWayApp 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 NewMilkyWayApp ¶
func NewMilkyWayApp( logger log.Logger, db dbm.DB, kvindexerDB dbm.DB, traceStore io.Writer, loadLatest bool, wasmOpts []wasmkeeper.Option, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *MilkyWayApp
NewMilkyWayApp returns a reference to an initialized Initia.
func Setup ¶ added in v1.2.0
func Setup(t *testing.T, isCheckTx bool) *MilkyWayApp
Setup initializes a new MilkyWayApp for testing. A single validator will be created and registered in opchild module.
func SetupWithGenesisAccounts ¶
func SetupWithGenesisAccounts( t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) *MilkyWayApp
SetupWithGenesisAccounts setup initiaapp with genesis account
func (*MilkyWayApp) AppCodec ¶
func (app *MilkyWayApp) AppCodec() codec.Codec
AppCodec returns Initia'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 (*MilkyWayApp) BeginBlocker ¶
func (app *MilkyWayApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker application updates every begin block
func (*MilkyWayApp) BlacklistedModuleAccountAddrs ¶
func (app *MilkyWayApp) BlacklistedModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*MilkyWayApp) CheckTx ¶
func (app *MilkyWayApp) CheckTx(req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error)
CheckTx will check the transaction with the provided checkTxHandler. We override the default handler so that we can verify bid transactions before they are inserted into the mempool. With the POB CheckTx, we can verify the bid transaction and all of the bundled transactions before inserting the bid transaction into the mempool.
func (*MilkyWayApp) Close ¶
func (app *MilkyWayApp) Close() error
Close closes the underlying baseapp, the oracle service, and the prometheus server if required. This method blocks on the closure of both the prometheus server, and the oracle-service
func (*MilkyWayApp) Configurator ¶ added in v1.2.0
func (app *MilkyWayApp) Configurator() module.Configurator
Configurator returns the app's configurator.
func (*MilkyWayApp) EndBlocker ¶
EndBlocker application updates every end block
func (*MilkyWayApp) ExportAppStateAndValidators ¶
func (app *MilkyWayApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*MilkyWayApp) GetAccountKeeper ¶
func (app *MilkyWayApp) GetAccountKeeper() *authkeeper.AccountKeeper
GetAccountKeeper implements the TestingApp interface.
func (*MilkyWayApp) GetBaseApp ¶
func (app *MilkyWayApp) GetBaseApp() *baseapp.BaseApp
GetBaseApp implements the TestingApp interface.
func (*MilkyWayApp) GetIBCKeeper ¶
func (app *MilkyWayApp) GetIBCKeeper() *ibckeeper.Keeper
GetIBCKeeper implements the TestingApp interface.
func (*MilkyWayApp) GetICAAuthKeeper ¶
func (app *MilkyWayApp) GetICAAuthKeeper() *icaauthkeeper.Keeper
GetICAAuthKeeper implements the TestingApp interface.
func (*MilkyWayApp) GetICAControllerKeeper ¶
func (app *MilkyWayApp) GetICAControllerKeeper() *icacontrollerkeeper.Keeper
GetICAControllerKeeper implements the TestingApp interface.
func (*MilkyWayApp) GetKey ¶
func (app *MilkyWayApp) 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 (*MilkyWayApp) GetMemKey ¶
func (app *MilkyWayApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*MilkyWayApp) GetScopedIBCKeeper ¶
func (app *MilkyWayApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
GetScopedIBCKeeper implements the TestingApp interface.
func (*MilkyWayApp) GetStakingKeeper ¶
func (app *MilkyWayApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
GetStakingKeeper implements the TestingApp interface. It returns opchild instead of original staking keeper.
func (*MilkyWayApp) GetTKey ¶
func (app *MilkyWayApp) 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 (*MilkyWayApp) InitChainer ¶
func (app *MilkyWayApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*MilkyWayApp) InterfaceRegistry ¶
func (app *MilkyWayApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Initia's InterfaceRegistry
func (*MilkyWayApp) LegacyAmino ¶
func (app *MilkyWayApp) 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 (*MilkyWayApp) LoadHeight ¶
func (app *MilkyWayApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*MilkyWayApp) ModuleAccountAddrs ¶
func (app *MilkyWayApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*MilkyWayApp) PreBlocker ¶
func (app *MilkyWayApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates every pre block
func (*MilkyWayApp) RegisterAPIRoutes ¶
func (app *MilkyWayApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*MilkyWayApp) RegisterExecutorChangePlans ¶
func (app *MilkyWayApp) RegisterExecutorChangePlans() error
func (*MilkyWayApp) RegisterNodeService ¶
func (app *MilkyWayApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
func (*MilkyWayApp) RegisterTendermintService ¶
func (app *MilkyWayApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*MilkyWayApp) RegisterTxService ¶
func (app *MilkyWayApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*MilkyWayApp) RegisterUpgradeHandlers ¶
func (app *MilkyWayApp) RegisterUpgradeHandlers()
RegisterUpgradeHandlers returns upgrade handlers
func (*MilkyWayApp) SetCheckTx ¶
func (app *MilkyWayApp) SetCheckTx(handler blockchecktx.CheckTx)
SetCheckTx sets the checkTxHandler for the app.
func (*MilkyWayApp) TxConfig ¶
func (app *MilkyWayApp) TxConfig() client.TxConfig
TxConfig implements the TestingApp interface.