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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiSigKeeperMock added in v0.21.0

type MultiSigKeeperMock struct {
	// GetActiveKeyIDsFunc mocks the GetActiveKeyIDs method.
	GetActiveKeyIDsFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) []multisig.KeyID

	// GetKeyFunc mocks the GetKey method.
	GetKeyFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, keyID multisig.KeyID) (multisig.Key, bool)
	// contains filtered or unexported fields
}

MultiSigKeeperMock is a mock implementation of types.MultiSigKeeper.

func TestSomethingThatUsesMultiSigKeeper(t *testing.T) {

	// make and configure a mocked types.MultiSigKeeper
	mockedMultiSigKeeper := &MultiSigKeeperMock{
		GetActiveKeyIDsFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) []multisig.KeyID {
			panic("mock out the GetActiveKeyIDs method")
		},
		GetKeyFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, keyID multisig.KeyID) (multisig.Key, bool) {
			panic("mock out the GetKey method")
		},
	}

	// use mockedMultiSigKeeper in code that requires types.MultiSigKeeper
	// and then make assertions.

}

func (*MultiSigKeeperMock) GetActiveKeyIDs added in v0.21.0

GetActiveKeyIDs calls GetActiveKeyIDsFunc.

func (*MultiSigKeeperMock) GetActiveKeyIDsCalls added in v0.21.0

GetActiveKeyIDsCalls gets all the calls that were made to GetActiveKeyIDs. Check the length with:

len(mockedMultiSigKeeper.GetActiveKeyIDsCalls())

func (*MultiSigKeeperMock) GetKey added in v0.21.0

GetKey calls GetKeyFunc.

func (*MultiSigKeeperMock) GetKeyCalls added in v0.21.0

func (mock *MultiSigKeeperMock) GetKeyCalls() []struct {
	Ctx   github_com_cosmos_cosmos_sdk_types.Context
	KeyID multisig.KeyID
}

GetKeyCalls gets all the calls that were made to GetKey. Check the length with:

len(mockedMultiSigKeeper.GetKeyCalls())

type NexusMock

type NexusMock struct {
	// GetChainsFunc mocks the GetChains method.
	GetChainsFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain
	// contains filtered or unexported fields
}

NexusMock is a mock implementation of types.Nexus.

func TestSomethingThatUsesNexus(t *testing.T) {

	// make and configure a mocked types.Nexus
	mockedNexus := &NexusMock{
		GetChainsFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain {
			panic("mock out the GetChains method")
		},
	}

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

}

func (*NexusMock) GetChains

GetChains calls GetChainsFunc.

func (*NexusMock) GetChainsCalls

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

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

len(mockedNexus.GetChainsCalls())

type SnapshotterMock

type SnapshotterMock struct {
	// GetOperatorFunc mocks the GetOperator method.
	GetOperatorFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, proxy github_com_cosmos_cosmos_sdk_types.AccAddress) github_com_cosmos_cosmos_sdk_types.ValAddress
	// contains filtered or unexported fields
}

SnapshotterMock is a mock implementation of types.Snapshotter.

func TestSomethingThatUsesSnapshotter(t *testing.T) {

	// make and configure a mocked types.Snapshotter
	mockedSnapshotter := &SnapshotterMock{
		GetOperatorFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, proxy github_com_cosmos_cosmos_sdk_types.AccAddress) github_com_cosmos_cosmos_sdk_types.ValAddress {
			panic("mock out the GetOperator method")
		},
	}

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

}

func (*SnapshotterMock) GetOperator

GetOperator calls GetOperatorFunc.

func (*SnapshotterMock) GetOperatorCalls

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

len(mockedSnapshotter.GetOperatorCalls())

type StakingKeeperMock

type StakingKeeperMock struct {
	// ValidatorFunc mocks the Validator method.
	ValidatorFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI
	// contains filtered or unexported fields
}

StakingKeeperMock is a mock implementation of types.StakingKeeper.

func TestSomethingThatUsesStakingKeeper(t *testing.T) {

	// make and configure a mocked types.StakingKeeper
	mockedStakingKeeper := &StakingKeeperMock{
		ValidatorFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI {
			panic("mock out the Validator method")
		},
	}

	// use mockedStakingKeeper in code that requires types.StakingKeeper
	// and then make assertions.

}

func (*StakingKeeperMock) Validator

Validator calls ValidatorFunc.

func (*StakingKeeperMock) ValidatorCalls

ValidatorCalls gets all the calls that were made to Validator. Check the length with:

len(mockedStakingKeeper.ValidatorCalls())

Jump to

Keyboard shortcuts

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