Documentation ¶
Index ¶
- Variables
- func DeterministicAccountAddress(_ testing.TB, v byte) sdk.AccAddress
- func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
- func GenerateSortedBech32Address(addrs ...[]byte) []string
- func InitGenesis(ctx sdk.Context, keeper *Keeper, data types.GenesisState, ...) ([]abci.ValidatorUpdate, error)
- func MakeEncodingConfig(_ testing.TB) wasmappparams.EncodingConfig
- func MakeTestCodec(t testing.TB) codec.Codec
- func ModuleLogger(ctx sdk.Context) log.Logger
- func NewMsgServerImpl(k wasmtypes.ContractOpsKeeper) types.MsgServer
- func NewWasmProposalHandler(k *Keeper, enabledProposalType []wasmtypes.ProposalType) govtypes.Handler
- func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []wasmtypes.ProposalType) govtypes.Handler
- func Querier(k *Keeper) types.QueryServer
- func RandomAccountAddress(_ testing.TB) sdk.AccAddress
- func RandomBech32AccountAddress(t testing.TB) string
- func TestHandler(k types.ContractOpsKeeper) sdk.Handler
- func WasmQuerier(k *Keeper) wasmtypes.QueryServer
- type BurnerExampleInitMsg
- type ExampleContract
- func StoreBurnerExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
- func StoreExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers, wasmFile string) ExampleContract
- func StoreHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
- func StoreIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
- func StoreReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
- type ExampleContractInstance
- type ExampleInstance
- type HackatomExampleInitMsg
- type HackatomExampleInstance
- type IBCReflectExampleInstance
- type IBCReflectInitMsg
- type Keeper
- type PermissionedKeeper
- func (p PermissionedKeeper) ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error
- func (p PermissionedKeeper) ClearContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress) error
- func (p PermissionedKeeper) DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error
- func (p PermissionedKeeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, ...) ([]byte, error)
- func (p PermissionedKeeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, ...) ([]byte, error)
- func (p PermissionedKeeper) UpdateContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, ...) error
- type TestKeepers
Constants ¶
This section is empty.
Variables ¶
var TestingStakeParams = stakingtypes.Params{
UnbondingTime: 100,
MaxValidators: 10,
MaxEntries: 10,
HistoricalEntries: 10,
BondDenom: "stake",
}
Functions ¶
func DeterministicAccountAddress ¶
func DeterministicAccountAddress(_ testing.TB, v byte) sdk.AccAddress
DeterministicAccountAddress creates a test address with v repeated to valid address size
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func GenerateSortedBech32Address ¶ added in v0.2.0
func InitGenesis ¶
func InitGenesis( ctx sdk.Context, keeper *Keeper, data types.GenesisState, stakingKeeper wasmkeeper.ValidatorSetSource, msgHandler sdk.Handler, ) ([]abci.ValidatorUpdate, error)
func MakeEncodingConfig ¶
func MakeEncodingConfig(_ testing.TB) wasmappparams.EncodingConfig
func NewMsgServerImpl ¶
func NewMsgServerImpl(k wasmtypes.ContractOpsKeeper) types.MsgServer
func NewWasmProposalHandler ¶
func NewWasmProposalHandler(k *Keeper, enabledProposalType []wasmtypes.ProposalType) govtypes.Handler
NewWasmProposalHandler creates a new governance Handler for wasm proposals
func NewWasmProposalHandlerX ¶
func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []wasmtypes.ProposalType) govtypes.Handler
NewWasmProposalHandlerX creates a new governance Handler for wasm proposals
func Querier ¶
func Querier(k *Keeper) types.QueryServer
func RandomAccountAddress ¶
func RandomAccountAddress(_ testing.TB) sdk.AccAddress
func TestHandler ¶
func TestHandler(k types.ContractOpsKeeper) sdk.Handler
TestHandler returns a wasm handler for tests (to avoid circular imports)
func WasmQuerier ¶
func WasmQuerier(k *Keeper) wasmtypes.QueryServer
Types ¶
type BurnerExampleInitMsg ¶
type BurnerExampleInitMsg struct {
Payout sdk.AccAddress `json:"payout"`
}
type ExampleContract ¶
type ExampleContract struct { InitialAmount sdk.Coins Creator crypto.PrivKey CreatorAddr sdk.AccAddress CodeID uint64 Checksum []byte }
func StoreBurnerExampleContract ¶
func StoreBurnerExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
func StoreExampleContract ¶
func StoreExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers, wasmFile string) ExampleContract
func StoreHackatomExampleContract ¶
func StoreHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
func StoreIBCReflectContract ¶
func StoreIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
func StoreReflectContract ¶
func StoreReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract
type ExampleContractInstance ¶
type ExampleContractInstance struct { ExampleContract Contract sdk.AccAddress }
type ExampleInstance ¶
type ExampleInstance struct { ExampleContract Contract sdk.AccAddress Label string Deposit sdk.Coins }
func InstantiateReflectExampleContract ¶
func InstantiateReflectExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleInstance
InstantiateReflectExampleContract load and instantiate the "./testdata/reflect.wasm" contract
type HackatomExampleInitMsg ¶
type HackatomExampleInitMsg struct { Verifier sdk.AccAddress `json:"verifier"` Beneficiary sdk.AccAddress `json:"beneficiary"` }
type HackatomExampleInstance ¶
type HackatomExampleInstance struct { ExampleContract Contract sdk.AccAddress Verifier crypto.PrivKey VerifierAddr sdk.AccAddress Beneficiary crypto.PrivKey BeneficiaryAddr sdk.AccAddress Label string Deposit sdk.Coins }
func InstantiateHackatomExampleContract ¶
func InstantiateHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) HackatomExampleInstance
InstantiateHackatomExampleContract load and instantiate the "./testdata/hackatom.wasm" contract
type IBCReflectExampleInstance ¶
type IBCReflectExampleInstance struct { Contract sdk.AccAddress Admin sdk.AccAddress CodeID uint64 ReflectCodeID uint64 }
func InstantiateIBCReflectContract ¶
func InstantiateIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) IBCReflectExampleInstance
InstantiateIBCReflectContract load and instantiate the "./testdata/ibc_reflect.wasm" contract
type IBCReflectInitMsg ¶
type IBCReflectInitMsg struct {
ReflectCodeID uint64 `json:"reflect_code_id"`
}
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, homeDir string, wasmConfig wasmtypes.WasmConfig, availableCapabilities string, opts ...wasmkeeper.Option, ) Keeper
func (Keeper) IsInactiveContract ¶
func (Keeper) IterateInactiveContracts ¶
type PermissionedKeeper ¶
type PermissionedKeeper struct { wasmkeeper.PermissionedKeeper // contains filtered or unexported fields }
func NewPermissionedKeeper ¶
func NewPermissionedKeeper(k wasmkeeper.PermissionedKeeper, extended decoratedKeeper) *PermissionedKeeper
func (PermissionedKeeper) ActivateContract ¶
func (p PermissionedKeeper) ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error
func (PermissionedKeeper) ClearContractAdmin ¶
func (p PermissionedKeeper) ClearContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress) error
func (PermissionedKeeper) DeactivateContract ¶
func (p PermissionedKeeper) DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error
func (PermissionedKeeper) Execute ¶
func (p PermissionedKeeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error)
func (PermissionedKeeper) Migrate ¶
func (p PermissionedKeeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte) ([]byte, error)
func (PermissionedKeeper) UpdateContractAdmin ¶
func (p PermissionedKeeper) UpdateContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newAdmin sdk.AccAddress) error
type TestKeepers ¶
type TestKeepers struct { AccountKeeper authkeeper.AccountKeeper StakingKeeper stakingkeeper.Keeper DistKeeper distributionkeeper.Keeper BankKeeper bankkeeper.Keeper GovKeeper govkeeper.Keeper ContractKeeper types.ContractOpsKeeper WasmKeeper *Keeper IBCKeeper *ibckeeper.Keeper Router *baseapp.Router EncodingConfig wasmappparams.EncodingConfig Faucet *wasmkeeper.TestFaucet MultiStore sdk.CommitMultiStore }
func CreateDefaultTestInput ¶
func CreateDefaultTestInput(t testing.TB) (sdk.Context, TestKeepers)
CreateDefaultTestInput common settings for CreateTestInput
func CreateTestInput ¶
func CreateTestInput( t testing.TB, isCheckTx bool, availableCapabilities 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)