consumer

package
v0.0.0-...-b507993 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 149 Imported by: 1

Documentation

Index

Constants

View Source
const UpgradeName = "v046-to-v047"

UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade from v046 to v047.

NOTE: This upgrade defines a reference implementation of what an upgrade could look like when an application is migrating from Cosmos SDK version v0.46.x to v0.47.x.

Variables

View Source
var (
	NodeDir      = ".meshproviderd"
	Bech32Prefix = "mesh"
)

We pull these out so we can set them with LDFLAGS in the Makefile

View Source
var (
	// DefaultNodeHome default home directories for wasmd
	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
)

These constants are derived from the above variables. These are the ones we will want to use in the code, based on any overrides above

Functions

func AddTestAddrsIncremental

func AddTestAddrsIncremental(app *MeshProviderApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress

AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order

func BlockedAddresses

func BlockedAddresses() map[string]bool

BlockedAddresses returns all the app's blocked account addresses.

func GenesisStateWithValSet

func GenesisStateWithValSet(
	codec codec.Codec,
	genesisState map[string]json.RawMessage,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) (map[string]json.RawMessage, error)

GenesisStateWithValSet returns a new genesis state with the validator set copied from simtestutil with delegation not added to supply

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

NOTE: This is solely to be used for testing purposes.

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates a new EncodingConfig with all modules registered

func ModuleAccountAddrs

func ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs provides a list of blocked module accounts from configuration in AppConfig

Ported from MeshProviderApp

func NewTestNetworkFixture

func NewTestNetworkFixture() network.TestFixture

NewTestNetworkFixture returns a new MeshProviderApp AppConstructor for network simulation tests

func SignAndDeliverWithoutCommit

func SignAndDeliverWithoutCommit(
	t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, fees sdk.Coins,
	chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error)

SignAndDeliverWithoutCommit signs and delivers a transaction. No commit

Types

type GenesisState

type GenesisState map[string]json.RawMessage

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 GenesisStateWithSingleValidator

func GenesisStateWithSingleValidator(t *testing.T, app *MeshProviderApp) GenesisState

GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

type MeshProviderApp

type MeshProviderApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.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
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	GroupKeeper           groupkeeper.Keeper
	NFTKeeper             nftkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper

	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCFeeKeeper        ibcfeekeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICAHostKeeper       icahostkeeper.Keeper
	TransferKeeper      ibctransferkeeper.Keeper
	WasmKeeper          wasmkeeper.Keeper
	MeshSecKeeper       *meshseckeeper.Keeper
	MeshSecProvKeeper   *meshsecprovkeeper.Keeper

	ScopedIBCKeeper           capabilitykeeper.ScopedKeeper
	ScopedICAHostKeeper       capabilitykeeper.ScopedKeeper
	ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper      capabilitykeeper.ScopedKeeper
	ScopedIBCFeeKeeper        capabilitykeeper.ScopedKeeper
	ScopedWasmKeeper          capabilitykeeper.ScopedKeeper

	// the module manager
	ModuleManager *module.Manager
	// contains filtered or unexported fields
}

MeshProviderApp extended ABCI application

func NewMeshProviderApp

func NewMeshProviderApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	wasmOpts []wasmkeeper.Option,
	baseAppOptions ...func(*baseapp.BaseApp),
) *MeshProviderApp

NewMeshProviderApp returns a reference to an initialized MeshProviderApp.

func NewMeshProviderAppWithCustomOptions

func NewMeshProviderAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *MeshProviderApp

NewMeshProviderAppWithCustomOptions initializes a new MeshProviderApp with custom options.

func Setup

func Setup(t *testing.T, opts ...wasmkeeper.Option) *MeshProviderApp

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

func SetupWithEmptyStore

func SetupWithEmptyStore(t testing.TB) *MeshProviderApp

SetupWithEmptyStore set up a wasmd app instance with empty DB

func SetupWithGenesisValSet

func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasmkeeper.Option, balances ...banktypes.Balance) *MeshProviderApp

SetupWithGenesisValSet initializes a new MeshProviderApp 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 MeshProviderApp from first genesis account. A Nop logger is set in MeshProviderApp.

func (*MeshProviderApp) AppCodec

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

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

BeginBlocker application updates every begin block

func (*MeshProviderApp) Configurator

func (app *MeshProviderApp) Configurator() module.Configurator

func (*MeshProviderApp) DefaultGenesis

func (app *MeshProviderApp) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns a default genesis from the registered AppModuleBasic's.

func (*MeshProviderApp) EndBlocker

EndBlocker application updates every end block

func (*MeshProviderApp) ExportAppStateAndValidators

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

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

func (*MeshProviderApp) GetAccountKeeper

func (app *MeshProviderApp) GetAccountKeeper() authkeeper.AccountKeeper

func (*MeshProviderApp) GetBankKeeper

func (app *MeshProviderApp) GetBankKeeper() bankkeeper.Keeper

func (*MeshProviderApp) GetBaseApp

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

func (*MeshProviderApp) GetIBCKeeper

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

func (*MeshProviderApp) GetKey

func (app *MeshProviderApp) 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 (*MeshProviderApp) GetMemKey

func (app *MeshProviderApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*MeshProviderApp) GetScopedIBCKeeper

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

func (*MeshProviderApp) GetStakingKeeper

func (app *MeshProviderApp) GetStakingKeeper() *stakingkeeper.Keeper

func (*MeshProviderApp) GetSubspace

func (app *MeshProviderApp) 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 (*MeshProviderApp) GetTKey

func (app *MeshProviderApp) 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 (*MeshProviderApp) GetWasmKeeper

func (app *MeshProviderApp) GetWasmKeeper() wasmkeeper.Keeper

func (*MeshProviderApp) InitChainer

InitChainer application update at chain initialization

func (*MeshProviderApp) InterfaceRegistry

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

InterfaceRegistry returns MeshProviderApp's InterfaceRegistry

func (*MeshProviderApp) LegacyAmino

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

LegacyAmino returns legacy 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 (*MeshProviderApp) LoadHeight

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

LoadHeight loads a particular height

func (*MeshProviderApp) Name

func (app *MeshProviderApp) Name() string

Name returns the name of the App

func (*MeshProviderApp) RegisterAPIRoutes

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

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

func (*MeshProviderApp) RegisterNodeService

func (app *MeshProviderApp) RegisterNodeService(clientCtx client.Context)

func (*MeshProviderApp) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*MeshProviderApp) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (MeshProviderApp) RegisterUpgradeHandlers

func (app MeshProviderApp) RegisterUpgradeHandlers()

func (*MeshProviderApp) SimulationManager

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

SimulationManager implements the SimulationApp interface

func (*MeshProviderApp) TxConfig

func (app *MeshProviderApp) TxConfig() client.TxConfig

TxConfig returns MeshProviderApp's TxConfig

type SetupOptions

type SetupOptions struct {
	Logger   log.Logger
	DB       *dbm.MemDB
	AppOpts  servertypes.AppOptions
	WasmOpts []wasmkeeper.Option
}

SetupOptions defines arguments that are passed into `MeshProviderApp` constructor.

Jump to

Keyboard shortcuts

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