app

package
v0.0.0-...-018c514 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 123 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
	EnableSpecificProposals = ""
)
View Source
const (
	// DefaultInstanceCost is initially set the same as in wasmd.
	DefaultInstanceCost uint64 = 60_000
	// DefaultCompileCost set to a large number for testing.
	DefaultCompileCost uint64 = 100
)
View Source
const (
	// Name defines the application binary name.
	Name = "blackfuryd"
)

Variables

View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	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 Quicksilver testing.

View Source
var (
	// DefaultNodeHome default home directories for the application daemon.
	DefaultNodeHome string
)

Functions

func DefaultConfig

func DefaultConfig() network.Config

func GasRegisterConfig

func GasRegisterConfig() wasmkeeper.WasmGasRegisterConfig

GasRegisterConfig is defaults plus a custom compile amount.

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

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions.

func GetWasmOpts

func GetWasmOpts(appOpts servertypes.AppOptions) []wasm.Option

func Init

func Init()

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) sdk.AnteHandler

func NewAppConstructor

func NewAppConstructor(encCfg EncodingConfig) network.AppConstructor

func NewWasmGasRegister

func NewWasmGasRegister() wasmkeeper.WasmGasRegister

func ObservabilityViews

func ObservabilityViews() (views []*view.View)

func SetupTestingApp

func SetupTestingApp() (testApp ibctesting.TestingApp, genesisState map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application.

Types

type EmptyAppOptions

type EmptyAppOptions struct{}

EmptyAppOptions is a stub implementing AppOptions.

func (EmptyAppOptions) Get

func (ao EmptyAppOptions) Get(_ string) interface{}

Get implements AppOptions.

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Marshaler         codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

func MakeEncodingConfig

func MakeEncodingConfig() EncodingConfig

MakeEncodingConfig creates an EncodingConfig for an amino based test configuration.

type GenesisState

type GenesisState map[string]json.RawMessage

The 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 GenesisStateWithValSet

func GenesisStateWithValSet(t *testing.T,
	app *Quicksilver, genesisState GenesisState,
	valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) GenesisState

GenesisStateWithValSet creates a quicksilver genesis state with the given validator set.

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	TxCounterStoreKey storetypes.StoreKey
	WasmConfig        wasmTypes.WasmConfig

	IBCKeeper *ibckeeper.Keeper
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

type Quicksilver

type Quicksilver struct {
	*baseapp.BaseApp
	keepers.AppKeepers
	// contains filtered or unexported fields
}

Quicksilver implements an extended ABCI application.

func GetAppWithContext

func GetAppWithContext(t *testing.T, init bool) (*Quicksilver, sdk.Context)

func NewQuicksilver

func NewQuicksilver(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	skipUpgradeHeights map[int64]bool,
	homePath string,
	invCheckPeriod uint,
	encodingConfig EncodingConfig,
	enabledProposals []wasm.ProposalType,
	appOpts servertypes.AppOptions,
	wasmOpts []wasm.Option,
	mock bool,
	baseAppOptions ...func(*baseapp.BaseApp),
) *Quicksilver

NewQuicksilver returns a reference to a new initialized Quicksilver application.

func Setup

func Setup(t *testing.T, isCheckTx bool) *Quicksilver

Setup initializes a new Quicksilver. A Nop logger is set in Quicksilver.

func (*Quicksilver) AppCodec

func (app *Quicksilver) AppCodec() codec.Codec

AppCodec returns Quicksilver'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 (*Quicksilver) BeginBlocker

func (app *Quicksilver) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker updates every begin block.

func (*Quicksilver) BlockedAddrs

func (app *Quicksilver) BlockedAddrs() map[string]bool

BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.

func (*Quicksilver) DeliverTx

func (app *Quicksilver) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)

DeliverTx calls BaseApp.DeliverTx and calculates transactions per second.

func (*Quicksilver) EndBlocker

func (app *Quicksilver) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker updates every end block.

func (*Quicksilver) ExportAppStateAndValidators

func (app *Quicksilver) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*Quicksilver) GetBaseApp

func (app *Quicksilver) GetBaseApp() *baseapp.BaseApp

GetBaseApp implements the TestingApp interface.

func (*Quicksilver) GetIBCKeeper

func (app *Quicksilver) GetIBCKeeper() *ibckeeper.Keeper

GetIBCKeeper implements the TestingApp interface.

func (*Quicksilver) GetScopedIBCKeeper

func (app *Quicksilver) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper

GetScopedIBCKeeper implements the TestingApp interface.

func (*Quicksilver) GetStakingKeeper

func (app *Quicksilver) GetStakingKeeper() ibctestingtypes.StakingKeeper

GetStakingKeeper implements the TestingApp interface.

func (*Quicksilver) GetSubspace

func (app *Quicksilver) 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 (*Quicksilver) GetTxConfig

func (app *Quicksilver) GetTxConfig() client.TxConfig

GetTxConfig implements the TestingApp interface.

func (*Quicksilver) InitChainer

func (app *Quicksilver) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer updates at chain initialization.

func (*Quicksilver) InterfaceRegistry

func (app *Quicksilver) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns Quicksilver's InterfaceRegistry.

func (*Quicksilver) LegacyAmino

func (app *Quicksilver) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns Quicksilver'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 (*Quicksilver) LoadHeight

func (app *Quicksilver) LoadHeight(height int64) error

LoadHeight loads state at a particular height.

func (*Quicksilver) ModuleAccountAddrs

func (app *Quicksilver) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*Quicksilver) Name

func (app *Quicksilver) Name() string

Name returns the name of the App.

func (*Quicksilver) RegisterAPIRoutes

func (app *Quicksilver) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*Quicksilver) RegisterTendermintService

func (app *Quicksilver) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Quicksilver) RegisterTxService

func (app *Quicksilver) RegisterTxService(clientCtx client.Context)

func (*Quicksilver) SimulationManager

func (app *Quicksilver) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL