Documentation ¶
Index ¶
- type KeeperMock
- func (mock *KeeperMock) DeleteKeygenSession(ctx sdk.Context, ...)
- func (mock *KeeperMock) DeleteKeygenSessionCalls() []struct{ ... }
- func (mock *KeeperMock) DeleteSigningSession(ctx sdk.Context, id uint64)
- func (mock *KeeperMock) DeleteSigningSessionCalls() []struct{ ... }
- func (mock *KeeperMock) GetCurrentKeyID(ctx sdk.Context, ...) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool)
- func (mock *KeeperMock) GetCurrentKeyIDCalls() []struct{ ... }
- func (mock *KeeperMock) GetKey(ctx sdk.Context, ...) (github_com_axelarnetwork_axelar_core_x_multisig_exported.Key, bool)
- func (mock *KeeperMock) GetKeyCalls() []struct{ ... }
- func (mock *KeeperMock) GetKeygenSession(ctx sdk.Context, ...) (types.KeygenSession, bool)
- func (mock *KeeperMock) GetKeygenSessionCalls() []struct{ ... }
- func (mock *KeeperMock) GetKeygenSessionsByExpiry(ctx sdk.Context, expiry int64) []types.KeygenSession
- func (mock *KeeperMock) GetKeygenSessionsByExpiryCalls() []struct{ ... }
- func (mock *KeeperMock) GetNextKeyID(ctx sdk.Context, ...) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool)
- func (mock *KeeperMock) GetNextKeyIDCalls() []struct{ ... }
- func (mock *KeeperMock) GetSigRouter() types.SigRouter
- func (mock *KeeperMock) GetSigRouterCalls() []struct{}
- func (mock *KeeperMock) GetSigningSessionsByExpiry(ctx sdk.Context, expiry int64) []types.SigningSession
- func (mock *KeeperMock) GetSigningSessionsByExpiryCalls() []struct{ ... }
- func (mock *KeeperMock) Logger(ctx sdk.Context) log.Logger
- func (mock *KeeperMock) LoggerCalls() []struct{ ... }
- func (mock *KeeperMock) SetKey(ctx sdk.Context, key types.Key)
- func (mock *KeeperMock) SetKeyCalls() []struct{ ... }
- type NexusMock
- type RewarderMock
- type SlasherMock
- type SnapshotterMock
- func (mock *SnapshotterMock) CreateSnapshot(ctx sdk.Context, candidates []sdk.ValAddress, ...) (exported.Snapshot, error)
- func (mock *SnapshotterMock) CreateSnapshotCalls() []struct{ ... }
- func (mock *SnapshotterMock) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
- func (mock *SnapshotterMock) GetOperatorCalls() []struct{ ... }
- func (mock *SnapshotterMock) GetProxy(ctx sdk.Context, operator sdk.ValAddress) (sdk.AccAddress, bool)
- func (mock *SnapshotterMock) GetProxyCalls() []struct{ ... }
- type StakerMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeeperMock ¶
type KeeperMock struct { // DeleteKeygenSessionFunc mocks the DeleteKeygenSession method. DeleteKeygenSessionFunc func(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) // DeleteSigningSessionFunc mocks the DeleteSigningSession method. DeleteSigningSessionFunc func(ctx sdk.Context, id uint64) // GetCurrentKeyIDFunc mocks the GetCurrentKeyID method. GetCurrentKeyIDFunc func(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool) // GetKeyFunc mocks the GetKey method. GetKeyFunc func(ctx sdk.Context, keyID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (github_com_axelarnetwork_axelar_core_x_multisig_exported.Key, bool) // GetKeygenSessionFunc mocks the GetKeygenSession method. GetKeygenSessionFunc func(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (types.KeygenSession, bool) // GetKeygenSessionsByExpiryFunc mocks the GetKeygenSessionsByExpiry method. GetKeygenSessionsByExpiryFunc func(ctx sdk.Context, expiry int64) []types.KeygenSession // GetNextKeyIDFunc mocks the GetNextKeyID method. GetNextKeyIDFunc func(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool) // GetSigRouterFunc mocks the GetSigRouter method. GetSigRouterFunc func() types.SigRouter // GetSigningSessionsByExpiryFunc mocks the GetSigningSessionsByExpiry method. GetSigningSessionsByExpiryFunc func(ctx sdk.Context, expiry int64) []types.SigningSession // LoggerFunc mocks the Logger method. LoggerFunc func(ctx sdk.Context) log.Logger // SetKeyFunc mocks the SetKey method. SetKeyFunc func(ctx sdk.Context, key types.Key) // contains filtered or unexported fields }
KeeperMock is a mock implementation of types.Keeper.
func TestSomethingThatUsesKeeper(t *testing.T) { // make and configure a mocked types.Keeper mockedKeeper := &KeeperMock{ DeleteKeygenSessionFunc: func(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) { panic("mock out the DeleteKeygenSession method") }, DeleteSigningSessionFunc: func(ctx sdk.Context, id uint64) { panic("mock out the DeleteSigningSession method") }, GetCurrentKeyIDFunc: func(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool) { panic("mock out the GetCurrentKeyID method") }, GetKeyFunc: func(ctx sdk.Context, keyID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (github_com_axelarnetwork_axelar_core_x_multisig_exported.Key, bool) { panic("mock out the GetKey method") }, GetKeygenSessionFunc: func(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (types.KeygenSession, bool) { panic("mock out the GetKeygenSession method") }, GetKeygenSessionsByExpiryFunc: func(ctx sdk.Context, expiry int64) []types.KeygenSession { panic("mock out the GetKeygenSessionsByExpiry method") }, GetNextKeyIDFunc: func(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool) { panic("mock out the GetNextKeyID method") }, GetSigRouterFunc: func() types.SigRouter { panic("mock out the GetSigRouter method") }, GetSigningSessionsByExpiryFunc: func(ctx sdk.Context, expiry int64) []types.SigningSession { panic("mock out the GetSigningSessionsByExpiry method") }, LoggerFunc: func(ctx sdk.Context) log.Logger { panic("mock out the Logger method") }, SetKeyFunc: func(ctx sdk.Context, key types.Key) { panic("mock out the SetKey method") }, } // use mockedKeeper in code that requires types.Keeper // and then make assertions. }
func (*KeeperMock) DeleteKeygenSession ¶
func (mock *KeeperMock) DeleteKeygenSession(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID)
DeleteKeygenSession calls DeleteKeygenSessionFunc.
func (*KeeperMock) DeleteKeygenSessionCalls ¶
func (mock *KeeperMock) DeleteKeygenSessionCalls() []struct { Ctx sdk.Context ID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID }
DeleteKeygenSessionCalls gets all the calls that were made to DeleteKeygenSession. Check the length with:
len(mockedKeeper.DeleteKeygenSessionCalls())
func (*KeeperMock) DeleteSigningSession ¶
func (mock *KeeperMock) DeleteSigningSession(ctx sdk.Context, id uint64)
DeleteSigningSession calls DeleteSigningSessionFunc.
func (*KeeperMock) DeleteSigningSessionCalls ¶
func (mock *KeeperMock) DeleteSigningSessionCalls() []struct { Ctx sdk.Context ID uint64 }
DeleteSigningSessionCalls gets all the calls that were made to DeleteSigningSession. Check the length with:
len(mockedKeeper.DeleteSigningSessionCalls())
func (*KeeperMock) GetCurrentKeyID ¶
func (mock *KeeperMock) GetCurrentKeyID(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool)
GetCurrentKeyID calls GetCurrentKeyIDFunc.
func (*KeeperMock) GetCurrentKeyIDCalls ¶
func (mock *KeeperMock) GetCurrentKeyIDCalls() []struct { Ctx sdk.Context ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName }
GetCurrentKeyIDCalls gets all the calls that were made to GetCurrentKeyID. Check the length with:
len(mockedKeeper.GetCurrentKeyIDCalls())
func (*KeeperMock) GetKey ¶
func (mock *KeeperMock) GetKey(ctx sdk.Context, keyID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (github_com_axelarnetwork_axelar_core_x_multisig_exported.Key, bool)
GetKey calls GetKeyFunc.
func (*KeeperMock) GetKeyCalls ¶
func (mock *KeeperMock) GetKeyCalls() []struct { Ctx sdk.Context KeyID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID }
GetKeyCalls gets all the calls that were made to GetKey. Check the length with:
len(mockedKeeper.GetKeyCalls())
func (*KeeperMock) GetKeygenSession ¶ added in v0.21.1
func (mock *KeeperMock) GetKeygenSession(ctx sdk.Context, id github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID) (types.KeygenSession, bool)
GetKeygenSession calls GetKeygenSessionFunc.
func (*KeeperMock) GetKeygenSessionCalls ¶ added in v0.21.1
func (mock *KeeperMock) GetKeygenSessionCalls() []struct { Ctx sdk.Context ID github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID }
GetKeygenSessionCalls gets all the calls that were made to GetKeygenSession. Check the length with:
len(mockedKeeper.GetKeygenSessionCalls())
func (*KeeperMock) GetKeygenSessionsByExpiry ¶
func (mock *KeeperMock) GetKeygenSessionsByExpiry(ctx sdk.Context, expiry int64) []types.KeygenSession
GetKeygenSessionsByExpiry calls GetKeygenSessionsByExpiryFunc.
func (*KeeperMock) GetKeygenSessionsByExpiryCalls ¶
func (mock *KeeperMock) GetKeygenSessionsByExpiryCalls() []struct { Ctx sdk.Context Expiry int64 }
GetKeygenSessionsByExpiryCalls gets all the calls that were made to GetKeygenSessionsByExpiry. Check the length with:
len(mockedKeeper.GetKeygenSessionsByExpiryCalls())
func (*KeeperMock) GetNextKeyID ¶
func (mock *KeeperMock) GetNextKeyID(ctx sdk.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_multisig_exported.KeyID, bool)
GetNextKeyID calls GetNextKeyIDFunc.
func (*KeeperMock) GetNextKeyIDCalls ¶
func (mock *KeeperMock) GetNextKeyIDCalls() []struct { Ctx sdk.Context ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName }
GetNextKeyIDCalls gets all the calls that were made to GetNextKeyID. Check the length with:
len(mockedKeeper.GetNextKeyIDCalls())
func (*KeeperMock) GetSigRouter ¶
func (mock *KeeperMock) GetSigRouter() types.SigRouter
GetSigRouter calls GetSigRouterFunc.
func (*KeeperMock) GetSigRouterCalls ¶
func (mock *KeeperMock) GetSigRouterCalls() []struct { }
GetSigRouterCalls gets all the calls that were made to GetSigRouter. Check the length with:
len(mockedKeeper.GetSigRouterCalls())
func (*KeeperMock) GetSigningSessionsByExpiry ¶
func (mock *KeeperMock) GetSigningSessionsByExpiry(ctx sdk.Context, expiry int64) []types.SigningSession
GetSigningSessionsByExpiry calls GetSigningSessionsByExpiryFunc.
func (*KeeperMock) GetSigningSessionsByExpiryCalls ¶
func (mock *KeeperMock) GetSigningSessionsByExpiryCalls() []struct { Ctx sdk.Context Expiry int64 }
GetSigningSessionsByExpiryCalls gets all the calls that were made to GetSigningSessionsByExpiry. Check the length with:
len(mockedKeeper.GetSigningSessionsByExpiryCalls())
func (*KeeperMock) Logger ¶
func (mock *KeeperMock) Logger(ctx sdk.Context) log.Logger
Logger calls LoggerFunc.
func (*KeeperMock) LoggerCalls ¶
func (mock *KeeperMock) LoggerCalls() []struct { Ctx sdk.Context }
LoggerCalls gets all the calls that were made to Logger. Check the length with:
len(mockedKeeper.LoggerCalls())
func (*KeeperMock) SetKey ¶
func (mock *KeeperMock) SetKey(ctx sdk.Context, key types.Key)
SetKey calls SetKeyFunc.
func (*KeeperMock) SetKeyCalls ¶
func (mock *KeeperMock) SetKeyCalls() []struct { Ctx sdk.Context Key types.Key }
SetKeyCalls gets all the calls that were made to SetKey. Check the length with:
len(mockedKeeper.SetKeyCalls())
type NexusMock ¶
type NexusMock struct { // GetChainFunc mocks the GetChain method. GetChainFunc func(ctx sdk.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, bool) // 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{ GetChainFunc: func(ctx sdk.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") }, } // use mockedNexus in code that requires types.Nexus // and then make assertions. }
func (*NexusMock) GetChain ¶
func (mock *NexusMock) GetChain(ctx sdk.Context, chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) (github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain, bool)
GetChain calls GetChainFunc.
func (*NexusMock) GetChainCalls ¶
func (mock *NexusMock) GetChainCalls() []struct { Ctx sdk.Context Chain github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName }
GetChainCalls gets all the calls that were made to GetChain. Check the length with:
len(mockedNexus.GetChainCalls())
type RewarderMock ¶
type RewarderMock struct { // GetPoolFunc mocks the GetPool method. GetPoolFunc func(ctx sdk.Context, name string) reward.RewardPool // contains filtered or unexported fields }
RewarderMock is a mock implementation of types.Rewarder.
func TestSomethingThatUsesRewarder(t *testing.T) { // make and configure a mocked types.Rewarder mockedRewarder := &RewarderMock{ GetPoolFunc: func(ctx sdk.Context, name string) reward.RewardPool { panic("mock out the GetPool method") }, } // use mockedRewarder in code that requires types.Rewarder // and then make assertions. }
func (*RewarderMock) GetPool ¶
func (mock *RewarderMock) GetPool(ctx sdk.Context, name string) reward.RewardPool
GetPool calls GetPoolFunc.
func (*RewarderMock) GetPoolCalls ¶
func (mock *RewarderMock) GetPoolCalls() []struct { Ctx sdk.Context Name string }
GetPoolCalls gets all the calls that were made to GetPool. Check the length with:
len(mockedRewarder.GetPoolCalls())
type SlasherMock ¶
type SlasherMock struct { // IsTombstonedFunc mocks the IsTombstoned method. IsTombstonedFunc func(ctx sdk.Context, consAddr sdk.ConsAddress) bool // contains filtered or unexported fields }
SlasherMock is a mock implementation of types.Slasher.
func TestSomethingThatUsesSlasher(t *testing.T) { // make and configure a mocked types.Slasher mockedSlasher := &SlasherMock{ IsTombstonedFunc: func(ctx sdk.Context, consAddr sdk.ConsAddress) bool { panic("mock out the IsTombstoned method") }, } // use mockedSlasher in code that requires types.Slasher // and then make assertions. }
func (*SlasherMock) IsTombstoned ¶
func (mock *SlasherMock) IsTombstoned(ctx sdk.Context, consAddr sdk.ConsAddress) bool
IsTombstoned calls IsTombstonedFunc.
func (*SlasherMock) IsTombstonedCalls ¶
func (mock *SlasherMock) IsTombstonedCalls() []struct { Ctx sdk.Context ConsAddr sdk.ConsAddress }
IsTombstonedCalls gets all the calls that were made to IsTombstoned. Check the length with:
len(mockedSlasher.IsTombstonedCalls())
type SnapshotterMock ¶
type SnapshotterMock struct { // CreateSnapshotFunc mocks the CreateSnapshot method. CreateSnapshotFunc func(ctx sdk.Context, candidates []sdk.ValAddress, filterFunc func(exported.ValidatorI) bool, weightFunc func(consensusPower sdk.Uint) sdk.Uint, threshold utils.Threshold) (exported.Snapshot, error) // GetOperatorFunc mocks the GetOperator method. GetOperatorFunc func(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress // GetProxyFunc mocks the GetProxy method. GetProxyFunc func(ctx sdk.Context, operator sdk.ValAddress) (sdk.AccAddress, bool) // 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{ CreateSnapshotFunc: func(ctx sdk.Context, candidates []sdk.ValAddress, filterFunc func(exported.ValidatorI) bool, weightFunc func(consensusPower sdk.Uint) sdk.Uint, threshold utils.Threshold) (exported.Snapshot, error) { panic("mock out the CreateSnapshot method") }, GetOperatorFunc: func(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress { panic("mock out the GetOperator method") }, GetProxyFunc: func(ctx sdk.Context, operator sdk.ValAddress) (sdk.AccAddress, bool) { panic("mock out the GetProxy method") }, } // use mockedSnapshotter in code that requires types.Snapshotter // and then make assertions. }
func (*SnapshotterMock) CreateSnapshot ¶
func (mock *SnapshotterMock) CreateSnapshot(ctx sdk.Context, candidates []sdk.ValAddress, filterFunc func(exported.ValidatorI) bool, weightFunc func(consensusPower sdk.Uint) sdk.Uint, threshold utils.Threshold) (exported.Snapshot, error)
CreateSnapshot calls CreateSnapshotFunc.
func (*SnapshotterMock) CreateSnapshotCalls ¶
func (mock *SnapshotterMock) CreateSnapshotCalls() []struct { Ctx sdk.Context Candidates []sdk.ValAddress FilterFunc func(exported.ValidatorI) bool WeightFunc func(consensusPower sdk.Uint) sdk.Uint Threshold utils.Threshold }
CreateSnapshotCalls gets all the calls that were made to CreateSnapshot. Check the length with:
len(mockedSnapshotter.CreateSnapshotCalls())
func (*SnapshotterMock) GetOperator ¶
func (mock *SnapshotterMock) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
GetOperator calls GetOperatorFunc.
func (*SnapshotterMock) GetOperatorCalls ¶
func (mock *SnapshotterMock) GetOperatorCalls() []struct { Ctx sdk.Context Proxy sdk.AccAddress }
GetOperatorCalls gets all the calls that were made to GetOperator. Check the length with:
len(mockedSnapshotter.GetOperatorCalls())
func (*SnapshotterMock) GetProxy ¶
func (mock *SnapshotterMock) GetProxy(ctx sdk.Context, operator sdk.ValAddress) (sdk.AccAddress, bool)
GetProxy calls GetProxyFunc.
func (*SnapshotterMock) GetProxyCalls ¶
func (mock *SnapshotterMock) GetProxyCalls() []struct { Ctx sdk.Context Operator sdk.ValAddress }
GetProxyCalls gets all the calls that were made to GetProxy. Check the length with:
len(mockedSnapshotter.GetProxyCalls())
type StakerMock ¶
type StakerMock struct { // GetBondedValidatorsByPowerFunc mocks the GetBondedValidatorsByPower method. GetBondedValidatorsByPowerFunc func(ctx sdk.Context) []stakingTypes.Validator // contains filtered or unexported fields }
StakerMock is a mock implementation of types.Staker.
func TestSomethingThatUsesStaker(t *testing.T) { // make and configure a mocked types.Staker mockedStaker := &StakerMock{ GetBondedValidatorsByPowerFunc: func(ctx sdk.Context) []stakingTypes.Validator { panic("mock out the GetBondedValidatorsByPower method") }, } // use mockedStaker in code that requires types.Staker // and then make assertions. }
func (*StakerMock) GetBondedValidatorsByPower ¶
func (mock *StakerMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingTypes.Validator
GetBondedValidatorsByPower calls GetBondedValidatorsByPowerFunc.
func (*StakerMock) GetBondedValidatorsByPowerCalls ¶
func (mock *StakerMock) GetBondedValidatorsByPowerCalls() []struct { Ctx sdk.Context }
GetBondedValidatorsByPowerCalls gets all the calls that were made to GetBondedValidatorsByPower. Check the length with:
len(mockedStaker.GetBondedValidatorsByPowerCalls())