Documentation
¶
Index ¶
- Constants
- Variables
- func CheckBalance(t *testing.T, app *BitsongApp, addr sdk.AccAddress, balances sdk.Coins)
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func DefaultConfig() network.Config
- func GetEncodingConfig() params.EncodingConfig
- func GetWasmOpts(appOpts servertypes.AppOptions) []wasm.Option
- func MakeEncodingConfig() params.EncodingConfig
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewAppConstructor(chainId string) network.AppConstructor
- func NewPostHandler(cdc codec.Codec, smartAccountKeeper *smartaccountkeeper.Keeper, ...) sdk.PostHandler
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func SetAddressPrefixes()
- func SignCheckDeliver(t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, ...) (sdk.GasInfo, *sdk.Result, error)
- type BitsongApp
- func InitBitsongAppForTestnet(app *BitsongApp, newValAddr bytes.HexBytes, newValPubKey crypto.PubKey, ...) *BitsongApp
- func NewBitsongApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *BitsongApp
- func Setup(isCheckTx bool) *BitsongApp
- func SetupWithCustomHome(isCheckTx bool, dir string) *BitsongApp
- func SetupWithCustomHomeAndChainId(isCheckTx bool, dir, chainId string) *BitsongApp
- func (app *BitsongApp) AppCodec() codec.Codec
- func (app *BitsongApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *BitsongApp) CustomExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *BitsongApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *BitsongApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *BitsongApp) GetBaseApp() *baseapp.BaseApp
- func (app *BitsongApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *BitsongApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *BitsongApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *BitsongApp) GetSDKStakingKeeper() stakingkeeper.Keeper
- func (app *BitsongApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *BitsongApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
- func (app *BitsongApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *BitsongApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *BitsongApp) GetTxConfig() client.TxConfig
- func (app *BitsongApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *BitsongApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *BitsongApp) LegacyAmino() *codec.LegacyAmino
- func (app *BitsongApp) LoadHeight(height int64) error
- func (app *BitsongApp) ModuleAccountAddrs() map[string]bool
- func (app *BitsongApp) ModuleManager() module.Manager
- func (app *BitsongApp) Name() string
- func (app *BitsongApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *BitsongApp) Precommitter(ctx sdk.Context)
- func (app *BitsongApp) PrepareCheckStater(ctx sdk.Context)
- func (app *BitsongApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *BitsongApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *BitsongApp) RegisterTendermintService(clientCtx client.Context)
- func (app *BitsongApp) RegisterTxService(clientCtx client.Context)
- func (app *BitsongApp) SimulationManager() *module.SimulationManager
- type CosmosApp
- type EmptyAppOptions
- type EmptyBaseAppOptions
- type GenesisState
- type HandlerOptions
- type MinValCommissionDecorator
Constants ¶
const (
SimAppChainID = "testing"
)
DefaultConsensusParams defines the default Tendermint consensus params used in SimApp testing.
Variables ¶
var ( NodeDir = ".bitsongd" Bech32Prefix = "bitsong" EmptyWasmOpts []wasmkeeper.Option // 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) EnableSpecificProposals = "" Upgrades = []upgrades.Upgrade{ v021.Upgrade, v022.Upgrade, v023.Upgrade, } )
We pull these out so we can set them with LDFLAGS in the Makefile
var ( // DefaultNodeHome default home directories for Bitsongd 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 )
var AppModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{ paramsclient.ProposalHandler, fantokenclient.ProposalHandler, }), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, packetforward.AppModuleBasic{}, fantoken.AppModuleBasic{}, wasm.AppModuleBasic{}, icq.AppModuleBasic{}, ibc_hooks.AppModuleBasic{}, cadence.AppModuleBasic{}, ibcwasm.AppModuleBasic{}, smartaccount.AppModuleBasic{}, protocolpool.AppModule{}, )
AppModuleBasics defines the module BasicManager is in charge of setting up basic, non-dependant module elements, such as codec registration and genesis verification.
var DefaultConsensusParams = &tmproto.ConsensusParams{ Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ cmttypes.ABCIPubKeyTypeEd25519, }, }, }
Functions ¶
func CheckBalance ¶ added in v0.14.0
func CheckBalance(t *testing.T, app *BitsongApp, addr sdk.AccAddress, balances sdk.Coins)
func CreateTestPubKeys ¶ added in v0.14.0
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
func DefaultConfig ¶ added in v0.11.0
DefaultConfig returns a default configuration suitable for nearly all testing requirements.
func GetEncodingConfig ¶ added in v0.21.0
func GetEncodingConfig() params.EncodingConfig
func GetWasmOpts ¶ added in v0.13.0
func GetWasmOpts(appOpts servertypes.AppOptions) []wasm.Option
func MakeEncodingConfig ¶ added in v0.8.0
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func NewAnteHandler ¶ added in v0.10.0
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func NewAppConstructor ¶ added in v0.11.0
func NewAppConstructor(chainId string) network.AppConstructor
func NewPostHandler ¶ added in v0.21.0
func NewPostHandler( cdc codec.Codec, smartAccountKeeper *smartaccountkeeper.Keeper, accountKeeper *authkeeper.AccountKeeper, sigModeHandler *txsigning.HandlerMap, ) sdk.PostHandler
func RegisterSwaggerAPI ¶ added in v0.8.0
RegisterSwaggerAPI registers swagger route with API Server
func SetAddressPrefixes ¶ added in v0.19.0
func SetAddressPrefixes()
SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format.
func SignCheckDeliver ¶ added in v0.14.0
func SignCheckDeliver( t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error)
SignCheckDeliver checks a generated signed transaction and simulates a block commitment with the given transaction. A test assertion is made using the parameter 'expPass' against the result. A corresponding result is returned.
Types ¶
type BitsongApp ¶ added in v0.11.0
type BitsongApp struct { *baseapp.BaseApp keepers.AppKeepers // contains filtered or unexported fields }
BitsongApp 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 InitBitsongAppForTestnet ¶ added in v0.21.4
func InitBitsongAppForTestnet(app *BitsongApp, newValAddr bytes.HexBytes, newValPubKey crypto.PubKey, newOperatorAddress, upgradeToTrigger, brokenVals string) *BitsongApp
source: https://github.com/osmosis-labs/osmosis/blob/7b1a78d397b632247fe83f51867f319adf3a858c/app/app.go#L786 one-liner: cd ../bitsong-snapshots && bitsongd comet unsafe-reset-all && cp ~/.bitsongd/data/priv_validator_state.json ~/.bitsongd/priv_validator_state.json && lz4 -c -d <bitsong-snapshot>.tar.lz4 | tar -x -C $HOME/.bitsongd && cp ~/.bitsongd/priv_validator_state.json ~/.bitsongd/data/priv_validator_state.json && cd ../go-bitsong && make install && bitsongd in-place-testnet test1 bitsong1mt3wj088jvurp3vlh2yfar6vqrqp0llnsj8lar bitsongvaloper1qxw4fjged2xve8ez7nu779tm8ejw92rv0vcuqr
func NewBitsongApp ¶
func NewBitsongApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, homePath string, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *BitsongApp
NewBitsongApp returns a reference to an initialized BitsongApp.
func Setup ¶ added in v0.8.0
func Setup(isCheckTx bool) *BitsongApp
Setup initializes a new BitsongApp
func SetupWithCustomHome ¶ added in v0.21.0
func SetupWithCustomHome(isCheckTx bool, dir string) *BitsongApp
SetupWithCustomHome initializes a new BitsongApp with a custom home directory
func SetupWithCustomHomeAndChainId ¶ added in v0.21.0
func SetupWithCustomHomeAndChainId(isCheckTx bool, dir, chainId string) *BitsongApp
func (*BitsongApp) AppCodec ¶ added in v0.11.0
func (app *BitsongApp) AppCodec() codec.Codec
AppCodec returns Bitsong'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 (*BitsongApp) BeginBlocker ¶ added in v0.11.0
func (app *BitsongApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker application updates every begin block
func (*BitsongApp) CustomExportAppStateAndValidators ¶ added in v0.22.0
func (app *BitsongApp) CustomExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
- validator slash event:
- historical reference:
x/slashing:
- validator signing info:
- historical reference:
func (*BitsongApp) EndBlocker ¶ added in v0.11.0
EndBlocker application updates every end block
func (*BitsongApp) ExportAppStateAndValidators ¶ added in v0.11.0
func (app *BitsongApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*BitsongApp) GetBaseApp ¶ added in v0.21.0
func (app *BitsongApp) GetBaseApp() *baseapp.BaseApp
func (*BitsongApp) GetIBCKeeper ¶ added in v0.21.0
func (app *BitsongApp) GetIBCKeeper() *ibckeeper.Keeper
func (*BitsongApp) GetKey ¶ added in v0.11.0
func (app *BitsongApp) 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 (*BitsongApp) GetMemKey ¶ added in v0.11.0
func (app *BitsongApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*BitsongApp) GetSDKStakingKeeper ¶ added in v0.21.0
func (app *BitsongApp) GetSDKStakingKeeper() stakingkeeper.Keeper
func (*BitsongApp) GetScopedIBCKeeper ¶ added in v0.21.0
func (app *BitsongApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
func (*BitsongApp) GetStakingKeeper ¶ added in v0.21.0
func (app *BitsongApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
used for ibctesting with bitsongs simulation app
func (*BitsongApp) GetSubspace ¶ added in v0.11.0
func (app *BitsongApp) 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 (*BitsongApp) GetTKey ¶ added in v0.11.0
func (app *BitsongApp) 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 (*BitsongApp) GetTxConfig ¶ added in v0.21.0
func (app *BitsongApp) GetTxConfig() client.TxConfig
func (*BitsongApp) InitChainer ¶ added in v0.11.0
func (app *BitsongApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*BitsongApp) InterfaceRegistry ¶ added in v0.11.0
func (app *BitsongApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Bitsong's InterfaceRegistry
func (*BitsongApp) LegacyAmino ¶ added in v0.11.0
func (app *BitsongApp) 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 (*BitsongApp) LoadHeight ¶ added in v0.11.0
func (app *BitsongApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*BitsongApp) ModuleAccountAddrs ¶ added in v0.11.0
func (app *BitsongApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*BitsongApp) ModuleManager ¶ added in v0.21.0
func (app *BitsongApp) ModuleManager() module.Manager
func (*BitsongApp) Name ¶ added in v0.11.0
func (app *BitsongApp) Name() string
Name returns the name of the App
func (*BitsongApp) PreBlocker ¶ added in v0.21.0
func (app *BitsongApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates before each begin block.
func (*BitsongApp) Precommitter ¶ added in v0.21.0
func (app *BitsongApp) Precommitter(ctx sdk.Context)
Precommitter application updates before the commital of a block after all transactions have been delivered.
func (*BitsongApp) PrepareCheckStater ¶ added in v0.21.0
func (app *BitsongApp) PrepareCheckStater(ctx sdk.Context)
func (*BitsongApp) RegisterAPIRoutes ¶ added in v0.11.0
func (app *BitsongApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all app module routes with the provided API server.
func (*BitsongApp) RegisterNodeService ¶ added in v0.16.0
func (app *BitsongApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
RegisterNodeService implements the Application.RegisterNodeService method.
func (*BitsongApp) RegisterTendermintService ¶ added in v0.11.0
func (app *BitsongApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*BitsongApp) RegisterTxService ¶ added in v0.11.0
func (app *BitsongApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*BitsongApp) SimulationManager ¶ added in v0.11.0
func (app *BitsongApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type CosmosApp ¶ added in v0.8.0
type CosmosApp interface { // Name The assigned name of the app. Name() string // LegacyAmino The application types codec. // NOTE: This shoult be sealed before being returned. LegacyAmino() *codec.LegacyAmino // BeginBlocker Application updates every begin block. BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) // EndBlocker Application updates every end block. EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) // InitChainer Application update at chain (i.e app) initialization. InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) // LoadHeight Loads the app at a given height. LoadHeight(height int64) error // ExportAppStateAndValidators Exports the state of the application for a genesis file. ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (types.ExportedApp, error) // ModuleAccountAddrs All the registered module account addreses. ModuleAccountAddrs() map[string]bool }
CosmosApp implements the common methods for a Cosmos SDK-based application specific blockchain.
type EmptyAppOptions ¶ added in v0.14.0
type EmptyAppOptions struct{}
EmptyAppOptions is a stub implementing AppOptions
func (EmptyAppOptions) Get ¶ added in v0.14.0
func (ao EmptyAppOptions) Get(o string) interface{}
Get implements AppOptions
type EmptyBaseAppOptions ¶ added in v0.19.0
type EmptyBaseAppOptions struct{}
EmptyBaseAppOptions is a stub implementing AppOptions
func (EmptyBaseAppOptions) Get ¶ added in v0.19.0
func (ao EmptyBaseAppOptions) Get(_ string) interface{}
Get implements AppOptions
type GenesisState ¶ added in v0.5.0
type GenesisState map[string]json.RawMessage
The genesis state 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 GenesisStateWithValSet ¶ added in v0.20.2
func GenesisStateWithValSet(app *BitsongApp) GenesisState
func NewDefaultGenesisState ¶ added in v0.5.0
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for bitsong.
func NewDefaultGenesisStateWithCodec ¶ added in v0.14.0
func NewDefaultGenesisStateWithCodec(cdc codec.JSONCodec) GenesisState
type HandlerOptions ¶ added in v0.10.0
type HandlerOptions struct { ante.HandlerOptions SmartAccount *smartaccountkeeper.Keeper GovKeeper govkeeper.Keeper IBCKeeper *ibckeeper.Keeper TxCounterStoreKey corestoretypes.KVStoreService WasmConfig wasmTypes.WasmConfig Cdc codec.Codec TxEncoder sdk.TxEncoder }
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.
type MinValCommissionDecorator ¶ added in v0.10.0
type MinValCommissionDecorator struct {
// contains filtered or unexported fields
}
func NewMinValCommissionDecorator ¶ added in v0.10.0
func NewMinValCommissionDecorator(cdc codec.BinaryCodec) MinValCommissionDecorator