Documentation ¶
Index ¶
- Constants
- Variables
- func AddTestAddrsIncremental(app *App, ctx sdk.Context, accNum int, coins sdk.Coins) []sdk.AccAddress
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func GetMaccPerms() map[string][]string
- func MakeTestEncodingConfig() params.EncodingConfig
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func NewTestNetworkFixture() network.TestFixture
- func RegisterNewValidator(t *testing.T, app *App, ctx sdk.Context, val stakingtypes.Validator)
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type App
- func (app *App) AppCodec() codec.Codec
- func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *App) BlockedModuleAccountAddrs() map[string]bool
- func (app *App) DefaultGenesis() map[string]json.RawMessage
- func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app App) GetBaseApp() *baseapp.BaseApp
- func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *App) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *App) InterfaceRegistry() types.InterfaceRegistry
- func (app *App) LegacyAmino() *codec.LegacyAmino
- func (app *App) LoadHeight(height int64) error
- func (app *App) ModuleAccountAddrs() map[string]bool
- func (app *App) Name() string
- func (app *App) RegisterAPIRoutes(apiSvr *api.Server, _ config.APIConfig)
- func (app *App) RegisterNodeService(clientCtx client.Context, config config.Config)
- 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 EmptyAppOptions
- type GenerateAccountStrategy
Constants ¶
const ( AccountAddressPrefix = "alliance" Name = "alliance" )
Variables ¶
var DefaultConsensusParams = tmtypes.ConsensusParams{ Block: tmtypes.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, Evidence: tmtypes.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: tmtypes.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, }
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string )
Functions ¶
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *App, ctx sdk.Context, accNum int, coins sdk.Coins) []sdk.AccAddress
AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func CreateTestPubKeys ¶
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeTestEncodingConfig ¶
func MakeTestEncodingConfig() params.EncodingConfig
func NewPubKeyFromHex ¶
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
func NewTestNetworkFixture ¶
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests
func RegisterNewValidator ¶
Types ¶
type App ¶
type App struct { *baseapp.BaseApp // keepers AccountKeeper authkeeper.AccountKeeper AuthzKeeper authzkeeper.Keeper BankKeeper custombankkeeper.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 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 FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper AllianceKeeper alliancemodulekeeper.Keeper // ModuleManager is the module manager ModuleManager *module.Manager BasicModuleManager module.BasicManager // 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 New ¶
func New( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App
New returns a reference to an initialized blockchain app
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *App
SetupWithGenesisValSet initializes a new SimApp 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 simapp from first genesis account. A Nop logger is set in SimApp.
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 ¶
BeginBlocker application updates every begin block
func (*App) BlockedModuleAccountAddrs ¶
BlockedModuleAccountAddrs returns all the app's blocked module account addresses.
func (*App) DefaultGenesis ¶
func (app *App) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*App) EndBlocker ¶
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) GetBaseApp ¶
GetBaseApp returns the base app of the application
func (*App) GetKey ¶
func (app *App) 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 (*App) GetMemKey ¶
func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*App) GetSubspace ¶
func (app *App) 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 (*App) GetTKey ¶
func (app *App) 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 (*App) InitChainer ¶
func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
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) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
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 EmptyAppOptions ¶
type EmptyAppOptions struct{}
EmptyAppOptions is a stub implementing AppOptions
func (EmptyAppOptions) Get ¶
func (ao EmptyAppOptions) Get(_ string) interface{}
Get implements AppOptions
type GenerateAccountStrategy ¶
type GenerateAccountStrategy func(int) []sdk.AccAddress