Documentation ¶
Index ¶
- Constants
- Variables
- func AddTestAddrsIncremental(app *TerpApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress
- func BlockedAddresses() map[string]bool
- 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 GetEnabledProposals() []wasm.ProposalType
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func ModuleAccountAddrs() map[string]bool
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewTestNetworkFixture() network.TestFixture
- func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, ...) (sdk.GasInfo, *sdk.Result, error)
- type GenesisState
- type HandlerOptions
- type SetupOptions
- type TerpApp
- func NewTerpApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *TerpApp
- func NewTerpAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *TerpApp
- func Setup(t *testing.T, opts ...wasm.Option) *TerpApp
- func SetupWithEmptyStore(tb testing.TB) *TerpApp
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *TerpApp
- func (app *TerpApp) AppCodec() codec.Codec
- func (app *TerpApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *TerpApp) Configurator() module.Configurator
- func (app *TerpApp) DefaultGenesis() map[string]json.RawMessage
- func (app *TerpApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *TerpApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *TerpApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *TerpApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *TerpApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *TerpApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *TerpApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *TerpApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *TerpApp) LegacyAmino() *codec.LegacyAmino
- func (app *TerpApp) LoadHeight(height int64) error
- func (app *TerpApp) Name() string
- func (app *TerpApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *TerpApp) RegisterNodeService(clientCtx client.Context)
- func (app *TerpApp) RegisterTendermintService(clientCtx client.Context)
- func (app *TerpApp) RegisterTxService(clientCtx client.Context)
- func (app TerpApp) RegisterUpgradeHandlers()
- func (app *TerpApp) SimulationManager() *module.SimulationManager
- func (app *TerpApp) TxConfig() client.TxConfig
Constants ¶
const (
MockFeePort string = ibcmock.ModuleName + ibcfeetypes.ModuleName
)
const UpgradeName = "v046-to-v047"
UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade from v046 to v047.
NOTE: This upgrade defines a reference implementation of what an upgrade could look like when an application is migrating from Cosmos SDK version v0.46.x to v0.47.x.
Variables ¶
var ( NodeDir = ".terp" Bech32Prefix = "terp" // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. ProposalsEnabled = "true" // If set to non-empty string it must be comma-separated list of values that are all a subset // of "EnableAllProposals" (takes precedence over ProposalsEnabled) // https://github.com/terpnetwork/terp-core/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" )
We pull these out so we can set them with LDFLAGS in the Makefile
var ( // DefaultNodeHome default home directories for terpd DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32Prefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic )
These constants are derived from the above variables. These are the ones we will want to use in the code, based on any overrides above
var ( // 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.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, groupmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, nftmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, wasm.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctm.AppModuleBasic{}, transfer.AppModuleBasic{}, ica.AppModuleBasic{}, ibcfee.AppModuleBasic{}, tokenfactory.AppModuleBasic{}, ) )
Functions ¶
func AddTestAddrsIncremental ¶ added in v0.2.0
func AddTestAddrsIncremental(app *TerpApp, 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 BlockedAddresses ¶ added in v1.0.0
BlockedAddresses returns all the app's blocked account addresses.
func FundAccount ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v1.0.0
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 GetEnabledProposals ¶
func GetEnabledProposals() []wasm.ProposalType
GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into wasmd app.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
NOTE: This is solely to be used for testing purposes.
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates a new EncodingConfig with all modules registered
func ModuleAccountAddrs ¶ added in v1.0.0
ModuleAccountAddrs provides a list of blocked module accounts from configuration in AppConfig
Ported from TerpApp
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func NewTestNetworkFixture ¶ added in v1.0.0
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new TerpApp AppConstructor for network simulation tests
func SignAndDeliverWithoutCommit ¶ added in v1.0.0
func SignAndDeliverWithoutCommit( t *testing.T, txCfg client.TxConfig, app *bam.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 GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState 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 GenesisStateWithSingleValidator ¶ added in v1.0.0
func GenesisStateWithSingleValidator(t *testing.T, app *TerpApp) GenesisState
GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.
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 WasmConfig *wasmTypes.WasmConfig TXCounterStoreKey storetypes.StoreKey }
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.
type SetupOptions ¶ added in v1.0.0
type SetupOptions struct { Logger log.Logger DB *dbm.MemDB AppOpts servertypes.AppOptions WasmOpts []wasm.Option }
SetupOptions defines arguments that are passed into `TerpApp` constructor.
type TerpApp ¶
type TerpApp struct { *baseapp.BaseApp // keepers AccountKeeper authkeeper.AccountKeeper AuthzKeeper authzkeeper.Keeper BankKeeper bankkeeper.BaseKeeper 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 FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper NFTKeeper nftkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly IBCFeeKeeper ibcfeekeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper TokenFactoryKeeper tokenfactorykeeper.Keeper ICAHostKeeper icahostkeeper.Keeper TransferKeeper ibctransferkeeper.Keeper WasmKeeper wasm.Keeper ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper // the module manager ModuleManager *module.Manager // contains filtered or unexported fields }
TerpApp extended ABCI application
func NewTerpApp ¶
func NewTerpApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, enabledProposals []wasm.ProposalType, appOpts servertypes.AppOptions, wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *TerpApp
NewTerpApp returns a reference to an initialized TerpApp.
func NewTerpAppWithCustomOptions ¶ added in v1.0.0
func NewTerpAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *TerpApp
NewTerpAppWithCustomOptions initializes a new TerpApp with custom options.
func SetupWithEmptyStore ¶ added in v0.2.0
SetupWithEmptyStore set up a wasmd app instance with empty DB
func SetupWithGenesisValSet ¶ added in v0.2.0
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasm.Option, balances ...banktypes.Balance) *TerpApp
SetupWithGenesisValSet initializes a new TerpApp 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 TerpApp from first genesis account. A Nop logger is set in TerpApp.
func (*TerpApp) AppCodec ¶
AppCodec returns 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 (*TerpApp) BeginBlocker ¶
func (app *TerpApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*TerpApp) Configurator ¶ added in v1.0.0
func (app *TerpApp) Configurator() module.Configurator
func (*TerpApp) DefaultGenesis ¶ added in v1.0.0
func (app *TerpApp) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*TerpApp) EndBlocker ¶
func (app *TerpApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*TerpApp) ExportAppStateAndValidators ¶
func (app *TerpApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*TerpApp) GetKey ¶ added in v1.0.0
func (app *TerpApp) 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 (*TerpApp) GetMemKey ¶ added in v1.0.0
func (app *TerpApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*TerpApp) GetSubspace ¶ added in v1.0.0
func (app *TerpApp) 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 (*TerpApp) GetTKey ¶ added in v1.0.0
func (app *TerpApp) 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 (*TerpApp) InitChainer ¶
func (app *TerpApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*TerpApp) InterfaceRegistry ¶ added in v1.0.0
func (app *TerpApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns TerpApp's InterfaceRegistry
func (*TerpApp) LegacyAmino ¶
func (app *TerpApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns legacy 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 (*TerpApp) LoadHeight ¶
LoadHeight loads a particular height
func (*TerpApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*TerpApp) RegisterNodeService ¶ added in v1.0.0
func (*TerpApp) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*TerpApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (TerpApp) RegisterUpgradeHandlers ¶ added in v0.4.0
func (app TerpApp) RegisterUpgradeHandlers()
func (*TerpApp) SimulationManager ¶ added in v0.2.0
func (app *TerpApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package params defines the simulation parameters in the gaia.
|
Package params defines the simulation parameters in the gaia. |