testutils

package
v1.0.0-rc06 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoopAnteHandler

func NoopAnteHandler(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error)

NoopAnteHandler implements the no-op AnteHandler.

Types

type MockContractViewer

type MockContractViewer struct {
	// contains filtered or unexported fields
}

MockContractViewer mocks x/wasmd module dependency. Mock returns a contract info if admin is set.

func NewMockContractViewer

func NewMockContractViewer() *MockContractViewer

NewMockContractViewer creates a new MockContractViewer instance.

func (*MockContractViewer) AddContractAdmin

func (v *MockContractViewer) AddContractAdmin(contractAddr, adminAddr string)

AddContractAdmin adds a contract admin link.

func (MockContractViewer) GetContractInfo

func (v MockContractViewer) GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) *wasmdTypes.ContractInfo

GetContractInfo returns a contract info if admin is set.

func (MockContractViewer) HasContractInfo

func (v MockContractViewer) HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool

HasContractInfo returns true if admin is set.

func (*MockContractViewer) SetReturnSudoError

func (v *MockContractViewer) SetReturnSudoError(returnSudoError error)

func (MockContractViewer) Sudo

func (v MockContractViewer) Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error)

Sudo implements the wasmKeeper.ContractInfoViewer interface.

type MockFeeTx

type MockFeeTx struct {
	// contains filtered or unexported fields
}

MockFeeTx is a mock implementation of sdk.FeeTx.

func NewMockFeeTx

func NewMockFeeTx(opts ...MockFeeTxOption) MockFeeTx

NewMockFeeTx creates a new MockFeeTx instance. CONTRACT: tx has no defaults, so it is up to a developer to set options right.

func (MockFeeTx) FeeGranter

func (tx MockFeeTx) FeeGranter() sdk.AccAddress

FeeGranter implements the sdk.FeeTx interface.

func (MockFeeTx) FeePayer

func (tx MockFeeTx) FeePayer() sdk.AccAddress

FeePayer implements the sdk.FeeTx interface.

func (MockFeeTx) GetFee

func (tx MockFeeTx) GetFee() sdk.Coins

GetFee implements the sdk.FeeTx interface.

func (MockFeeTx) GetGas

func (tx MockFeeTx) GetGas() uint64

GetGas implements the sdk.FeeTx interface.

func (MockFeeTx) GetMsgs

func (tx MockFeeTx) GetMsgs() []sdk.Msg

GetMsgs implemets the sdk.Tx interface.

func (MockFeeTx) ValidateBasic

func (tx MockFeeTx) ValidateBasic() error

ValidateBasic implemets the sdk.Tx interface.

type MockFeeTxOption

type MockFeeTxOption func(tx *MockFeeTx)

func WithMockFeeTxFees

func WithMockFeeTxFees(fees sdk.Coins) MockFeeTxOption

WithMockFeeTxFees option sets the fees of the MockFeeTx.

func WithMockFeeTxGas

func WithMockFeeTxGas(gas uint64) MockFeeTxOption

WithMockFeeTxGas option sets the gas limit of the MockFeeTx.

func WithMockFeeTxMsgs

func WithMockFeeTxMsgs(msgs ...sdk.Msg) MockFeeTxOption

WithMockFeeTxMsgs option sets the msgs of the MockFeeTx.

func WithMockFeeTxPayer

func WithMockFeeTxPayer(payer sdk.AccAddress) MockFeeTxOption

WithMockFeeTxPayer option sets the feePayer of the MockFeeTx.

type MockMessenger

type MockMessenger struct{}

MockMessenger mocks x/wasmd module dependency.

func NewMockMessenger

func NewMockMessenger() *MockMessenger

NewMockMessenger creates a new MockMessenger instance.

func (MockMessenger) DispatchMsg

func (m MockMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmVmTypes.CosmosMsg) ([]sdk.Event, [][]byte, error)

DispatchMsg implements the wasmKeeper.Messenger interface.

type MockMsg

type MockMsg struct{}

MockMsg is a dummy sdk.Msg.

func NewMockMsg

func NewMockMsg() *MockMsg

NewMockMsg creates a new MockMsg.

func (MockMsg) GetSigners

func (msg MockMsg) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface.

func (MockMsg) ProtoMessage

func (msg MockMsg) ProtoMessage()

ProtoMessage implements the proto.Message interface.

func (MockMsg) Reset

func (msg MockMsg) Reset()

Reset implements the proto.Message interface.

func (MockMsg) String

func (msg MockMsg) String() string

String implements the proto.Message interface.

func (MockMsg) ValidateBasic

func (msg MockMsg) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

Jump to

Keyboard shortcuts

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