mock

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeperMock

type AccountKeeperMock struct {
	// GetModuleAddressFunc mocks the GetModuleAddress method.
	GetModuleAddressFunc func(moduleName string) cosmossdktypes.AccAddress
	// contains filtered or unexported fields
}

AccountKeeperMock is a mock implementation of axelarnettypes.AccountKeeper.

func TestSomethingThatUsesAccountKeeper(t *testing.T) {

	// make and configure a mocked axelarnettypes.AccountKeeper
	mockedAccountKeeper := &AccountKeeperMock{
		GetModuleAddressFunc: func(moduleName string) cosmossdktypes.AccAddress {
			panic("mock out the GetModuleAddress method")
		},
	}

	// use mockedAccountKeeper in code that requires axelarnettypes.AccountKeeper
	// and then make assertions.

}

func (*AccountKeeperMock) GetModuleAddress

func (mock *AccountKeeperMock) GetModuleAddress(moduleName string) cosmossdktypes.AccAddress

GetModuleAddress calls GetModuleAddressFunc.

func (*AccountKeeperMock) GetModuleAddressCalls

func (mock *AccountKeeperMock) GetModuleAddressCalls() []struct {
	ModuleName string
}

GetModuleAddressCalls gets all the calls that were made to GetModuleAddress. Check the length with:

len(mockedAccountKeeper.GetModuleAddressCalls())

type BankKeeperMock

type BankKeeperMock struct {
	// BurnCoinsFunc mocks the BurnCoins method.
	BurnCoinsFunc func(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error

	// GetBalanceFunc mocks the GetBalance method.
	GetBalanceFunc func(ctx cosmossdktypes.Context, addr cosmossdktypes.AccAddress, denom string) cosmossdktypes.Coin

	// MintCoinsFunc mocks the MintCoins method.
	MintCoinsFunc func(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error

	// SendCoinsFunc mocks the SendCoins method.
	SendCoinsFunc func(ctx cosmossdktypes.Context, fromAddr cosmossdktypes.AccAddress, toAddr cosmossdktypes.AccAddress, amt cosmossdktypes.Coins) error

	// SendCoinsFromAccountToModuleFunc mocks the SendCoinsFromAccountToModule method.
	SendCoinsFromAccountToModuleFunc func(ctx cosmossdktypes.Context, senderAddr cosmossdktypes.AccAddress, recipientModule string, amt cosmossdktypes.Coins) error

	// SendCoinsFromModuleToAccountFunc mocks the SendCoinsFromModuleToAccount method.
	SendCoinsFromModuleToAccountFunc func(ctx cosmossdktypes.Context, senderModule string, recipientAddr cosmossdktypes.AccAddress, amt cosmossdktypes.Coins) error
	// contains filtered or unexported fields
}

BankKeeperMock is a mock implementation of axelarnettypes.BankKeeper.

func TestSomethingThatUsesBankKeeper(t *testing.T) {

	// make and configure a mocked axelarnettypes.BankKeeper
	mockedBankKeeper := &BankKeeperMock{
		BurnCoinsFunc: func(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error {
			panic("mock out the BurnCoins method")
		},
		GetBalanceFunc: func(ctx cosmossdktypes.Context, addr cosmossdktypes.AccAddress, denom string) cosmossdktypes.Coin {
			panic("mock out the GetBalance method")
		},
		MintCoinsFunc: func(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error {
			panic("mock out the MintCoins method")
		},
		SendCoinsFunc: func(ctx cosmossdktypes.Context, fromAddr cosmossdktypes.AccAddress, toAddr cosmossdktypes.AccAddress, amt cosmossdktypes.Coins) error {
			panic("mock out the SendCoins method")
		},
		SendCoinsFromAccountToModuleFunc: func(ctx cosmossdktypes.Context, senderAddr cosmossdktypes.AccAddress, recipientModule string, amt cosmossdktypes.Coins) error {
			panic("mock out the SendCoinsFromAccountToModule method")
		},
		SendCoinsFromModuleToAccountFunc: func(ctx cosmossdktypes.Context, senderModule string, recipientAddr cosmossdktypes.AccAddress, amt cosmossdktypes.Coins) error {
			panic("mock out the SendCoinsFromModuleToAccount method")
		},
	}

	// use mockedBankKeeper in code that requires axelarnettypes.BankKeeper
	// and then make assertions.

}

func (*BankKeeperMock) BurnCoins

func (mock *BankKeeperMock) BurnCoins(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error

BurnCoins calls BurnCoinsFunc.

func (*BankKeeperMock) BurnCoinsCalls

func (mock *BankKeeperMock) BurnCoinsCalls() []struct {
	Ctx        cosmossdktypes.Context
	ModuleName string
	Amt        cosmossdktypes.Coins
}

BurnCoinsCalls gets all the calls that were made to BurnCoins. Check the length with:

len(mockedBankKeeper.BurnCoinsCalls())

func (*BankKeeperMock) GetBalance added in v0.12.0

GetBalance calls GetBalanceFunc.

func (*BankKeeperMock) GetBalanceCalls added in v0.12.0

func (mock *BankKeeperMock) GetBalanceCalls() []struct {
	Ctx   cosmossdktypes.Context
	Addr  cosmossdktypes.AccAddress
	Denom string
}

GetBalanceCalls gets all the calls that were made to GetBalance. Check the length with:

len(mockedBankKeeper.GetBalanceCalls())

func (*BankKeeperMock) MintCoins

func (mock *BankKeeperMock) MintCoins(ctx cosmossdktypes.Context, moduleName string, amt cosmossdktypes.Coins) error

MintCoins calls MintCoinsFunc.

func (*BankKeeperMock) MintCoinsCalls

func (mock *BankKeeperMock) MintCoinsCalls() []struct {
	Ctx        cosmossdktypes.Context
	ModuleName string
	Amt        cosmossdktypes.Coins
}

MintCoinsCalls gets all the calls that were made to MintCoins. Check the length with:

len(mockedBankKeeper.MintCoinsCalls())

func (*BankKeeperMock) SendCoins

SendCoins calls SendCoinsFunc.

func (*BankKeeperMock) SendCoinsCalls

func (mock *BankKeeperMock) SendCoinsCalls() []struct {
	Ctx      cosmossdktypes.Context
	FromAddr cosmossdktypes.AccAddress
	ToAddr   cosmossdktypes.AccAddress
	Amt      cosmossdktypes.Coins
}

SendCoinsCalls gets all the calls that were made to SendCoins. Check the length with:

len(mockedBankKeeper.SendCoinsCalls())

func (*BankKeeperMock) SendCoinsFromAccountToModule

func (mock *BankKeeperMock) SendCoinsFromAccountToModule(ctx cosmossdktypes.Context, senderAddr cosmossdktypes.AccAddress, recipientModule string, amt cosmossdktypes.Coins) error

SendCoinsFromAccountToModule calls SendCoinsFromAccountToModuleFunc.

func (*BankKeeperMock) SendCoinsFromAccountToModuleCalls

func (mock *BankKeeperMock) SendCoinsFromAccountToModuleCalls() []struct {
	Ctx             cosmossdktypes.Context
	SenderAddr      cosmossdktypes.AccAddress
	RecipientModule string
	Amt             cosmossdktypes.Coins
}

SendCoinsFromAccountToModuleCalls gets all the calls that were made to SendCoinsFromAccountToModule. Check the length with:

len(mockedBankKeeper.SendCoinsFromAccountToModuleCalls())

func (*BankKeeperMock) SendCoinsFromModuleToAccount

func (mock *BankKeeperMock) SendCoinsFromModuleToAccount(ctx cosmossdktypes.Context, senderModule string, recipientAddr cosmossdktypes.AccAddress, amt cosmossdktypes.Coins) error

SendCoinsFromModuleToAccount calls SendCoinsFromModuleToAccountFunc.

func (*BankKeeperMock) SendCoinsFromModuleToAccountCalls

func (mock *BankKeeperMock) SendCoinsFromModuleToAccountCalls() []struct {
	Ctx           cosmossdktypes.Context
	SenderModule  string
	RecipientAddr cosmossdktypes.AccAddress
	Amt           cosmossdktypes.Coins
}

SendCoinsFromModuleToAccountCalls gets all the calls that were made to SendCoinsFromModuleToAccount. Check the length with:

len(mockedBankKeeper.SendCoinsFromModuleToAccountCalls())

type BaseKeeperMock

type BaseKeeperMock struct {
	// DeletePendingIBCTransferFunc mocks the DeletePendingIBCTransfer method.
	DeletePendingIBCTransferFunc func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64)

	// GetAssetFunc mocks the GetAsset method.
	GetAssetFunc func(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool)

	// GetCosmosChainByAssetFunc mocks the GetCosmosChainByAsset method.
	GetCosmosChainByAssetFunc func(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool)

	// GetCosmosChainByNameFunc mocks the GetCosmosChainByName method.
	GetCosmosChainByNameFunc func(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool)

	// GetCosmosChainsFunc mocks the GetCosmosChains method.
	GetCosmosChainsFunc func(ctx cosmossdktypes.Context) []string

	// GetFeeCollectorFunc mocks the GetFeeCollector method.
	GetFeeCollectorFunc func(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool)

	// GetIBCPathFunc mocks the GetIBCPath method.
	GetIBCPathFunc func(ctx cosmossdktypes.Context, chain string) (string, bool)

	// GetPendingIBCTransferFunc mocks the GetPendingIBCTransfer method.
	GetPendingIBCTransferFunc func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool)

	// GetRouteTimeoutWindowFunc mocks the GetRouteTimeoutWindow method.
	GetRouteTimeoutWindowFunc func(ctx cosmossdktypes.Context) uint64

	// GetTransactionFeeRateFunc mocks the GetTransactionFeeRate method.
	GetTransactionFeeRateFunc func(ctx cosmossdktypes.Context) cosmossdktypes.Dec

	// LoggerFunc mocks the Logger method.
	LoggerFunc func(ctx cosmossdktypes.Context) log.Logger

	// RegisterAssetToCosmosChainFunc mocks the RegisterAssetToCosmosChain method.
	RegisterAssetToCosmosChainFunc func(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error

	// RegisterIBCPathFunc mocks the RegisterIBCPath method.
	RegisterIBCPathFunc func(ctx cosmossdktypes.Context, asset string, path string) error

	// SetCosmosChainFunc mocks the SetCosmosChain method.
	SetCosmosChainFunc func(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain)

	// SetFeeCollectorFunc mocks the SetFeeCollector method.
	SetFeeCollectorFunc func(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error

	// SetPendingIBCTransferFunc mocks the SetPendingIBCTransfer method.
	SetPendingIBCTransferFunc func(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer)
	// contains filtered or unexported fields
}

BaseKeeperMock is a mock implementation of axelarnettypes.BaseKeeper.

func TestSomethingThatUsesBaseKeeper(t *testing.T) {

	// make and configure a mocked axelarnettypes.BaseKeeper
	mockedBaseKeeper := &BaseKeeperMock{
		DeletePendingIBCTransferFunc: func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64)  {
			panic("mock out the DeletePendingIBCTransfer method")
		},
		GetAssetFunc: func(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool) {
			panic("mock out the GetAsset method")
		},
		GetCosmosChainByAssetFunc: func(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool) {
			panic("mock out the GetCosmosChainByAsset method")
		},
		GetCosmosChainByNameFunc: func(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool) {
			panic("mock out the GetCosmosChainByName method")
		},
		GetCosmosChainsFunc: func(ctx cosmossdktypes.Context) []string {
			panic("mock out the GetCosmosChains method")
		},
		GetFeeCollectorFunc: func(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool) {
			panic("mock out the GetFeeCollector method")
		},
		GetIBCPathFunc: func(ctx cosmossdktypes.Context, chain string) (string, bool) {
			panic("mock out the GetIBCPath method")
		},
		GetPendingIBCTransferFunc: func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool) {
			panic("mock out the GetPendingIBCTransfer method")
		},
		GetRouteTimeoutWindowFunc: func(ctx cosmossdktypes.Context) uint64 {
			panic("mock out the GetRouteTimeoutWindow method")
		},
		GetTransactionFeeRateFunc: func(ctx cosmossdktypes.Context) cosmossdktypes.Dec {
			panic("mock out the GetTransactionFeeRate method")
		},
		LoggerFunc: func(ctx cosmossdktypes.Context) log.Logger {
			panic("mock out the Logger method")
		},
		RegisterAssetToCosmosChainFunc: func(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error {
			panic("mock out the RegisterAssetToCosmosChain method")
		},
		RegisterIBCPathFunc: func(ctx cosmossdktypes.Context, asset string, path string) error {
			panic("mock out the RegisterIBCPath method")
		},
		SetCosmosChainFunc: func(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain)  {
			panic("mock out the SetCosmosChain method")
		},
		SetFeeCollectorFunc: func(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error {
			panic("mock out the SetFeeCollector method")
		},
		SetPendingIBCTransferFunc: func(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer)  {
			panic("mock out the SetPendingIBCTransfer method")
		},
	}

	// use mockedBaseKeeper in code that requires axelarnettypes.BaseKeeper
	// and then make assertions.

}

func (*BaseKeeperMock) DeletePendingIBCTransfer

func (mock *BaseKeeperMock) DeletePendingIBCTransfer(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64)

DeletePendingIBCTransfer calls DeletePendingIBCTransferFunc.

func (*BaseKeeperMock) DeletePendingIBCTransferCalls

func (mock *BaseKeeperMock) DeletePendingIBCTransferCalls() []struct {
	Ctx       cosmossdktypes.Context
	PortID    string
	ChannelID string
	Sequence  uint64
}

DeletePendingIBCTransferCalls gets all the calls that were made to DeletePendingIBCTransfer. Check the length with:

len(mockedBaseKeeper.DeletePendingIBCTransferCalls())

func (*BaseKeeperMock) GetAsset added in v0.10.0

func (mock *BaseKeeperMock) GetAsset(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool)

GetAsset calls GetAssetFunc.

func (*BaseKeeperMock) GetAssetCalls added in v0.10.0

func (mock *BaseKeeperMock) GetAssetCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain string
	Denom string
}

GetAssetCalls gets all the calls that were made to GetAsset. Check the length with:

len(mockedBaseKeeper.GetAssetCalls())

func (*BaseKeeperMock) GetCosmosChainByAsset added in v0.9.0

func (mock *BaseKeeperMock) GetCosmosChainByAsset(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool)

GetCosmosChainByAsset calls GetCosmosChainByAssetFunc.

func (*BaseKeeperMock) GetCosmosChainByAssetCalls added in v0.9.0

func (mock *BaseKeeperMock) GetCosmosChainByAssetCalls() []struct {
	Ctx   cosmossdktypes.Context
	Asset string
}

GetCosmosChainByAssetCalls gets all the calls that were made to GetCosmosChainByAsset. Check the length with:

len(mockedBaseKeeper.GetCosmosChainByAssetCalls())

func (*BaseKeeperMock) GetCosmosChainByName added in v0.9.0

func (mock *BaseKeeperMock) GetCosmosChainByName(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool)

GetCosmosChainByName calls GetCosmosChainByNameFunc.

func (*BaseKeeperMock) GetCosmosChainByNameCalls added in v0.9.0

func (mock *BaseKeeperMock) GetCosmosChainByNameCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain string
}

GetCosmosChainByNameCalls gets all the calls that were made to GetCosmosChainByName. Check the length with:

len(mockedBaseKeeper.GetCosmosChainByNameCalls())

func (*BaseKeeperMock) GetCosmosChains

func (mock *BaseKeeperMock) GetCosmosChains(ctx cosmossdktypes.Context) []string

GetCosmosChains calls GetCosmosChainsFunc.

func (*BaseKeeperMock) GetCosmosChainsCalls

func (mock *BaseKeeperMock) GetCosmosChainsCalls() []struct {
	Ctx cosmossdktypes.Context
}

GetCosmosChainsCalls gets all the calls that were made to GetCosmosChains. Check the length with:

len(mockedBaseKeeper.GetCosmosChainsCalls())

func (*BaseKeeperMock) GetFeeCollector

func (mock *BaseKeeperMock) GetFeeCollector(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool)

GetFeeCollector calls GetFeeCollectorFunc.

func (*BaseKeeperMock) GetFeeCollectorCalls

func (mock *BaseKeeperMock) GetFeeCollectorCalls() []struct {
	Ctx cosmossdktypes.Context
}

GetFeeCollectorCalls gets all the calls that were made to GetFeeCollector. Check the length with:

len(mockedBaseKeeper.GetFeeCollectorCalls())

func (*BaseKeeperMock) GetIBCPath

func (mock *BaseKeeperMock) GetIBCPath(ctx cosmossdktypes.Context, chain string) (string, bool)

GetIBCPath calls GetIBCPathFunc.

func (*BaseKeeperMock) GetIBCPathCalls

func (mock *BaseKeeperMock) GetIBCPathCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain string
}

GetIBCPathCalls gets all the calls that were made to GetIBCPath. Check the length with:

len(mockedBaseKeeper.GetIBCPathCalls())

func (*BaseKeeperMock) GetPendingIBCTransfer

func (mock *BaseKeeperMock) GetPendingIBCTransfer(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool)

GetPendingIBCTransfer calls GetPendingIBCTransferFunc.

func (*BaseKeeperMock) GetPendingIBCTransferCalls

func (mock *BaseKeeperMock) GetPendingIBCTransferCalls() []struct {
	Ctx       cosmossdktypes.Context
	PortID    string
	ChannelID string
	Sequence  uint64
}

GetPendingIBCTransferCalls gets all the calls that were made to GetPendingIBCTransfer. Check the length with:

len(mockedBaseKeeper.GetPendingIBCTransferCalls())

func (*BaseKeeperMock) GetRouteTimeoutWindow

func (mock *BaseKeeperMock) GetRouteTimeoutWindow(ctx cosmossdktypes.Context) uint64

GetRouteTimeoutWindow calls GetRouteTimeoutWindowFunc.

func (*BaseKeeperMock) GetRouteTimeoutWindowCalls

func (mock *BaseKeeperMock) GetRouteTimeoutWindowCalls() []struct {
	Ctx cosmossdktypes.Context
}

GetRouteTimeoutWindowCalls gets all the calls that were made to GetRouteTimeoutWindow. Check the length with:

len(mockedBaseKeeper.GetRouteTimeoutWindowCalls())

func (*BaseKeeperMock) GetTransactionFeeRate

func (mock *BaseKeeperMock) GetTransactionFeeRate(ctx cosmossdktypes.Context) cosmossdktypes.Dec

GetTransactionFeeRate calls GetTransactionFeeRateFunc.

func (*BaseKeeperMock) GetTransactionFeeRateCalls

func (mock *BaseKeeperMock) GetTransactionFeeRateCalls() []struct {
	Ctx cosmossdktypes.Context
}

GetTransactionFeeRateCalls gets all the calls that were made to GetTransactionFeeRate. Check the length with:

len(mockedBaseKeeper.GetTransactionFeeRateCalls())

func (*BaseKeeperMock) Logger

func (mock *BaseKeeperMock) Logger(ctx cosmossdktypes.Context) log.Logger

Logger calls LoggerFunc.

func (*BaseKeeperMock) LoggerCalls

func (mock *BaseKeeperMock) LoggerCalls() []struct {
	Ctx cosmossdktypes.Context
}

LoggerCalls gets all the calls that were made to Logger. Check the length with:

len(mockedBaseKeeper.LoggerCalls())

func (*BaseKeeperMock) RegisterAssetToCosmosChain

func (mock *BaseKeeperMock) RegisterAssetToCosmosChain(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error

RegisterAssetToCosmosChain calls RegisterAssetToCosmosChainFunc.

func (*BaseKeeperMock) RegisterAssetToCosmosChainCalls

func (mock *BaseKeeperMock) RegisterAssetToCosmosChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Asset axelarnettypes.Asset
	Chain string
}

RegisterAssetToCosmosChainCalls gets all the calls that were made to RegisterAssetToCosmosChain. Check the length with:

len(mockedBaseKeeper.RegisterAssetToCosmosChainCalls())

func (*BaseKeeperMock) RegisterIBCPath

func (mock *BaseKeeperMock) RegisterIBCPath(ctx cosmossdktypes.Context, asset string, path string) error

RegisterIBCPath calls RegisterIBCPathFunc.

func (*BaseKeeperMock) RegisterIBCPathCalls

func (mock *BaseKeeperMock) RegisterIBCPathCalls() []struct {
	Ctx   cosmossdktypes.Context
	Asset string
	Path  string
}

RegisterIBCPathCalls gets all the calls that were made to RegisterIBCPath. Check the length with:

len(mockedBaseKeeper.RegisterIBCPathCalls())

func (*BaseKeeperMock) SetCosmosChain added in v0.9.0

func (mock *BaseKeeperMock) SetCosmosChain(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain)

SetCosmosChain calls SetCosmosChainFunc.

func (*BaseKeeperMock) SetCosmosChainCalls added in v0.9.0

func (mock *BaseKeeperMock) SetCosmosChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain axelarnettypes.CosmosChain
}

SetCosmosChainCalls gets all the calls that were made to SetCosmosChain. Check the length with:

len(mockedBaseKeeper.SetCosmosChainCalls())

func (*BaseKeeperMock) SetFeeCollector

func (mock *BaseKeeperMock) SetFeeCollector(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error

SetFeeCollector calls SetFeeCollectorFunc.

func (*BaseKeeperMock) SetFeeCollectorCalls

func (mock *BaseKeeperMock) SetFeeCollectorCalls() []struct {
	Ctx     cosmossdktypes.Context
	Address cosmossdktypes.AccAddress
}

SetFeeCollectorCalls gets all the calls that were made to SetFeeCollector. Check the length with:

len(mockedBaseKeeper.SetFeeCollectorCalls())

func (*BaseKeeperMock) SetPendingIBCTransfer

func (mock *BaseKeeperMock) SetPendingIBCTransfer(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer)

SetPendingIBCTransfer calls SetPendingIBCTransferFunc.

func (*BaseKeeperMock) SetPendingIBCTransferCalls

func (mock *BaseKeeperMock) SetPendingIBCTransferCalls() []struct {
	Ctx      cosmossdktypes.Context
	Transfer axelarnettypes.IBCTransfer
}

SetPendingIBCTransferCalls gets all the calls that were made to SetPendingIBCTransfer. Check the length with:

len(mockedBaseKeeper.SetPendingIBCTransferCalls())

type ChannelKeeperMock

type ChannelKeeperMock struct {
	// GetChannelClientStateFunc mocks the GetChannelClientState method.
	GetChannelClientStateFunc func(ctx cosmossdktypes.Context, portID string, channelID string) (string, ibcclient.ClientState, error)

	// GetNextSequenceSendFunc mocks the GetNextSequenceSend method.
	GetNextSequenceSendFunc func(ctx cosmossdktypes.Context, portID string, channelID string) (uint64, bool)
	// contains filtered or unexported fields
}

ChannelKeeperMock is a mock implementation of axelarnettypes.ChannelKeeper.

func TestSomethingThatUsesChannelKeeper(t *testing.T) {

	// make and configure a mocked axelarnettypes.ChannelKeeper
	mockedChannelKeeper := &ChannelKeeperMock{
		GetChannelClientStateFunc: func(ctx cosmossdktypes.Context, portID string, channelID string) (string, ibcclient.ClientState, error) {
			panic("mock out the GetChannelClientState method")
		},
		GetNextSequenceSendFunc: func(ctx cosmossdktypes.Context, portID string, channelID string) (uint64, bool) {
			panic("mock out the GetNextSequenceSend method")
		},
	}

	// use mockedChannelKeeper in code that requires axelarnettypes.ChannelKeeper
	// and then make assertions.

}

func (*ChannelKeeperMock) GetChannelClientState

func (mock *ChannelKeeperMock) GetChannelClientState(ctx cosmossdktypes.Context, portID string, channelID string) (string, ibcclient.ClientState, error)

GetChannelClientState calls GetChannelClientStateFunc.

func (*ChannelKeeperMock) GetChannelClientStateCalls

func (mock *ChannelKeeperMock) GetChannelClientStateCalls() []struct {
	Ctx       cosmossdktypes.Context
	PortID    string
	ChannelID string
}

GetChannelClientStateCalls gets all the calls that were made to GetChannelClientState. Check the length with:

len(mockedChannelKeeper.GetChannelClientStateCalls())

func (*ChannelKeeperMock) GetNextSequenceSend

func (mock *ChannelKeeperMock) GetNextSequenceSend(ctx cosmossdktypes.Context, portID string, channelID string) (uint64, bool)

GetNextSequenceSend calls GetNextSequenceSendFunc.

func (*ChannelKeeperMock) GetNextSequenceSendCalls

func (mock *ChannelKeeperMock) GetNextSequenceSendCalls() []struct {
	Ctx       cosmossdktypes.Context
	PortID    string
	ChannelID string
}

GetNextSequenceSendCalls gets all the calls that were made to GetNextSequenceSend. Check the length with:

len(mockedChannelKeeper.GetNextSequenceSendCalls())

type IBCTransferKeeperMock

type IBCTransferKeeperMock struct {
	// GetDenomTraceFunc mocks the GetDenomTrace method.
	GetDenomTraceFunc func(ctx cosmossdktypes.Context, denomTraceHash tmbytes.HexBytes) (ibctypes.DenomTrace, bool)

	// SendTransferFunc mocks the SendTransfer method.
	SendTransferFunc func(ctx cosmossdktypes.Context, sourcePort string, sourceChannel string, token cosmossdktypes.Coin, sender cosmossdktypes.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) error
	// contains filtered or unexported fields
}

IBCTransferKeeperMock is a mock implementation of axelarnettypes.IBCTransferKeeper.

func TestSomethingThatUsesIBCTransferKeeper(t *testing.T) {

	// make and configure a mocked axelarnettypes.IBCTransferKeeper
	mockedIBCTransferKeeper := &IBCTransferKeeperMock{
		GetDenomTraceFunc: func(ctx cosmossdktypes.Context, denomTraceHash tmbytes.HexBytes) (ibctypes.DenomTrace, bool) {
			panic("mock out the GetDenomTrace method")
		},
		SendTransferFunc: func(ctx cosmossdktypes.Context, sourcePort string, sourceChannel string, token cosmossdktypes.Coin, sender cosmossdktypes.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) error {
			panic("mock out the SendTransfer method")
		},
	}

	// use mockedIBCTransferKeeper in code that requires axelarnettypes.IBCTransferKeeper
	// and then make assertions.

}

func (*IBCTransferKeeperMock) GetDenomTrace

func (mock *IBCTransferKeeperMock) GetDenomTrace(ctx cosmossdktypes.Context, denomTraceHash tmbytes.HexBytes) (ibctypes.DenomTrace, bool)

GetDenomTrace calls GetDenomTraceFunc.

func (*IBCTransferKeeperMock) GetDenomTraceCalls

func (mock *IBCTransferKeeperMock) GetDenomTraceCalls() []struct {
	Ctx            cosmossdktypes.Context
	DenomTraceHash tmbytes.HexBytes
}

GetDenomTraceCalls gets all the calls that were made to GetDenomTrace. Check the length with:

len(mockedIBCTransferKeeper.GetDenomTraceCalls())

func (*IBCTransferKeeperMock) SendTransfer

func (mock *IBCTransferKeeperMock) SendTransfer(ctx cosmossdktypes.Context, sourcePort string, sourceChannel string, token cosmossdktypes.Coin, sender cosmossdktypes.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) error

SendTransfer calls SendTransferFunc.

func (*IBCTransferKeeperMock) SendTransferCalls

func (mock *IBCTransferKeeperMock) SendTransferCalls() []struct {
	Ctx              cosmossdktypes.Context
	SourcePort       string
	SourceChannel    string
	Token            cosmossdktypes.Coin
	Sender           cosmossdktypes.AccAddress
	Receiver         string
	TimeoutHeight    clienttypes.Height
	TimeoutTimestamp uint64
}

SendTransferCalls gets all the calls that were made to SendTransfer. Check the length with:

len(mockedIBCTransferKeeper.SendTransferCalls())

type NexusMock

type NexusMock struct {
	// ActivateChainFunc mocks the ActivateChain method.
	ActivateChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain)

	// ArchivePendingTransferFunc mocks the ArchivePendingTransfer method.
	ArchivePendingTransferFunc func(ctx cosmossdktypes.Context, transfer exported.CrossChainTransfer)

	// EnqueueForTransferFunc mocks the EnqueueForTransfer method.
	EnqueueForTransferFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, amount cosmossdktypes.Coin, feeRate cosmossdktypes.Dec) (exported.TransferID, error)

	// GetChainFunc mocks the GetChain method.
	GetChainFunc func(ctx cosmossdktypes.Context, chain string) (exported.Chain, bool)

	// GetRecipientFunc mocks the GetRecipient method.
	GetRecipientFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress) (exported.CrossChainAddress, bool)

	// GetTransferFeesFunc mocks the GetTransferFees method.
	GetTransferFeesFunc func(ctx cosmossdktypes.Context) cosmossdktypes.Coins

	// GetTransfersForChainFunc mocks the GetTransfersForChain method.
	GetTransfersForChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain, state exported.TransferState) []exported.CrossChainTransfer

	// IsAssetRegisteredFunc mocks the IsAssetRegistered method.
	IsAssetRegisteredFunc func(ctx cosmossdktypes.Context, chain exported.Chain, denom string) bool

	// LinkAddressesFunc mocks the LinkAddresses method.
	LinkAddressesFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, recipient exported.CrossChainAddress) error

	// RegisterAssetFunc mocks the RegisterAsset method.
	RegisterAssetFunc func(ctx cosmossdktypes.Context, chain exported.Chain, denom string)

	// SetChainFunc mocks the SetChain method.
	SetChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain)

	// SubTransferFeeFunc mocks the SubTransferFee method.
	SubTransferFeeFunc func(ctx cosmossdktypes.Context, coin cosmossdktypes.Coin)
	// contains filtered or unexported fields
}

NexusMock is a mock implementation of axelarnettypes.Nexus.

func TestSomethingThatUsesNexus(t *testing.T) {

	// make and configure a mocked axelarnettypes.Nexus
	mockedNexus := &NexusMock{
		ActivateChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain)  {
			panic("mock out the ActivateChain method")
		},
		ArchivePendingTransferFunc: func(ctx cosmossdktypes.Context, transfer exported.CrossChainTransfer)  {
			panic("mock out the ArchivePendingTransfer method")
		},
		EnqueueForTransferFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, amount cosmossdktypes.Coin, feeRate cosmossdktypes.Dec) (exported.TransferID, error) {
			panic("mock out the EnqueueForTransfer method")
		},
		GetChainFunc: func(ctx cosmossdktypes.Context, chain string) (exported.Chain, bool) {
			panic("mock out the GetChain method")
		},
		GetRecipientFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress) (exported.CrossChainAddress, bool) {
			panic("mock out the GetRecipient method")
		},
		GetTransferFeesFunc: func(ctx cosmossdktypes.Context) cosmossdktypes.Coins {
			panic("mock out the GetTransferFees method")
		},
		GetTransfersForChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, state exported.TransferState) []exported.CrossChainTransfer {
			panic("mock out the GetTransfersForChain method")
		},
		IsAssetRegisteredFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, denom string) bool {
			panic("mock out the IsAssetRegistered method")
		},
		LinkAddressesFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, recipient exported.CrossChainAddress) error {
			panic("mock out the LinkAddresses method")
		},
		RegisterAssetFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, denom string)  {
			panic("mock out the RegisterAsset method")
		},
		SetChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain)  {
			panic("mock out the SetChain method")
		},
		SubTransferFeeFunc: func(ctx cosmossdktypes.Context, coin cosmossdktypes.Coin)  {
			panic("mock out the SubTransferFee method")
		},
	}

	// use mockedNexus in code that requires axelarnettypes.Nexus
	// and then make assertions.

}

func (*NexusMock) ActivateChain added in v0.12.0

func (mock *NexusMock) ActivateChain(ctx cosmossdktypes.Context, chain exported.Chain)

ActivateChain calls ActivateChainFunc.

func (*NexusMock) ActivateChainCalls added in v0.12.0

func (mock *NexusMock) ActivateChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain exported.Chain
}

ActivateChainCalls gets all the calls that were made to ActivateChain. Check the length with:

len(mockedNexus.ActivateChainCalls())

func (*NexusMock) ArchivePendingTransfer

func (mock *NexusMock) ArchivePendingTransfer(ctx cosmossdktypes.Context, transfer exported.CrossChainTransfer)

ArchivePendingTransfer calls ArchivePendingTransferFunc.

func (*NexusMock) ArchivePendingTransferCalls

func (mock *NexusMock) ArchivePendingTransferCalls() []struct {
	Ctx      cosmossdktypes.Context
	Transfer exported.CrossChainTransfer
}

ArchivePendingTransferCalls gets all the calls that were made to ArchivePendingTransfer. Check the length with:

len(mockedNexus.ArchivePendingTransferCalls())

func (*NexusMock) EnqueueForTransfer

func (mock *NexusMock) EnqueueForTransfer(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, amount cosmossdktypes.Coin, feeRate cosmossdktypes.Dec) (exported.TransferID, error)

EnqueueForTransfer calls EnqueueForTransferFunc.

func (*NexusMock) EnqueueForTransferCalls

func (mock *NexusMock) EnqueueForTransferCalls() []struct {
	Ctx     cosmossdktypes.Context
	Sender  exported.CrossChainAddress
	Amount  cosmossdktypes.Coin
	FeeRate cosmossdktypes.Dec
}

EnqueueForTransferCalls gets all the calls that were made to EnqueueForTransfer. Check the length with:

len(mockedNexus.EnqueueForTransferCalls())

func (*NexusMock) GetChain

func (mock *NexusMock) GetChain(ctx cosmossdktypes.Context, chain string) (exported.Chain, bool)

GetChain calls GetChainFunc.

func (*NexusMock) GetChainCalls

func (mock *NexusMock) GetChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain string
}

GetChainCalls gets all the calls that were made to GetChain. Check the length with:

len(mockedNexus.GetChainCalls())

func (*NexusMock) GetRecipient

GetRecipient calls GetRecipientFunc.

func (*NexusMock) GetRecipientCalls

func (mock *NexusMock) GetRecipientCalls() []struct {
	Ctx    cosmossdktypes.Context
	Sender exported.CrossChainAddress
}

GetRecipientCalls gets all the calls that were made to GetRecipient. Check the length with:

len(mockedNexus.GetRecipientCalls())

func (*NexusMock) GetTransferFees added in v0.11.1

func (mock *NexusMock) GetTransferFees(ctx cosmossdktypes.Context) cosmossdktypes.Coins

GetTransferFees calls GetTransferFeesFunc.

func (*NexusMock) GetTransferFeesCalls added in v0.11.1

func (mock *NexusMock) GetTransferFeesCalls() []struct {
	Ctx cosmossdktypes.Context
}

GetTransferFeesCalls gets all the calls that were made to GetTransferFees. Check the length with:

len(mockedNexus.GetTransferFeesCalls())

func (*NexusMock) GetTransfersForChain

func (mock *NexusMock) GetTransfersForChain(ctx cosmossdktypes.Context, chain exported.Chain, state exported.TransferState) []exported.CrossChainTransfer

GetTransfersForChain calls GetTransfersForChainFunc.

func (*NexusMock) GetTransfersForChainCalls

func (mock *NexusMock) GetTransfersForChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain exported.Chain
	State exported.TransferState
}

GetTransfersForChainCalls gets all the calls that were made to GetTransfersForChain. Check the length with:

len(mockedNexus.GetTransfersForChainCalls())

func (*NexusMock) IsAssetRegistered

func (mock *NexusMock) IsAssetRegistered(ctx cosmossdktypes.Context, chain exported.Chain, denom string) bool

IsAssetRegistered calls IsAssetRegisteredFunc.

func (*NexusMock) IsAssetRegisteredCalls

func (mock *NexusMock) IsAssetRegisteredCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain exported.Chain
	Denom string
}

IsAssetRegisteredCalls gets all the calls that were made to IsAssetRegistered. Check the length with:

len(mockedNexus.IsAssetRegisteredCalls())

func (*NexusMock) LinkAddresses

func (mock *NexusMock) LinkAddresses(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, recipient exported.CrossChainAddress) error

LinkAddresses calls LinkAddressesFunc.

func (*NexusMock) LinkAddressesCalls

func (mock *NexusMock) LinkAddressesCalls() []struct {
	Ctx       cosmossdktypes.Context
	Sender    exported.CrossChainAddress
	Recipient exported.CrossChainAddress
}

LinkAddressesCalls gets all the calls that were made to LinkAddresses. Check the length with:

len(mockedNexus.LinkAddressesCalls())

func (*NexusMock) RegisterAsset

func (mock *NexusMock) RegisterAsset(ctx cosmossdktypes.Context, chain exported.Chain, denom string)

RegisterAsset calls RegisterAssetFunc.

func (*NexusMock) RegisterAssetCalls

func (mock *NexusMock) RegisterAssetCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain exported.Chain
	Denom string
}

RegisterAssetCalls gets all the calls that were made to RegisterAsset. Check the length with:

len(mockedNexus.RegisterAssetCalls())

func (*NexusMock) SetChain

func (mock *NexusMock) SetChain(ctx cosmossdktypes.Context, chain exported.Chain)

SetChain calls SetChainFunc.

func (*NexusMock) SetChainCalls

func (mock *NexusMock) SetChainCalls() []struct {
	Ctx   cosmossdktypes.Context
	Chain exported.Chain
}

SetChainCalls gets all the calls that were made to SetChain. Check the length with:

len(mockedNexus.SetChainCalls())

func (*NexusMock) SubTransferFee added in v0.11.1

func (mock *NexusMock) SubTransferFee(ctx cosmossdktypes.Context, coin cosmossdktypes.Coin)

SubTransferFee calls SubTransferFeeFunc.

func (*NexusMock) SubTransferFeeCalls added in v0.11.1

func (mock *NexusMock) SubTransferFeeCalls() []struct {
	Ctx  cosmossdktypes.Context
	Coin cosmossdktypes.Coin
}

SubTransferFeeCalls gets all the calls that were made to SubTransferFee. Check the length with:

len(mockedNexus.SubTransferFeeCalls())

Jump to

Keyboard shortcuts

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