Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
- func InitGenesis(ctx sdk.Context, keeper *Keeper, data types.GenesisState, ...) ([]abci.ValidatorUpdate, error)
- func MakeEncodingConfig(_ testing.TB) appparams.EncodingConfig
- func ModuleLogger(ctx sdk.Context) log.Logger
- func NewProposalHandler(k Keeper) govtypes.Handler
- func NewProposalHandlerX(k govKeeper, wasmProposalHandler govtypes.Handler) govtypes.Handler
- func NewWasmVMMock(mutators ...func(*wasmtesting.MockWasmer)) *wasmtesting.MockWasmer
- func RandomAddress(_ *testing.T) sdk.AccAddress
- func WasmQuerier(k *Keeper) wasmtypes.QueryServer
- type ConsensusParamsUpdater
- type IBCStakingKeeperMock
- type Keeper
- func (k Keeper) ExistsAnyPrivilegedContract(ctx sdk.Context, privilegeType types.PrivilegeType) bool
- func (k Keeper) GetContractKeeper() wasmtypes.ContractOpsKeeper
- func (k Keeper) HasPrivilegedContract(ctx sdk.Context, contractAddr sdk.AccAddress, ...) (bool, error)
- func (k Keeper) IsPrivileged(ctx sdk.Context, contractAddr sdk.AccAddress) bool
- func (k Keeper) IteratePrivileged(ctx sdk.Context, cb func(sdk.AccAddress) bool)
- func (k Keeper) IteratePrivilegedContractsByType(ctx sdk.Context, privilegeType types.PrivilegeType, ...)
- func (Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetPrivileged(ctx sdk.Context, contractAddr sdk.AccAddress) error
- func (k Keeper) UnsetPrivileged(ctx sdk.Context, contractAddr sdk.AccAddress) error
- type Querier
- func (q Querier) ContractsByPrivilegeType(c context.Context, req *types.QueryContractsByPrivilegeTypeRequest) (*types.QueryContractsByPrivilegeTypeResponse, error)
- func (q Querier) PrivilegedContracts(c context.Context, _ *types.QueryPrivilegedContractsRequest) (*types.QueryPrivilegedContractsResponse, error)
- type TestKeepers
- type TgradeHandler
- type TgradeWasmHandlerKeeper
Constants ¶
This section is empty.
Variables ¶
var TestingStakeParams = stakingtypes.Params{
UnbondingTime: 100,
MaxValidators: 10,
MaxEntries: 10,
HistoricalEntries: 10,
BondDenom: "stake",
}
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func InitGenesis ¶
func InitGenesis( ctx sdk.Context, keeper *Keeper, data types.GenesisState, msgHandler sdk.Handler, ) ([]abci.ValidatorUpdate, error)
InitGenesis sets supply information for genesis.
CONTRACT: all types of accounts must have been already initialized/created
func MakeEncodingConfig ¶
func MakeEncodingConfig(_ testing.TB) appparams.EncodingConfig
func NewProposalHandler ¶
NewProposalHandler creates a new governance Handler for wasm proposals
func NewProposalHandlerX ¶
NewProposalHandlerX creates a new governance Handler for wasm proposals
func NewWasmVMMock ¶
func NewWasmVMMock(mutators ...func(*wasmtesting.MockWasmer)) *wasmtesting.MockWasmer
NewWasmVMMock creates a new WasmerEngine mock with basic ops for create/instantiation set to noops.
func RandomAddress ¶
func RandomAddress(_ *testing.T) sdk.AccAddress
func WasmQuerier ¶
func WasmQuerier(k *Keeper) wasmtypes.QueryServer
Types ¶
type ConsensusParamsUpdater ¶
type ConsensusParamsUpdater interface { GetConsensusParams(ctx sdk.Context) *abci.ConsensusParams StoreConsensusParams(ctx sdk.Context, cp *abci.ConsensusParams) }
ConsensusParamsUpdater is a subset of baseapp to store the consensus params
type IBCStakingKeeperMock ¶
type IBCStakingKeeperMock struct { GetHistoricalInfoFn func(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) UnbondingTimeFn func(ctx sdk.Context) time.Duration }
func (IBCStakingKeeperMock) GetHistoricalInfo ¶
func (m IBCStakingKeeperMock) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
func (IBCStakingKeeperMock) UnbondingTime ¶
func (m IBCStakingKeeperMock) UnbondingTime(ctx sdk.Context) time.Duration
type Keeper ¶
type Keeper struct { wasmkeeper.Keeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper wasmtypes.AccountKeeper, bankKeeper wasmtypes.BankKeeper, stakingKeeper wasmtypes.StakingKeeper, distKeeper wasmtypes.DistributionKeeper, channelKeeper wasmtypes.ChannelKeeper, portKeeper wasmtypes.PortKeeper, capabilityKeeper wasmtypes.CapabilityKeeper, portSource wasmtypes.ICS20TransferPortSource, router wasmkeeper.MessageRouter, queryRouter wasmkeeper.GRPCQueryRouter, govRouter govtypes.Router, homeDir string, twasmConfig types.TWasmConfig, availableCapabilities string, opts ...wasmkeeper.Option, ) Keeper
func (Keeper) ExistsAnyPrivilegedContract ¶
func (k Keeper) ExistsAnyPrivilegedContract(ctx sdk.Context, privilegeType types.PrivilegeType) bool
ExistsAnyPrivilegedContract returns if any contract is registered for the given type
func (Keeper) GetContractKeeper ¶
func (k Keeper) GetContractKeeper() wasmtypes.ContractOpsKeeper
GetContractKeeper returns the contract keeper instance with default permissions set
func (Keeper) HasPrivilegedContract ¶
func (k Keeper) HasPrivilegedContract(ctx sdk.Context, contractAddr sdk.AccAddress, privilegeType types.PrivilegeType) (bool, error)
HasPrivilegedContract returns if the contract has the given privilege type registered. Returns error for unknown contract addresses.
func (Keeper) IsPrivileged ¶
IsPrivileged returns if a contract has the privileges flag set.
func (Keeper) IteratePrivileged ¶
IteratePrivileged iterates through the list of privileged contacts by type and position ASC
func (Keeper) IteratePrivilegedContractsByType ¶
func (k Keeper) IteratePrivilegedContractsByType(ctx sdk.Context, privilegeType types.PrivilegeType, cb func(prio uint8, contractAddr sdk.AccAddress) bool)
IteratePrivilegedContractsByType iterates through all contracts for the given type by position and address ASC
func (Keeper) SetPrivileged ¶
SetPrivileged does - pin to cache - set privileged flag - call Sudo with PrivilegeChangeMsg{Promoted{}}
func (Keeper) UnsetPrivileged ¶
UnsetPrivileged does: - call Sudo with PrivilegeChangeMsg{Demoted{}} - remove contract from cache - remove privileged flag - remove all privileges for the contract
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
func NewQuerier ¶
func NewQuerier(keeper queryKeeper) *Querier
func (Querier) ContractsByPrivilegeType ¶
func (q Querier) ContractsByPrivilegeType(c context.Context, req *types.QueryContractsByPrivilegeTypeRequest) (*types.QueryContractsByPrivilegeTypeResponse, error)
func (Querier) PrivilegedContracts ¶
func (q Querier) PrivilegedContracts(c context.Context, _ *types.QueryPrivilegedContractsRequest) (*types.QueryPrivilegedContractsResponse, error)
type TestKeepers ¶
type TestKeepers struct { AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper GovKeeper govkeeper.Keeper TWasmKeeper *Keeper IBCKeeper *ibckeeper.Keeper Router wasmkeeper.MessageRouter Faucet *wasmkeeper.TestFaucet }
func CreateDefaultTestInput ¶
func CreateDefaultTestInput(t *testing.T, opts ...wasmkeeper.Option) (sdk.Context, TestKeepers)
CreateDefaultTestInput common settings for CreateTestInput
func CreateTestInput ¶
func CreateTestInput(t *testing.T, isCheckTx bool, supportedFeatures string, opts ...wasmkeeper.Option) (sdk.Context, TestKeepers)
CreateTestInput encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default)
type TgradeHandler ¶
type TgradeHandler struct {
// contains filtered or unexported fields
}
TgradeHandler is a custom message handler plugin for wasmd.
func NewTgradeHandler ¶
func NewTgradeHandler( cdc codec.Codec, keeper TgradeWasmHandlerKeeper, bankKeeper bankKeeper, consensusParamsUpdater ConsensusParamsUpdater, govRouter govtypes.Router, ) *TgradeHandler
NewTgradeHandler constructor
func (TgradeHandler) DispatchMsg ¶
func (h TgradeHandler) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ string, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, error)
DispatchMsg handles wasmVM message for privileged contracts
type TgradeWasmHandlerKeeper ¶
type TgradeWasmHandlerKeeper interface { IsPrivileged(ctx sdk.Context, contract sdk.AccAddress) bool GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) *wasmtypes.ContractInfo // contains filtered or unexported methods }
TgradeWasmHandlerKeeper defines a subset of Keeper