mock

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeperMock added in v0.35.0

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 nexustypes.AccountKeeper.

func TestSomethingThatUsesAccountKeeper(t *testing.T) {

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

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

}

func (*AccountKeeperMock) GetModuleAddress added in v0.35.0

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

GetModuleAddress calls GetModuleAddressFunc.

func (*AccountKeeperMock) GetModuleAddressCalls added in v0.35.0

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 AxelarnetKeeperMock

type AxelarnetKeeperMock struct {
	// IsCosmosChainFunc mocks the IsCosmosChain method.
	IsCosmosChainFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) bool
	// contains filtered or unexported fields
}

AxelarnetKeeperMock is a mock implementation of nexustypes.AxelarnetKeeper.

func TestSomethingThatUsesAxelarnetKeeper(t *testing.T) {

	// make and configure a mocked nexustypes.AxelarnetKeeper
	mockedAxelarnetKeeper := &AxelarnetKeeperMock{
		IsCosmosChainFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) bool {
			panic("mock out the IsCosmosChain method")
		},
	}

	// use mockedAxelarnetKeeper in code that requires nexustypes.AxelarnetKeeper
	// and then make assertions.

}

func (*AxelarnetKeeperMock) IsCosmosChain added in v0.13.0

IsCosmosChain calls IsCosmosChainFunc.

func (*AxelarnetKeeperMock) IsCosmosChainCalls added in v0.13.0

IsCosmosChainCalls gets all the calls that were made to IsCosmosChain. Check the length with:

len(mockedAxelarnetKeeper.IsCosmosChainCalls())

type NexusMock

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

	// AddChainMaintainerFunc mocks the AddChainMaintainer method.
	AddChainMaintainerFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, validator cosmossdktypes.ValAddress) error

	// DeactivateChainFunc mocks the DeactivateChain method.
	DeactivateChainFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain)

	// DequeueRouteMessageFunc mocks the DequeueRouteMessage method.
	DequeueRouteMessageFunc func(ctx cosmossdktypes.Context) (github_com_axelarnetwork_axelar_core_x_nexus_exported.GeneralMessage, bool)

	// ExportGenesisFunc mocks the ExportGenesis method.
	ExportGenesisFunc func(ctx cosmossdktypes.Context) *nexustypes.GenesisState

	// GenerateMessageIDFunc mocks the GenerateMessageID method.
	GenerateMessageIDFunc func(ctx cosmossdktypes.Context) (string, []byte, uint64)

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

	// GetChainMaintainerStatesFunc mocks the GetChainMaintainerStates method.
	GetChainMaintainerStatesFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) []github_com_axelarnetwork_axelar_core_x_nexus_exported.MaintainerState

	// GetChainMaintainersFunc mocks the GetChainMaintainers method.
	GetChainMaintainersFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) []cosmossdktypes.ValAddress

	// GetChainsFunc mocks the GetChains method.
	GetChainsFunc func(ctx cosmossdktypes.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain

	// GetFeeInfoFunc mocks the GetFeeInfo method.
	GetFeeInfoFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, asset string) github_com_axelarnetwork_axelar_core_x_nexus_exported.FeeInfo

	// GetParamsFunc mocks the GetParams method.
	GetParamsFunc func(ctx cosmossdktypes.Context) nexustypes.Params

	// InitGenesisFunc mocks the InitGenesis method.
	InitGenesisFunc func(ctx cosmossdktypes.Context, genState *nexustypes.GenesisState)

	// IsChainActivatedFunc mocks the IsChainActivated method.
	IsChainActivatedFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) bool

	// IsChainMaintainerFunc mocks the IsChainMaintainer method.
	IsChainMaintainerFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, maintainer cosmossdktypes.ValAddress) bool

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

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

	// RateLimitTransferFunc mocks the RateLimitTransfer method.
	RateLimitTransferFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName, asset cosmossdktypes.Coin, direction github_com_axelarnetwork_axelar_core_x_nexus_exported.TransferDirection) error

	// RegisterFeeFunc mocks the RegisterFee method.
	RegisterFeeFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, feeInfo github_com_axelarnetwork_axelar_core_x_nexus_exported.FeeInfo) error

	// RemoveChainMaintainerFunc mocks the RemoveChainMaintainer method.
	RemoveChainMaintainerFunc func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, validator cosmossdktypes.ValAddress) error

	// RouteMessageFunc mocks the RouteMessage method.
	RouteMessageFunc func(ctx cosmossdktypes.Context, id string, routingCtx ...github_com_axelarnetwork_axelar_core_x_nexus_exported.RoutingContext) error

	// SetMessageExecutedFunc mocks the SetMessageExecuted method.
	SetMessageExecutedFunc func(ctx cosmossdktypes.Context, id string) error

	// SetNewMessageFunc mocks the SetNewMessage method.
	SetNewMessageFunc func(ctx cosmossdktypes.Context, msg github_com_axelarnetwork_axelar_core_x_nexus_exported.GeneralMessage) error

	// SetParamsFunc mocks the SetParams method.
	SetParamsFunc func(ctx cosmossdktypes.Context, p nexustypes.Params)

	// SetRateLimitFunc mocks the SetRateLimit method.
	SetRateLimitFunc func(ctx cosmossdktypes.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName, limit cosmossdktypes.Coin, window time.Duration) error
	// contains filtered or unexported fields
}

NexusMock is a mock implementation of nexustypes.Nexus.

func TestSomethingThatUsesNexus(t *testing.T) {

	// make and configure a mocked nexustypes.Nexus
	mockedNexus := &NexusMock{
		ActivateChainFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain)  {
			panic("mock out the ActivateChain method")
		},
		AddChainMaintainerFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, validator cosmossdktypes.ValAddress) error {
			panic("mock out the AddChainMaintainer method")
		},
		DeactivateChainFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain)  {
			panic("mock out the DeactivateChain method")
		},
		DequeueRouteMessageFunc: func(ctx cosmossdktypes.Context) (github_com_axelarnetwork_axelar_core_x_nexus_exported.GeneralMessage, bool) {
			panic("mock out the DequeueRouteMessage method")
		},
		ExportGenesisFunc: func(ctx cosmossdktypes.Context) *nexustypes.GenesisState {
			panic("mock out the ExportGenesis method")
		},
		GenerateMessageIDFunc: func(ctx cosmossdktypes.Context) (string, []byte, uint64) {
			panic("mock out the GenerateMessageID method")
		},
		GetChainFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, bool) {
			panic("mock out the GetChain method")
		},
		GetChainMaintainerStatesFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) []github_com_axelarnetwork_axelar_core_x_nexus_exported.MaintainerState {
			panic("mock out the GetChainMaintainerStates method")
		},
		GetChainMaintainersFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) []cosmossdktypes.ValAddress {
			panic("mock out the GetChainMaintainers method")
		},
		GetChainsFunc: func(ctx cosmossdktypes.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain {
			panic("mock out the GetChains method")
		},
		GetFeeInfoFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, asset string) github_com_axelarnetwork_axelar_core_x_nexus_exported.FeeInfo {
			panic("mock out the GetFeeInfo method")
		},
		GetParamsFunc: func(ctx cosmossdktypes.Context) nexustypes.Params {
			panic("mock out the GetParams method")
		},
		InitGenesisFunc: func(ctx cosmossdktypes.Context, genState *nexustypes.GenesisState)  {
			panic("mock out the InitGenesis method")
		},
		IsChainActivatedFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain) bool {
			panic("mock out the IsChainActivated method")
		},
		IsChainMaintainerFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, maintainer cosmossdktypes.ValAddress) bool {
			panic("mock out the IsChainMaintainer method")
		},
		LinkAddressesFunc: func(ctx cosmossdktypes.Context, sender github_com_axelarnetwork_axelar_core_x_nexus_exported.CrossChainAddress, recipient github_com_axelarnetwork_axelar_core_x_nexus_exported.CrossChainAddress) error {
			panic("mock out the LinkAddresses method")
		},
		LoggerFunc: func(ctx cosmossdktypes.Context) log.Logger {
			panic("mock out the Logger method")
		},
		RateLimitTransferFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName, asset cosmossdktypes.Coin, direction github_com_axelarnetwork_axelar_core_x_nexus_exported.TransferDirection) error {
			panic("mock out the RateLimitTransfer method")
		},
		RegisterFeeFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, feeInfo github_com_axelarnetwork_axelar_core_x_nexus_exported.FeeInfo) error {
			panic("mock out the RegisterFee method")
		},
		RemoveChainMaintainerFunc: func(ctx cosmossdktypes.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, validator cosmossdktypes.ValAddress) error {
			panic("mock out the RemoveChainMaintainer method")
		},
		RouteMessageFunc: func(ctx cosmossdktypes.Context, id string, routingCtx ...github_com_axelarnetwork_axelar_core_x_nexus_exported.RoutingContext) error {
			panic("mock out the RouteMessage method")
		},
		SetMessageExecutedFunc: func(ctx cosmossdktypes.Context, id string) error {
			panic("mock out the SetMessageExecuted method")
		},
		SetNewMessageFunc: func(ctx cosmossdktypes.Context, msg github_com_axelarnetwork_axelar_core_x_nexus_exported.GeneralMessage) error {
			panic("mock out the SetNewMessage method")
		},
		SetParamsFunc: func(ctx cosmossdktypes.Context, p nexustypes.Params)  {
			panic("mock out the SetParams method")
		},
		SetRateLimitFunc: func(ctx cosmossdktypes.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName, limit cosmossdktypes.Coin, window time.Duration) error {
			panic("mock out the SetRateLimit method")
		},
	}

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

}

func (*NexusMock) ActivateChain

ActivateChain calls ActivateChainFunc.

func (*NexusMock) ActivateChainCalls

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

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

len(mockedNexus.ActivateChainCalls())

func (*NexusMock) AddChainMaintainer

AddChainMaintainer calls AddChainMaintainerFunc.

func (*NexusMock) AddChainMaintainerCalls

func (mock *NexusMock) AddChainMaintainerCalls() []struct {
	Ctx       cosmossdktypes.Context
	Chain     github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain
	Validator cosmossdktypes.ValAddress
}

AddChainMaintainerCalls gets all the calls that were made to AddChainMaintainer. Check the length with:

len(mockedNexus.AddChainMaintainerCalls())

func (*NexusMock) DeactivateChain added in v0.12.0

DeactivateChain calls DeactivateChainFunc.

func (*NexusMock) DeactivateChainCalls added in v0.12.0

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

DeactivateChainCalls gets all the calls that were made to DeactivateChain. Check the length with:

len(mockedNexus.DeactivateChainCalls())

func (*NexusMock) DequeueRouteMessage added in v0.35.0

DequeueRouteMessage calls DequeueRouteMessageFunc.

func (*NexusMock) DequeueRouteMessageCalls added in v0.35.0

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

DequeueRouteMessageCalls gets all the calls that were made to DequeueRouteMessage. Check the length with:

len(mockedNexus.DequeueRouteMessageCalls())

func (*NexusMock) ExportGenesis added in v0.9.0

func (mock *NexusMock) ExportGenesis(ctx cosmossdktypes.Context) *nexustypes.GenesisState

ExportGenesis calls ExportGenesisFunc.

func (*NexusMock) ExportGenesisCalls added in v0.9.0

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

ExportGenesisCalls gets all the calls that were made to ExportGenesis. Check the length with:

len(mockedNexus.ExportGenesisCalls())

func (*NexusMock) GenerateMessageID added in v0.35.0

func (mock *NexusMock) GenerateMessageID(ctx cosmossdktypes.Context) (string, []byte, uint64)

GenerateMessageID calls GenerateMessageIDFunc.

func (*NexusMock) GenerateMessageIDCalls added in v0.35.0

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

GenerateMessageIDCalls gets all the calls that were made to GenerateMessageID. Check the length with:

len(mockedNexus.GenerateMessageIDCalls())

func (*NexusMock) GetChainCalls

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

len(mockedNexus.GetChainCalls())

func (*NexusMock) GetChainMaintainerStates added in v0.18.0

GetChainMaintainerStates calls GetChainMaintainerStatesFunc.

func (*NexusMock) GetChainMaintainerStatesCalls added in v0.18.0

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

GetChainMaintainerStatesCalls gets all the calls that were made to GetChainMaintainerStates. Check the length with:

len(mockedNexus.GetChainMaintainerStatesCalls())

func (*NexusMock) GetChainMaintainers

GetChainMaintainers calls GetChainMaintainersFunc.

func (*NexusMock) GetChainMaintainersCalls

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

GetChainMaintainersCalls gets all the calls that were made to GetChainMaintainers. Check the length with:

len(mockedNexus.GetChainMaintainersCalls())

func (*NexusMock) GetChains

GetChains calls GetChainsFunc.

func (*NexusMock) GetChainsCalls

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

GetChainsCalls gets all the calls that were made to GetChains. Check the length with:

len(mockedNexus.GetChainsCalls())

func (*NexusMock) GetFeeInfo added in v0.15.0

GetFeeInfo calls GetFeeInfoFunc.

func (*NexusMock) GetFeeInfoCalls added in v0.15.0

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

GetFeeInfoCalls gets all the calls that were made to GetFeeInfo. Check the length with:

len(mockedNexus.GetFeeInfoCalls())

func (*NexusMock) GetParams

func (mock *NexusMock) GetParams(ctx cosmossdktypes.Context) nexustypes.Params

GetParams calls GetParamsFunc.

func (*NexusMock) GetParamsCalls

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

GetParamsCalls gets all the calls that were made to GetParams. Check the length with:

len(mockedNexus.GetParamsCalls())

func (*NexusMock) InitGenesis added in v0.9.0

func (mock *NexusMock) InitGenesis(ctx cosmossdktypes.Context, genState *nexustypes.GenesisState)

InitGenesis calls InitGenesisFunc.

func (*NexusMock) InitGenesisCalls added in v0.9.0

func (mock *NexusMock) InitGenesisCalls() []struct {
	Ctx      cosmossdktypes.Context
	GenState *nexustypes.GenesisState
}

InitGenesisCalls gets all the calls that were made to InitGenesis. Check the length with:

len(mockedNexus.InitGenesisCalls())

func (*NexusMock) IsChainActivated

IsChainActivated calls IsChainActivatedFunc.

func (*NexusMock) IsChainActivatedCalls

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

IsChainActivatedCalls gets all the calls that were made to IsChainActivated. Check the length with:

len(mockedNexus.IsChainActivatedCalls())

func (*NexusMock) IsChainMaintainer

IsChainMaintainer calls IsChainMaintainerFunc.

func (*NexusMock) IsChainMaintainerCalls

func (mock *NexusMock) IsChainMaintainerCalls() []struct {
	Ctx        cosmossdktypes.Context
	Chain      github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain
	Maintainer cosmossdktypes.ValAddress
}

IsChainMaintainerCalls gets all the calls that were made to IsChainMaintainer. Check the length with:

len(mockedNexus.IsChainMaintainerCalls())

func (*NexusMock) LinkAddresses added in v0.9.0

LinkAddresses calls LinkAddressesFunc.

func (*NexusMock) LinkAddressesCalls added in v0.9.0

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

len(mockedNexus.LinkAddressesCalls())

func (*NexusMock) Logger

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

Logger calls LoggerFunc.

func (*NexusMock) LoggerCalls

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

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

len(mockedNexus.LoggerCalls())

func (*NexusMock) RateLimitTransfer added in v0.27.0

RateLimitTransfer calls RateLimitTransferFunc.

func (*NexusMock) RateLimitTransferCalls added in v0.27.0

RateLimitTransferCalls gets all the calls that were made to RateLimitTransfer. Check the length with:

len(mockedNexus.RateLimitTransferCalls())

func (*NexusMock) RegisterFee added in v0.15.0

RegisterFee calls RegisterFeeFunc.

func (*NexusMock) RegisterFeeCalls added in v0.15.0

RegisterFeeCalls gets all the calls that were made to RegisterFee. Check the length with:

len(mockedNexus.RegisterFeeCalls())

func (*NexusMock) RemoveChainMaintainer

RemoveChainMaintainer calls RemoveChainMaintainerFunc.

func (*NexusMock) RemoveChainMaintainerCalls

func (mock *NexusMock) RemoveChainMaintainerCalls() []struct {
	Ctx       cosmossdktypes.Context
	Chain     github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain
	Validator cosmossdktypes.ValAddress
}

RemoveChainMaintainerCalls gets all the calls that were made to RemoveChainMaintainer. Check the length with:

len(mockedNexus.RemoveChainMaintainerCalls())

func (*NexusMock) RouteMessage added in v0.35.0

RouteMessage calls RouteMessageFunc.

func (*NexusMock) RouteMessageCalls added in v0.35.0

func (mock *NexusMock) RouteMessageCalls() []struct {
	Ctx        cosmossdktypes.Context
	ID         string
	RoutingCtx []github_com_axelarnetwork_axelar_core_x_nexus_exported.RoutingContext
}

RouteMessageCalls gets all the calls that were made to RouteMessage. Check the length with:

len(mockedNexus.RouteMessageCalls())

func (*NexusMock) SetMessageExecuted added in v0.35.0

func (mock *NexusMock) SetMessageExecuted(ctx cosmossdktypes.Context, id string) error

SetMessageExecuted calls SetMessageExecutedFunc.

func (*NexusMock) SetMessageExecutedCalls added in v0.35.0

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

SetMessageExecutedCalls gets all the calls that were made to SetMessageExecuted. Check the length with:

len(mockedNexus.SetMessageExecutedCalls())

func (*NexusMock) SetNewMessage added in v0.35.0

SetNewMessage calls SetNewMessageFunc.

func (*NexusMock) SetNewMessageCalls added in v0.35.0

SetNewMessageCalls gets all the calls that were made to SetNewMessage. Check the length with:

len(mockedNexus.SetNewMessageCalls())

func (*NexusMock) SetParams

func (mock *NexusMock) SetParams(ctx cosmossdktypes.Context, p nexustypes.Params)

SetParams calls SetParamsFunc.

func (*NexusMock) SetParamsCalls

func (mock *NexusMock) SetParamsCalls() []struct {
	Ctx cosmossdktypes.Context
	P   nexustypes.Params
}

SetParamsCalls gets all the calls that were made to SetParams. Check the length with:

len(mockedNexus.SetParamsCalls())

func (*NexusMock) SetRateLimit added in v0.27.0

SetRateLimit calls SetRateLimitFunc.

func (*NexusMock) SetRateLimitCalls added in v0.27.0

func (mock *NexusMock) SetRateLimitCalls() []struct {
	Ctx       cosmossdktypes.Context
	ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName
	Limit     cosmossdktypes.Coin
	Window    time.Duration
}

SetRateLimitCalls gets all the calls that were made to SetRateLimit. Check the length with:

len(mockedNexus.SetRateLimitCalls())

type RewardKeeperMock added in v0.18.0

type RewardKeeperMock struct {
	// GetPoolFunc mocks the GetPool method.
	GetPoolFunc func(ctx cosmossdktypes.Context, name string) reward.RewardPool
	// contains filtered or unexported fields
}

RewardKeeperMock is a mock implementation of nexustypes.RewardKeeper.

func TestSomethingThatUsesRewardKeeper(t *testing.T) {

	// make and configure a mocked nexustypes.RewardKeeper
	mockedRewardKeeper := &RewardKeeperMock{
		GetPoolFunc: func(ctx cosmossdktypes.Context, name string) reward.RewardPool {
			panic("mock out the GetPool method")
		},
	}

	// use mockedRewardKeeper in code that requires nexustypes.RewardKeeper
	// and then make assertions.

}

func (*RewardKeeperMock) GetPool added in v0.18.0

GetPool calls GetPoolFunc.

func (*RewardKeeperMock) GetPoolCalls added in v0.18.0

func (mock *RewardKeeperMock) GetPoolCalls() []struct {
	Ctx  cosmossdktypes.Context
	Name string
}

GetPoolCalls gets all the calls that were made to GetPool. Check the length with:

len(mockedRewardKeeper.GetPoolCalls())

type SlashingKeeperMock added in v0.21.0

type SlashingKeeperMock struct {
	// IsTombstonedFunc mocks the IsTombstoned method.
	IsTombstonedFunc func(ctx cosmossdktypes.Context, consAddr cosmossdktypes.ConsAddress) bool
	// contains filtered or unexported fields
}

SlashingKeeperMock is a mock implementation of nexustypes.SlashingKeeper.

func TestSomethingThatUsesSlashingKeeper(t *testing.T) {

	// make and configure a mocked nexustypes.SlashingKeeper
	mockedSlashingKeeper := &SlashingKeeperMock{
		IsTombstonedFunc: func(ctx cosmossdktypes.Context, consAddr cosmossdktypes.ConsAddress) bool {
			panic("mock out the IsTombstoned method")
		},
	}

	// use mockedSlashingKeeper in code that requires nexustypes.SlashingKeeper
	// and then make assertions.

}

func (*SlashingKeeperMock) IsTombstoned added in v0.21.0

func (mock *SlashingKeeperMock) IsTombstoned(ctx cosmossdktypes.Context, consAddr cosmossdktypes.ConsAddress) bool

IsTombstoned calls IsTombstonedFunc.

func (*SlashingKeeperMock) IsTombstonedCalls added in v0.21.0

func (mock *SlashingKeeperMock) IsTombstonedCalls() []struct {
	Ctx      cosmossdktypes.Context
	ConsAddr cosmossdktypes.ConsAddress
}

IsTombstonedCalls gets all the calls that were made to IsTombstoned. Check the length with:

len(mockedSlashingKeeper.IsTombstonedCalls())

type SnapshotterMock

type SnapshotterMock struct {
	// CreateSnapshotFunc mocks the CreateSnapshot method.
	CreateSnapshotFunc func(ctx cosmossdktypes.Context, candidates []cosmossdktypes.ValAddress, filterFunc func(snapshot.ValidatorI) bool, weightFunc func(consensusPower cosmossdktypes.Uint) cosmossdktypes.Uint, threshold utils.Threshold) (snapshot.Snapshot, error)

	// GetOperatorFunc mocks the GetOperator method.
	GetOperatorFunc func(ctx cosmossdktypes.Context, proxy cosmossdktypes.AccAddress) cosmossdktypes.ValAddress

	// GetProxyFunc mocks the GetProxy method.
	GetProxyFunc func(ctx cosmossdktypes.Context, operator cosmossdktypes.ValAddress) (cosmossdktypes.AccAddress, bool)
	// contains filtered or unexported fields
}

SnapshotterMock is a mock implementation of nexustypes.Snapshotter.

func TestSomethingThatUsesSnapshotter(t *testing.T) {

	// make and configure a mocked nexustypes.Snapshotter
	mockedSnapshotter := &SnapshotterMock{
		CreateSnapshotFunc: func(ctx cosmossdktypes.Context, candidates []cosmossdktypes.ValAddress, filterFunc func(snapshot.ValidatorI) bool, weightFunc func(consensusPower cosmossdktypes.Uint) cosmossdktypes.Uint, threshold utils.Threshold) (snapshot.Snapshot, error) {
			panic("mock out the CreateSnapshot method")
		},
		GetOperatorFunc: func(ctx cosmossdktypes.Context, proxy cosmossdktypes.AccAddress) cosmossdktypes.ValAddress {
			panic("mock out the GetOperator method")
		},
		GetProxyFunc: func(ctx cosmossdktypes.Context, operator cosmossdktypes.ValAddress) (cosmossdktypes.AccAddress, bool) {
			panic("mock out the GetProxy method")
		},
	}

	// use mockedSnapshotter in code that requires nexustypes.Snapshotter
	// and then make assertions.

}

func (*SnapshotterMock) CreateSnapshot added in v0.21.0

func (mock *SnapshotterMock) CreateSnapshot(ctx cosmossdktypes.Context, candidates []cosmossdktypes.ValAddress, filterFunc func(snapshot.ValidatorI) bool, weightFunc func(consensusPower cosmossdktypes.Uint) cosmossdktypes.Uint, threshold utils.Threshold) (snapshot.Snapshot, error)

CreateSnapshot calls CreateSnapshotFunc.

func (*SnapshotterMock) CreateSnapshotCalls added in v0.21.0

func (mock *SnapshotterMock) CreateSnapshotCalls() []struct {
	Ctx        cosmossdktypes.Context
	Candidates []cosmossdktypes.ValAddress
	FilterFunc func(snapshot.ValidatorI) bool
	WeightFunc func(consensusPower cosmossdktypes.Uint) cosmossdktypes.Uint
	Threshold  utils.Threshold
}

CreateSnapshotCalls gets all the calls that were made to CreateSnapshot. Check the length with:

len(mockedSnapshotter.CreateSnapshotCalls())

func (*SnapshotterMock) GetOperator

GetOperator calls GetOperatorFunc.

func (*SnapshotterMock) GetOperatorCalls

func (mock *SnapshotterMock) GetOperatorCalls() []struct {
	Ctx   cosmossdktypes.Context
	Proxy cosmossdktypes.AccAddress
}

GetOperatorCalls gets all the calls that were made to GetOperator. Check the length with:

len(mockedSnapshotter.GetOperatorCalls())

func (*SnapshotterMock) GetProxy added in v0.18.0

GetProxy calls GetProxyFunc.

func (*SnapshotterMock) GetProxyCalls added in v0.18.0

func (mock *SnapshotterMock) GetProxyCalls() []struct {
	Ctx      cosmossdktypes.Context
	Operator cosmossdktypes.ValAddress
}

GetProxyCalls gets all the calls that were made to GetProxy. Check the length with:

len(mockedSnapshotter.GetProxyCalls())

type WasmKeeperMock added in v0.35.0

type WasmKeeperMock struct {
	// ClearContractAdminFunc mocks the ClearContractAdmin method.
	ClearContractAdminFunc func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress) error

	// CreateFunc mocks the Create method.
	CreateFunc func(ctx cosmossdktypes.Context, creator cosmossdktypes.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (uint64, []byte, error)

	// ExecuteFunc mocks the Execute method.
	ExecuteFunc func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, msg []byte, coins cosmossdktypes.Coins) ([]byte, error)

	// InstantiateFunc mocks the Instantiate method.
	InstantiateFunc func(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins) (cosmossdktypes.AccAddress, []byte, error)

	// Instantiate2Func mocks the Instantiate2 method.
	Instantiate2Func func(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins, salt []byte, fixMsg bool) (cosmossdktypes.AccAddress, []byte, error)

	// MigrateFunc mocks the Migrate method.
	MigrateFunc func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newCodeID uint64, msg []byte) ([]byte, error)

	// PinCodeFunc mocks the PinCode method.
	PinCodeFunc func(ctx cosmossdktypes.Context, codeID uint64) error

	// SetAccessConfigFunc mocks the SetAccessConfig method.
	SetAccessConfigFunc func(ctx cosmossdktypes.Context, codeID uint64, caller cosmossdktypes.AccAddress, newConfig wasmtypes.AccessConfig) error

	// SetContractInfoExtensionFunc mocks the SetContractInfoExtension method.
	SetContractInfoExtensionFunc func(ctx cosmossdktypes.Context, contract cosmossdktypes.AccAddress, extra wasmtypes.ContractInfoExtension) error

	// SudoFunc mocks the Sudo method.
	SudoFunc func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, msg []byte) ([]byte, error)

	// UnpinCodeFunc mocks the UnpinCode method.
	UnpinCodeFunc func(ctx cosmossdktypes.Context, codeID uint64) error

	// UpdateContractAdminFunc mocks the UpdateContractAdmin method.
	UpdateContractAdminFunc func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newAdmin cosmossdktypes.AccAddress) error
	// contains filtered or unexported fields
}

WasmKeeperMock is a mock implementation of nexustypes.WasmKeeper.

func TestSomethingThatUsesWasmKeeper(t *testing.T) {

	// make and configure a mocked nexustypes.WasmKeeper
	mockedWasmKeeper := &WasmKeeperMock{
		ClearContractAdminFunc: func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress) error {
			panic("mock out the ClearContractAdmin method")
		},
		CreateFunc: func(ctx cosmossdktypes.Context, creator cosmossdktypes.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (uint64, []byte, error) {
			panic("mock out the Create method")
		},
		ExecuteFunc: func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, msg []byte, coins cosmossdktypes.Coins) ([]byte, error) {
			panic("mock out the Execute method")
		},
		InstantiateFunc: func(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins) (cosmossdktypes.AccAddress, []byte, error) {
			panic("mock out the Instantiate method")
		},
		Instantiate2Func: func(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins, salt []byte, fixMsg bool) (cosmossdktypes.AccAddress, []byte, error) {
			panic("mock out the Instantiate2 method")
		},
		MigrateFunc: func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newCodeID uint64, msg []byte) ([]byte, error) {
			panic("mock out the Migrate method")
		},
		PinCodeFunc: func(ctx cosmossdktypes.Context, codeID uint64) error {
			panic("mock out the PinCode method")
		},
		SetAccessConfigFunc: func(ctx cosmossdktypes.Context, codeID uint64, caller cosmossdktypes.AccAddress, newConfig wasmtypes.AccessConfig) error {
			panic("mock out the SetAccessConfig method")
		},
		SetContractInfoExtensionFunc: func(ctx cosmossdktypes.Context, contract cosmossdktypes.AccAddress, extra wasmtypes.ContractInfoExtension) error {
			panic("mock out the SetContractInfoExtension method")
		},
		SudoFunc: func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, msg []byte) ([]byte, error) {
			panic("mock out the Sudo method")
		},
		UnpinCodeFunc: func(ctx cosmossdktypes.Context, codeID uint64) error {
			panic("mock out the UnpinCode method")
		},
		UpdateContractAdminFunc: func(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newAdmin cosmossdktypes.AccAddress) error {
			panic("mock out the UpdateContractAdmin method")
		},
	}

	// use mockedWasmKeeper in code that requires nexustypes.WasmKeeper
	// and then make assertions.

}

func (*WasmKeeperMock) ClearContractAdmin added in v0.35.0

func (mock *WasmKeeperMock) ClearContractAdmin(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress) error

ClearContractAdmin calls ClearContractAdminFunc.

func (*WasmKeeperMock) ClearContractAdminCalls added in v0.35.0

func (mock *WasmKeeperMock) ClearContractAdminCalls() []struct {
	Ctx             cosmossdktypes.Context
	ContractAddress cosmossdktypes.AccAddress
	Caller          cosmossdktypes.AccAddress
}

ClearContractAdminCalls gets all the calls that were made to ClearContractAdmin. Check the length with:

len(mockedWasmKeeper.ClearContractAdminCalls())

func (*WasmKeeperMock) Create added in v0.35.0

func (mock *WasmKeeperMock) Create(ctx cosmossdktypes.Context, creator cosmossdktypes.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (uint64, []byte, error)

Create calls CreateFunc.

func (*WasmKeeperMock) CreateCalls added in v0.35.0

func (mock *WasmKeeperMock) CreateCalls() []struct {
	Ctx               cosmossdktypes.Context
	Creator           cosmossdktypes.AccAddress
	WasmCode          []byte
	InstantiateAccess *wasmtypes.AccessConfig
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedWasmKeeper.CreateCalls())

func (*WasmKeeperMock) Execute added in v0.35.0

func (mock *WasmKeeperMock) Execute(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, msg []byte, coins cosmossdktypes.Coins) ([]byte, error)

Execute calls ExecuteFunc.

func (*WasmKeeperMock) ExecuteCalls added in v0.35.0

func (mock *WasmKeeperMock) ExecuteCalls() []struct {
	Ctx             cosmossdktypes.Context
	ContractAddress cosmossdktypes.AccAddress
	Caller          cosmossdktypes.AccAddress
	Msg             []byte
	Coins           cosmossdktypes.Coins
}

ExecuteCalls gets all the calls that were made to Execute. Check the length with:

len(mockedWasmKeeper.ExecuteCalls())

func (*WasmKeeperMock) Instantiate added in v0.35.0

func (mock *WasmKeeperMock) Instantiate(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins) (cosmossdktypes.AccAddress, []byte, error)

Instantiate calls InstantiateFunc.

func (*WasmKeeperMock) Instantiate2 added in v0.35.0

func (mock *WasmKeeperMock) Instantiate2(ctx cosmossdktypes.Context, codeID uint64, creator cosmossdktypes.AccAddress, admin cosmossdktypes.AccAddress, initMsg []byte, label string, deposit cosmossdktypes.Coins, salt []byte, fixMsg bool) (cosmossdktypes.AccAddress, []byte, error)

Instantiate2 calls Instantiate2Func.

func (*WasmKeeperMock) Instantiate2Calls added in v0.35.0

func (mock *WasmKeeperMock) Instantiate2Calls() []struct {
	Ctx     cosmossdktypes.Context
	CodeID  uint64
	Creator cosmossdktypes.AccAddress
	Admin   cosmossdktypes.AccAddress
	InitMsg []byte
	Label   string
	Deposit cosmossdktypes.Coins
	Salt    []byte
	FixMsg  bool
}

Instantiate2Calls gets all the calls that were made to Instantiate2. Check the length with:

len(mockedWasmKeeper.Instantiate2Calls())

func (*WasmKeeperMock) InstantiateCalls added in v0.35.0

func (mock *WasmKeeperMock) InstantiateCalls() []struct {
	Ctx     cosmossdktypes.Context
	CodeID  uint64
	Creator cosmossdktypes.AccAddress
	Admin   cosmossdktypes.AccAddress
	InitMsg []byte
	Label   string
	Deposit cosmossdktypes.Coins
}

InstantiateCalls gets all the calls that were made to Instantiate. Check the length with:

len(mockedWasmKeeper.InstantiateCalls())

func (*WasmKeeperMock) Migrate added in v0.35.0

func (mock *WasmKeeperMock) Migrate(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newCodeID uint64, msg []byte) ([]byte, error)

Migrate calls MigrateFunc.

func (*WasmKeeperMock) MigrateCalls added in v0.35.0

func (mock *WasmKeeperMock) MigrateCalls() []struct {
	Ctx             cosmossdktypes.Context
	ContractAddress cosmossdktypes.AccAddress
	Caller          cosmossdktypes.AccAddress
	NewCodeID       uint64
	Msg             []byte
}

MigrateCalls gets all the calls that were made to Migrate. Check the length with:

len(mockedWasmKeeper.MigrateCalls())

func (*WasmKeeperMock) PinCode added in v0.35.0

func (mock *WasmKeeperMock) PinCode(ctx cosmossdktypes.Context, codeID uint64) error

PinCode calls PinCodeFunc.

func (*WasmKeeperMock) PinCodeCalls added in v0.35.0

func (mock *WasmKeeperMock) PinCodeCalls() []struct {
	Ctx    cosmossdktypes.Context
	CodeID uint64
}

PinCodeCalls gets all the calls that were made to PinCode. Check the length with:

len(mockedWasmKeeper.PinCodeCalls())

func (*WasmKeeperMock) SetAccessConfig added in v0.35.0

func (mock *WasmKeeperMock) SetAccessConfig(ctx cosmossdktypes.Context, codeID uint64, caller cosmossdktypes.AccAddress, newConfig wasmtypes.AccessConfig) error

SetAccessConfig calls SetAccessConfigFunc.

func (*WasmKeeperMock) SetAccessConfigCalls added in v0.35.0

func (mock *WasmKeeperMock) SetAccessConfigCalls() []struct {
	Ctx       cosmossdktypes.Context
	CodeID    uint64
	Caller    cosmossdktypes.AccAddress
	NewConfig wasmtypes.AccessConfig
}

SetAccessConfigCalls gets all the calls that were made to SetAccessConfig. Check the length with:

len(mockedWasmKeeper.SetAccessConfigCalls())

func (*WasmKeeperMock) SetContractInfoExtension added in v0.35.0

func (mock *WasmKeeperMock) SetContractInfoExtension(ctx cosmossdktypes.Context, contract cosmossdktypes.AccAddress, extra wasmtypes.ContractInfoExtension) error

SetContractInfoExtension calls SetContractInfoExtensionFunc.

func (*WasmKeeperMock) SetContractInfoExtensionCalls added in v0.35.0

func (mock *WasmKeeperMock) SetContractInfoExtensionCalls() []struct {
	Ctx      cosmossdktypes.Context
	Contract cosmossdktypes.AccAddress
	Extra    wasmtypes.ContractInfoExtension
}

SetContractInfoExtensionCalls gets all the calls that were made to SetContractInfoExtension. Check the length with:

len(mockedWasmKeeper.SetContractInfoExtensionCalls())

func (*WasmKeeperMock) Sudo added in v0.35.0

func (mock *WasmKeeperMock) Sudo(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, msg []byte) ([]byte, error)

Sudo calls SudoFunc.

func (*WasmKeeperMock) SudoCalls added in v0.35.0

func (mock *WasmKeeperMock) SudoCalls() []struct {
	Ctx             cosmossdktypes.Context
	ContractAddress cosmossdktypes.AccAddress
	Msg             []byte
}

SudoCalls gets all the calls that were made to Sudo. Check the length with:

len(mockedWasmKeeper.SudoCalls())

func (*WasmKeeperMock) UnpinCode added in v0.35.0

func (mock *WasmKeeperMock) UnpinCode(ctx cosmossdktypes.Context, codeID uint64) error

UnpinCode calls UnpinCodeFunc.

func (*WasmKeeperMock) UnpinCodeCalls added in v0.35.0

func (mock *WasmKeeperMock) UnpinCodeCalls() []struct {
	Ctx    cosmossdktypes.Context
	CodeID uint64
}

UnpinCodeCalls gets all the calls that were made to UnpinCode. Check the length with:

len(mockedWasmKeeper.UnpinCodeCalls())

func (*WasmKeeperMock) UpdateContractAdmin added in v0.35.0

func (mock *WasmKeeperMock) UpdateContractAdmin(ctx cosmossdktypes.Context, contractAddress cosmossdktypes.AccAddress, caller cosmossdktypes.AccAddress, newAdmin cosmossdktypes.AccAddress) error

UpdateContractAdmin calls UpdateContractAdminFunc.

func (*WasmKeeperMock) UpdateContractAdminCalls added in v0.35.0

func (mock *WasmKeeperMock) UpdateContractAdminCalls() []struct {
	Ctx             cosmossdktypes.Context
	ContractAddress cosmossdktypes.AccAddress
	Caller          cosmossdktypes.AccAddress
	NewAdmin        cosmossdktypes.AccAddress
}

UpdateContractAdminCalls gets all the calls that were made to UpdateContractAdmin. Check the length with:

len(mockedWasmKeeper.UpdateContractAdminCalls())

Jump to

Keyboard shortcuts

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