Documentation
¶
Index ¶
- Constants
- Variables
- func AddCoinsToAccount(moduleName string, bankKeeper keeper.Keeper, ctx sdk.Context, ...) error
- func AddTestAddrs(app *GridironchainApp, 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 *GridironchainApp, 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 *GridironchainApp)
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type EmptyAppOptions
- type GenerateAccountStrategy
- type GenesisState
- type GridironchainApp
- func NewGridApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *GridironchainApp
- func NewGridAppWithBlacklist(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *GridironchainApp
- func Setup(isCheckTx bool) *GridironchainApp
- func SetupFromGenesis(isCheckTx bool, ...) *GridironchainApp
- func SetupWithBlacklist(isCheckTx bool, blacklist []sdk.AccAddress) *GridironchainApp
- func (app *GridironchainApp) AppCodec() codec.Codec
- func (app *GridironchainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *GridironchainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *GridironchainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *GridironchainApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *GridironchainApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
- func (app *GridironchainApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *GridironchainApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *GridironchainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *GridironchainApp) LegacyAmino() *codec.LegacyAmino
- func (app *GridironchainApp) LoadHeight(height int64) error
- func (app *GridironchainApp) ModuleAccountAddrs() map[string]bool
- func (app *GridironchainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *GridironchainApp) RegisterTendermintService(clientCtx client.Context)
- func (app *GridironchainApp) RegisterTxService(clientCtx client.Context)
- func (app *GridironchainApp) SimulationManager() *module.SimulationManager
Constants ¶
const (
AccountAddressPrefix = "grid"
)
Variables ¶
var ( DefaultNodeHome = os.ExpandEnv("$HOME/.gridnoded") 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{}, ) )
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 ¶
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 *GridironchainApp, 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 *GridironchainApp, 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 *GridironchainApp)
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 GridironchainApp ¶
type GridironchainApp 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
// contains filtered or unexported fields
}
func NewGridApp ¶
func NewGridApp( 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), ) *GridironchainApp
func NewGridAppWithBlacklist ¶
func NewGridAppWithBlacklist( 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), ) *GridironchainApp
func Setup ¶
func Setup(isCheckTx bool) *GridironchainApp
Setup initializes a new SimApp. A Nop logger is set in SimApp.
func SetupFromGenesis ¶
func SetupFromGenesis(isCheckTx bool, genesisTransformer func(*GridironchainApp, GenesisState) GenesisState) *GridironchainApp
func SetupWithBlacklist ¶
func SetupWithBlacklist(isCheckTx bool, blacklist []sdk.AccAddress) *GridironchainApp
Setup initializes a new SimApp. A Nop logger is set in SimApp.
func (*GridironchainApp) AppCodec ¶
func (app *GridironchainApp) 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 (*GridironchainApp) BeginBlocker ¶
func (app *GridironchainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
func (*GridironchainApp) EndBlocker ¶
func (app *GridironchainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
func (*GridironchainApp) ExportAppStateAndValidators ¶
func (app *GridironchainApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*GridironchainApp) GetKey ¶
func (app *GridironchainApp) GetKey(storeKey string) *sdk.KVStoreKey
func (*GridironchainApp) GetMemKey ¶
func (app *GridironchainApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*GridironchainApp) GetSubspace ¶
func (app *GridironchainApp) 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 (*GridironchainApp) GetTKey ¶
func (app *GridironchainApp) 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 (*GridironchainApp) InitChainer ¶
func (app *GridironchainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
func (*GridironchainApp) LegacyAmino ¶
func (app *GridironchainApp) LegacyAmino() *codec.LegacyAmino
func (*GridironchainApp) LoadHeight ¶
func (app *GridironchainApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*GridironchainApp) ModuleAccountAddrs ¶
func (app *GridironchainApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*GridironchainApp) RegisterAPIRoutes ¶
func (app *GridironchainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*GridironchainApp) RegisterTendermintService ¶
func (app *GridironchainApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*GridironchainApp) RegisterTxService ¶
func (app *GridironchainApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*GridironchainApp) SimulationManager ¶
func (app *GridironchainApp) SimulationManager() *module.SimulationManager