Documentation ¶
Index ¶
- Variables
- func AddTestAddrsIncremental(app *App, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress
- func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, ...) error
- func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, ...) error
- func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func GetWasmOpts(app *App, appOpts servertypes.AppOptions) []wasm.Option
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewTestNetworkFixture() network.TestFixture
- func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, ...) (sdk.GasInfo, *sdk.Result, error)
- type App
- func NewAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *App
- func NewSimApp(logger log.Logger, db tmdb.DB, traceStore io.Writer, loadLatest bool, ...) *App
- func Setup(t *testing.T, opts ...wasm.Option) (*App, sdk.Context, *authtypes.BaseAccount)
- func SetupWithEmptyStore(tb testing.TB) *App
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *App
- func (app *App) AppCodec() codec.Codec
- func (app *App) BeginBlocker(ctx sdktypes.Context, req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock
- func (app *App) DefaultGenesis() map[string]json.RawMessage
- func (app *App) EndBlocker(ctx sdktypes.Context, req abcitypes.RequestEndBlock) abcitypes.ResponseEndBlock
- func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *App) InitChainer(ctx sdktypes.Context, req abcitypes.RequestInitChain) abcitypes.ResponseInitChain
- func (app *App) InterfaceRegistry() types.InterfaceRegistry
- func (app *App) LegacyAmino() *codec.LegacyAmino
- func (app *App) LoadHeight(height int64) error
- func (app *App) Name() string
- func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *App) RegisterNodeService(clientCtx client.Context)
- func (app *App) RegisterTendermintService(clientCtx client.Context)
- func (app *App) RegisterTxService(clientCtx client.Context)
- func (app *App) SimulationManager() *module.SimulationManager
- func (app *App) TxConfig() client.TxConfig
- type HandlerOptions
- type SetupOptions
Constants ¶
This section is empty.
Variables ¶
var ( AccountAddressPrefix = "feath" AccountPubKeyPrefix = "feathpub" ValidatorAddressPrefix = "feathvaloper" ValidatorPubKeyPrefix = "feathvaloperpub" ConsensusNodeAddressPrefix = "feathvalcons" ConsensusNodePubKeyPrefix = "feathvalconspub" BondDenom = "featherstake" AppName = "feather-core" )
DO NOT change the names of these variables! TODO: to prevent other users from changing these variables, we could probably just publish our own package like https://pkg.go.dev/github.com/cosmos/cosmos-sdk/version
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{}, bank.AppModuleBasic{}, authzmodule.AppModuleBasic{}, capability.AppModuleBasic{}, consensus.AppModuleBasic{}, crisis.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, groupmodule.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, nftmodule.AppModuleBasic{}, genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), vesting.AppModuleBasic{}, slashing.AppModuleBasic{}, gov.NewAppModuleBasic(getGovProposalHandlers()), distr.AppModuleBasic{}, params.AppModuleBasic{}, evidence.AppModuleBasic{}, upgrade.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctransfer.AppModuleBasic{}, ica.AppModuleBasic{}, ibcfee.AppModuleBasic{}, ibchooks.AppModuleBasic{}, wasm.AppModuleBasic{}, ibctm.AppModuleBasic{}, ) )
Functions ¶
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *App, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress
AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func FundAccount ¶
func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error
FundAccount is a utility function that funds an account by minting and sending the coins to the address. This should be used for testing purposes only!
Instead of using the mint module account, which has the permission of minting, create a "faucet" account. (@fdymylja)
func FundModuleAccount ¶
func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, amounts sdk.Coins) error
FundModuleAccount is a utility function that funds a module account by minting and sending the coins to the address. This should be used for testing purposes only!
Instead of using the mint module account, which has the permission of minting, create a "faucet" account. (@fdymylja)
func GenesisStateWithValSet ¶
func GenesisStateWithValSet( codec codec.Codec, genesisState map[string]json.RawMessage, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (map[string]json.RawMessage, error)
GenesisStateWithValSet returns a new genesis state with the validator set copied from simtestutil with delegation not added to supply
func GetWasmOpts ¶
func GetWasmOpts(app *App, appOpts servertypes.AppOptions) []wasm.Option
GetWasmOpts build wasm options
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func NewTestNetworkFixture ¶
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests
func SignAndDeliverWithoutCommit ¶
func SignAndDeliverWithoutCommit( t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error)
SignAndDeliverWithoutCommit signs and delivers a transaction. No commit
Types ¶
type App ¶
type App struct { *baseapp.BaseApp // keepers AuthKeeper authkeeper.AccountKeeper // TODO: Do we even need to store this state? AuthzKeeper authzkeeper.Keeper 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 NftKeeper nftkeeper.Keeper ParamsKeeper paramskeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper WasmKeeper wasm.Keeper ConsensusParamsKeeper consensuskeeper.Keeper IBCFeeKeeper ibcfeekeeper.Keeper ContractKeeper wasmtypes.ContractOpsKeeper // IBC hooks IBCHooksKeeper ibchookskeeper.Keeper // ModuleManager is the module manager ModuleManager *module.Manager // contains filtered or unexported fields }
App 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 NewAppWithCustomOptions ¶
func NewAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *App
NewAppWithCustomOptions initializes a new WasmApp with custom options.
func NewSimApp ¶
func NewSimApp( logger log.Logger, db tmdb.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App
NewSimApp returns a reference to an initialized blockchain app
func SetupWithEmptyStore ¶
SetupWithEmptyStore set up a wasmd app instance with empty DB
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasm.Option, balances ...banktypes.Balance) *App
SetupWithGenesisValSet initializes a new WasmApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the WasmApp from first genesis account. A Nop logger is set in WasmApp.
func (*App) AppCodec ¶
AppCodec returns an 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 (*App) BeginBlocker ¶
func (app *App) BeginBlocker(ctx sdktypes.Context, req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*App) DefaultGenesis ¶
func (app *App) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*App) EndBlocker ¶
func (app *App) EndBlocker(ctx sdktypes.Context, req abcitypes.RequestEndBlock) abcitypes.ResponseEndBlock
EndBlocker application updates every end block
func (*App) ExportAppStateAndValidators ¶
func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*App) InitChainer ¶
func (app *App) InitChainer(ctx sdktypes.Context, req abcitypes.RequestInitChain) abcitypes.ResponseInitChain
InitChainer application update at chain initialization
func (*App) InterfaceRegistry ¶
func (app *App) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns an InterfaceRegistry
func (*App) LegacyAmino ¶
func (app *App) 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 (*App) LoadHeight ¶
LoadHeight loads a particular height
func (*App) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*App) RegisterNodeService ¶
func (*App) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*App) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*App) SimulationManager ¶
func (app *App) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type HandlerOptions ¶
type HandlerOptions struct { ante.HandlerOptions IBCKeeper *ibckeeper.Keeper TxCounterStoreKey storetypes.StoreKey WasmConfig wasmTypes.WasmConfig Cdc codec.BinaryCodec }
HandlerOptions extends the SDK's AnteHandler options by requiring the IBC channel keeper.
type SetupOptions ¶
type SetupOptions struct { Logger log.Logger DB *dbm.MemDB AppOpts servertypes.AppOptions WasmOpts []wasm.Option }
SetupOptions defines arguments that are passed into `WasmApp` constructor.