Documentation ¶
Index ¶
- Constants
- Variables
- func AddCoinsToAccount(moduleName string, bankKeeper keeper.Keeper, ctx sdk.Context, ...) error
- func AddTestAddrs(app *SifchainApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateRandomAccounts(accNum int) []sdk.AccAddress
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func ExportAppState(name string, app *SifchainApp, ctx sdk.Context)
- func GetMaccPerms() map[string][]string
- func MakeTestEncodingConfig() simappparams.EncodingConfig
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func SetConfig(seal bool)
- func SetupHandlers(app *SifchainApp)
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type EmptyAppOptions
- type GenerateAccountStrategy
- type GenesisState
- type SifchainApp
- func NewSifApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *SifchainApp
- func NewSifAppWithBlacklist(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *SifchainApp
- func Setup(isCheckTx bool) *SifchainApp
- func SetupFromGenesis(isCheckTx bool, ...) *SifchainApp
- func SetupWithBlacklist(isCheckTx bool, blacklist []sdk.AccAddress) *SifchainApp
- func (app *SifchainApp) AppCodec() codec.Codec
- func (app *SifchainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *SifchainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *SifchainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *SifchainApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *SifchainApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
- func (app *SifchainApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *SifchainApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *SifchainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *SifchainApp) LegacyAmino() *codec.LegacyAmino
- func (app *SifchainApp) LoadHeight(height int64) error
- func (app *SifchainApp) ModuleAccountAddrs() map[string]bool
- func (app *SifchainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *SifchainApp) RegisterTendermintService(clientCtx client.Context)
- func (app *SifchainApp) RegisterTxService(clientCtx client.Context)
- func (app *SifchainApp) SimulationManager() *module.SimulationManager
Constants ¶
const (
AccountAddressPrefix = "sif"
)
Variables ¶
var ( DefaultNodeHome = os.ExpandEnv("$HOME/.sifnoded") ModuleBasics = module.NewBasicManager(genutil.AppModuleBasic{}, auth.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, crisis.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, ), params.AppModuleBasic{}, upgrade.AppModuleBasic{}, slashing.AppModuleBasic{}, evidence.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctransferoverride.AppModuleBasic{}, clp.AppModuleBasic{}, margin.AppModuleBasic{}, oracle.AppModuleBasic{}, ethbridge.AppModuleBasic{}, dispensation.AppModuleBasic{}, tokenregistry.AppModuleBasic{}, admin.AppModuleBasic{}, vesting.AppModuleBasic{}, epochs.AppModuleBasic{}, ) )
var ( AccountPubKeyPrefix = AccountAddressPrefix + "pub" ValidatorAddressPrefix = AccountAddressPrefix + "valoper" ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" )
var DefaultConsensusParams = &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, }
DefaultConsensusParams defines the default Tendermint consensus params used in SimApp testing.
Functions ¶
func AddCoinsToAccount ¶ added in v0.10.1
func AddCoinsToAccount(moduleName string, bankKeeper keeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, initCoins sdk.Coins) error
AddCoinsToAccount initializes an account with balance based on initCoins.
func AddTestAddrs ¶
func AddTestAddrs(app *SifchainApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
AddTestAddrs constructs and returns accNum amount of accounts with initial balance of accAmt in random order
func ConvertAddrsToValAddrs ¶
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
func CreateRandomAccounts ¶
func CreateRandomAccounts(accNum int) []sdk.AccAddress
CreateRandomAccounts is a strategy used by addTestAddrs() in order to generated addresses in random order.
func CreateTestPubKeys ¶
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func ExportAppState ¶
func ExportAppState(name string, app *SifchainApp, ctx sdk.Context)
ExportAppState exports the validator set and application state into two different files
func GetMaccPerms ¶
func MakeTestEncodingConfig ¶
func MakeTestEncodingConfig() simappparams.EncodingConfig
MakeTestEncodingConfig creates an EncodingConfig for testing. This function should be used only internally (in the SDK). App user should'nt create new codecs - use the app.AppCodec instead. [DEPRECATED]
func NewPubKeyFromHex ¶
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func SetupHandlers ¶
func SetupHandlers(app *SifchainApp)
Types ¶
type EmptyAppOptions ¶
type EmptyAppOptions struct{}
EmptyAppOptions is a stub implementing AppOptions
func (EmptyAppOptions) Get ¶
func (ao EmptyAppOptions) Get(o string) interface{}
Get implements AppOptions
type GenerateAccountStrategy ¶
type GenerateAccountStrategy func(int) []sdk.AccAddress
type GenesisState ¶
type GenesisState map[string]json.RawMessage
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.Codec) GenesisState
type SifchainApp ¶
type SifchainApp struct { *baseapp.BaseApp AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper ParamsKeeper paramskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly TransferKeeper ibctransferkeeper.Keeper PortKeeper ibcmock.PortKeeper FeegrantKeeper feegrantkeeper.Keeper AuthzKeeper authzkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedIBCMockKeeper capabilitykeeper.ScopedKeeper ClpKeeper clpkeeper.Keeper MarginKeeper marginkeeper.Keeper OracleKeeper oraclekeeper.Keeper EthbridgeKeeper ethbridgekeeper.Keeper DispensationKeeper dispkeeper.Keeper TokenRegistryKeeper tokenregistrytypes.Keeper AdminKeeper adminkeeper.Keeper EpochsKeeper epochskeeper.Keeper // contains filtered or unexported fields }
func NewSifApp ¶
func NewSifApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *SifchainApp
func NewSifAppWithBlacklist ¶ added in v0.13.4
func NewSifAppWithBlacklist( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, blackListedAddresses []sdk.AccAddress, baseAppOptions ...func(*baseapp.BaseApp), ) *SifchainApp
func Setup ¶
func Setup(isCheckTx bool) *SifchainApp
Setup initializes a new SimApp. A Nop logger is set in SimApp.
func SetupFromGenesis ¶ added in v0.13.0
func SetupFromGenesis(isCheckTx bool, genesisTransformer func(*SifchainApp, GenesisState) GenesisState) *SifchainApp
func SetupWithBlacklist ¶ added in v0.13.4
func SetupWithBlacklist(isCheckTx bool, blacklist []sdk.AccAddress) *SifchainApp
Setup initializes a new SimApp. A Nop logger is set in SimApp.
func (*SifchainApp) AppCodec ¶
func (app *SifchainApp) AppCodec() codec.Codec
AppCodec returns SimApp'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 (*SifchainApp) BeginBlocker ¶
func (app *SifchainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
func (*SifchainApp) EndBlocker ¶
func (app *SifchainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
func (*SifchainApp) ExportAppStateAndValidators ¶
func (app *SifchainApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*SifchainApp) GetKey ¶
func (app *SifchainApp) GetKey(storeKey string) *sdk.KVStoreKey
func (*SifchainApp) GetMemKey ¶
func (app *SifchainApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*SifchainApp) GetSubspace ¶
func (app *SifchainApp) 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 (*SifchainApp) GetTKey ¶
func (app *SifchainApp) GetTKey(storeKey string) *sdk.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*SifchainApp) InitChainer ¶
func (app *SifchainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
func (*SifchainApp) LegacyAmino ¶
func (app *SifchainApp) LegacyAmino() *codec.LegacyAmino
func (*SifchainApp) LoadHeight ¶
func (app *SifchainApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*SifchainApp) ModuleAccountAddrs ¶
func (app *SifchainApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*SifchainApp) RegisterAPIRoutes ¶
func (app *SifchainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*SifchainApp) RegisterTendermintService ¶
func (app *SifchainApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*SifchainApp) RegisterTxService ¶
func (app *SifchainApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*SifchainApp) SimulationManager ¶
func (app *SifchainApp) SimulationManager() *module.SimulationManager