Versions in this module Expand all Collapse all v1 v1.0.0 Oct 9, 2024 Changes in this version + const MockStoreCodeCostPerByte + var AlwaysPanicMockWasmEngine = &MockWasmEngine + func HasIBCAnalyzeFn(wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error) + func HashOnlyStoreCodeFn(code wasmvm.WasmCode, gasLimit uint64) (wasmvm.Checksum, uint64, error) + func MakeIBCInstantiable(m *MockWasmEngine) + func MakeInstantiable(m *MockWasmEngine) + func MockChannelKeeperIterator(s []channeltypes.IdentifiedChannel) func(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool) + func NoOpInstantiateFn(wasmvm.Checksum, wasmvmtypes.Env, wasmvmtypes.MessageInfo, []byte, ...) (*wasmvmtypes.ContractResult, uint64, error) + func NoOpStoreCodeFn(wasm wasmvm.WasmCode, gasLimit uint64) (wasmvm.Checksum, uint64, error) + func WithoutIBCAnalyzeFn(wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error) + type AccountPrunerMock struct + CleanupExistingAccountFn func(ctx sdk.Context, existingAccount sdk.AccountI) (handled bool, err error) + func (m AccountPrunerMock) CleanupExistingAccount(ctx sdk.Context, existingAccount sdk.AccountI) (handled bool, err error) + type IBCContractCallbacks interface + IBCChannelClose func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelConnect func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelOpen func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCChannelOpenResult, uint64, error) + IBCPacketAck func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ack wasmvmtypes.IBCPacketAckMsg, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCPacketReceive func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCReceiveResult, uint64, error) + IBCPacketTimeout func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + type IBCContractKeeperMock struct + OnRecvPacketFn func(ctx sdk.Context, contractAddr sdk.AccAddress, ...) (ibcexported.Acknowledgement, error) + func (m *IBCContractKeeperMock) DeleteAsyncAckPacket(ctx context.Context, portID, channelID string, sequence uint64) + func (m *IBCContractKeeperMock) LoadAsyncAckPacket(ctx context.Context, portID, channelID string, sequence uint64) (channeltypes.Packet, error) + func (m *IBCContractKeeperMock) OnRecvPacket(ctx sdk.Context, contractAddr sdk.AccAddress, ...) (ibcexported.Acknowledgement, error) + func (m *IBCContractKeeperMock) StoreAsyncAckPacket(ctx context.Context, packet channeltypes.Packet) error + type MessageRouterFunc func(msg sdk.Msg) baseapp.MsgServiceHandler + func (m MessageRouterFunc) Handler(msg sdk.Msg) baseapp.MsgServiceHandler + type MockCapabilityKeeper struct + AuthenticateCapabilityFn func(ctx sdk.Context, capability *capabilitytypes.Capability, name string) bool + ClaimCapabilityFn func(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error + GetCapabilityFn func(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) + func (m MockCapabilityKeeper) AuthenticateCapability(ctx sdk.Context, capability *capabilitytypes.Capability, name string) bool + func (m MockCapabilityKeeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error + func (m MockCapabilityKeeper) GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) + type MockChannelKeeper struct + ChanCloseInitFn func(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error + GetAllChannelsFn func(ctx sdk.Context) []channeltypes.IdentifiedChannel + GetAllChannelsWithPortPrefixFn func(ctx sdk.Context, portPrefix string) []channeltypes.IdentifiedChannel + GetChannelFn func(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) + GetNextSequenceSendFn func(ctx sdk.Context, portID, channelID string) (uint64, bool) + SetChannelFn func(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel) + func (m *MockChannelKeeper) ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error + func (m *MockChannelKeeper) GetAllChannels(ctx sdk.Context) []channeltypes.IdentifiedChannel + func (m *MockChannelKeeper) GetAllChannelsWithPortPrefix(ctx sdk.Context, portPrefix string) []channeltypes.IdentifiedChannel + func (m *MockChannelKeeper) GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) + func (m *MockChannelKeeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) + func (m *MockChannelKeeper) SetChannel(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel) + type MockCoinTransferrer struct + TransferCoinsFn func(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + func (m *MockCoinTransferrer) TransferCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + type MockCommitMultiStore struct + Committed []bool + func (m *MockCommitMultiStore) CacheMultiStore() storetypes.CacheMultiStore + type MockGasRegister struct + EventCostsFn func(evts []wasmvmtypes.EventAttribute) storetypes.Gas + FromWasmVMGasFn func(source uint64) storetypes.Gas + ReplyCostFn func(discount bool, reply wasmvmtypes.Reply) storetypes.Gas + SetupContractCostFn func(discount bool, msgLen int) storetypes.Gas + ToWasmVMGasFn func(source storetypes.Gas) uint64 + UncompressCostsFn func(byteLength int) storetypes.Gas + func (m MockGasRegister) EventCosts(evts []wasmvmtypes.EventAttribute, _ wasmvmtypes.Array[wasmvmtypes.Event]) storetypes.Gas + func (m MockGasRegister) FromWasmVMGas(source uint64) storetypes.Gas + func (m MockGasRegister) ReplyCosts(discount bool, reply wasmvmtypes.Reply) storetypes.Gas + func (m MockGasRegister) SetupContractCost(discount bool, msgLen int) storetypes.Gas + func (m MockGasRegister) ToWasmVMGas(source storetypes.Gas) uint64 + func (m MockGasRegister) UncompressCosts(byteLength int) storetypes.Gas + type MockIBCContractCallbacks struct + IBCChannelCloseFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelConnectFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelOpenFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelOpenMsg, ...) (*wasmvmtypes.IBCChannelOpenResult, uint64, error) + IBCPacketAckFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketAckMsg, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCPacketReceiveFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCReceiveResult, uint64, error) + IBCPacketTimeoutFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m MockIBCContractCallbacks) IBCChannelClose(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m MockIBCContractCallbacks) IBCChannelConnect(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m MockIBCContractCallbacks) IBCChannelOpen(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCChannelOpenResult, uint64, error) + func (m MockIBCContractCallbacks) IBCPacketAck(codeID wasmvm.Checksum, env wasmvmtypes.Env, ack wasmvmtypes.IBCPacketAckMsg, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m MockIBCContractCallbacks) IBCPacketReceive(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCReceiveResult, uint64, error) + func (m MockIBCContractCallbacks) IBCPacketTimeout(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + type MockIBCTransferKeeper struct + GetPortFn func(ctx sdk.Context) string + func (m MockIBCTransferKeeper) GetPort(ctx sdk.Context) string + type MockICS4Wrapper struct + SendPacketFn func(ctx sdk.Context, channelCap *capabilitytypes.Capability, ...) (uint64, error) + WriteAcknowledgementFn func(ctx sdk.Context, chanCap *capabilitytypes.Capability, ...) error + func (m *MockICS4Wrapper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, ...) (uint64, error) + func (m *MockICS4Wrapper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, ...) error + type MockMessageHandler struct + DispatchMsgFn func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, ...) (events []sdk.Event, data [][]byte, msgResponses [][]*codectypes.Any, err error) + func NewCapturingMessageHandler() (*MockMessageHandler, *[]wasmvmtypes.CosmosMsg) + func NewErroringMessageHandler() *MockMessageHandler + func (m *MockMessageHandler) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, ...) (events []sdk.Event, data [][]byte, msgResponses [][]*codectypes.Any, err error) + type MockMessageRouter struct + HandlerFn func(msg sdk.Msg) baseapp.MsgServiceHandler + func (m MockMessageRouter) Handler(msg sdk.Msg) baseapp.MsgServiceHandler + type MockMsgDispatcher struct + DispatchSubmessagesFn func(ctx sdk.Context, contractAddr sdk.AccAddress, ibcPort string, ...) ([]byte, error) + func (m MockMsgDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk.AccAddress, ibcPort string, ...) ([]byte, error) + type MockQueryHandler struct + HandleQueryFn func(ctx sdk.Context, request wasmvmtypes.QueryRequest, caller sdk.AccAddress) ([]byte, error) + func (m *MockQueryHandler) HandleQuery(ctx sdk.Context, caller sdk.AccAddress, request wasmvmtypes.QueryRequest) ([]byte, error) + type MockWasmEngine struct + AnalyzeCodeFn func(codeID wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error) + CleanupFn func() + ExecuteFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, ...) (*wasmvmtypes.ContractResult, uint64, error) + GetCodeFn func(codeID wasmvm.Checksum) (wasmvm.WasmCode, error) + GetMetricsFn func() (*wasmvmtypes.Metrics, error) + GetPinMetricsFn func() (*wasmvmtypes.PinnedMetrics, error) + IBCChannelCloseFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelConnectFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCChannelOpenFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelOpenMsg, ...) (*wasmvmtypes.IBCChannelOpenResult, uint64, error) + IBCDestinationCallbackFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCPacketAckFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketAckMsg, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCPacketReceiveFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCReceiveResult, uint64, error) + IBCPacketTimeoutFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + IBCSourceCallbackFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + InstantiateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, ...) (*wasmvmtypes.ContractResult, uint64, error) + MigrateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, ...) (*wasmvmtypes.ContractResult, uint64, error) + PinFn func(checksum wasmvm.Checksum) error + QueryFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg []byte, ...) (*wasmvmtypes.QueryResult, uint64, error) + ReplyFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, reply wasmvmtypes.Reply, ...) (*wasmvmtypes.ContractResult, uint64, error) + StoreCodeFn func(codeID wasmvm.WasmCode, gasLimit uint64) (wasmvm.Checksum, uint64, error) + StoreCodeUncheckedFn func(codeID wasmvm.WasmCode) (wasmvm.Checksum, error) + SudoFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, sudoMsg []byte, ...) (*wasmvmtypes.ContractResult, uint64, error) + UnpinFn func(checksum wasmvm.Checksum) error + func NewIBCContractMockWasmEngine(c IBCContractCallbacks) *MockWasmEngine + func SelfCallingInstMockWasmEngine(executeCalled *bool) *MockWasmEngine + func (m *MockWasmEngine) AnalyzeCode(codeID wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error) + func (m *MockWasmEngine) Cleanup() + func (m *MockWasmEngine) Execute(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, ...) (*wasmvmtypes.ContractResult, uint64, error) + func (m *MockWasmEngine) GetCode(codeID wasmvm.Checksum) (wasmvm.WasmCode, error) + func (m *MockWasmEngine) GetMetrics() (*wasmvmtypes.Metrics, error) + func (m *MockWasmEngine) GetPinnedMetrics() (*wasmvmtypes.PinnedMetrics, error) + func (m *MockWasmEngine) IBCChannelClose(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m *MockWasmEngine) IBCChannelConnect(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m *MockWasmEngine) IBCChannelOpen(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelOpenMsg, ...) (*wasmvmtypes.IBCChannelOpenResult, uint64, error) + func (m *MockWasmEngine) IBCPacketAck(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketAckMsg, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m *MockWasmEngine) IBCPacketReceive(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCReceiveResult, uint64, error) + func (m *MockWasmEngine) IBCPacketTimeout(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m *MockWasmEngine) Instantiate(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, ...) (*wasmvmtypes.ContractResult, uint64, error) + func (m *MockWasmEngine) Migrate(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, ...) (*wasmvmtypes.ContractResult, uint64, error) + func (m *MockWasmEngine) Pin(checksum wasmvm.Checksum) error + func (m *MockWasmEngine) Query(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg []byte, ...) (*wasmvmtypes.QueryResult, uint64, error) + func (m *MockWasmEngine) Reply(codeID wasmvm.Checksum, env wasmvmtypes.Env, reply wasmvmtypes.Reply, ...) (*wasmvmtypes.ContractResult, uint64, error) + func (m *MockWasmEngine) StoreCode(codeID wasmvm.WasmCode, gasLimit uint64) (wasmvm.Checksum, uint64, error) + func (m *MockWasmEngine) StoreCodeUnchecked(codeID wasmvm.WasmCode) (wasmvm.Checksum, error) + func (m *MockWasmEngine) Sudo(codeID wasmvm.Checksum, env wasmvmtypes.Env, sudoMsg []byte, ...) (*wasmvmtypes.ContractResult, uint64, error) + func (m *MockWasmEngine) Unpin(checksum wasmvm.Checksum) error + func (m MockWasmEngine) IBCDestinationCallback(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error) + func (m MockWasmEngine) IBCSourceCallback(codeID wasmvm.Checksum, env wasmvmtypes.Env, ...) (*wasmvmtypes.IBCBasicResult, uint64, error)