mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidatorI

type ValidatorI types.ValidatorI

ValidatorI is an alias for sdk staking ValidatorI

type ValidatorIMock

type ValidatorIMock struct {
	// ConsPubKeyFunc mocks the ConsPubKey method.
	ConsPubKeyFunc func() (cryptotypes.PubKey, error)

	// GetBondedTokensFunc mocks the GetBondedTokens method.
	GetBondedTokensFunc func() cosmossdktypes.Int

	// GetCommissionFunc mocks the GetCommission method.
	GetCommissionFunc func() cosmossdktypes.Dec

	// GetConsAddrFunc mocks the GetConsAddr method.
	GetConsAddrFunc func() (cosmossdktypes.ConsAddress, error)

	// GetConsensusPowerFunc mocks the GetConsensusPower method.
	GetConsensusPowerFunc func(intMoqParam cosmossdktypes.Int) int64

	// GetDelegatorSharesFunc mocks the GetDelegatorShares method.
	GetDelegatorSharesFunc func() cosmossdktypes.Dec

	// GetMinSelfDelegationFunc mocks the GetMinSelfDelegation method.
	GetMinSelfDelegationFunc func() cosmossdktypes.Int

	// GetMonikerFunc mocks the GetMoniker method.
	GetMonikerFunc func() string

	// GetOperatorFunc mocks the GetOperator method.
	GetOperatorFunc func() cosmossdktypes.ValAddress

	// GetStatusFunc mocks the GetStatus method.
	GetStatusFunc func() types.BondStatus

	// GetTokensFunc mocks the GetTokens method.
	GetTokensFunc func() cosmossdktypes.Int

	// IsBondedFunc mocks the IsBonded method.
	IsBondedFunc func() bool

	// IsJailedFunc mocks the IsJailed method.
	IsJailedFunc func() bool

	// IsUnbondedFunc mocks the IsUnbonded method.
	IsUnbondedFunc func() bool

	// IsUnbondingFunc mocks the IsUnbonding method.
	IsUnbondingFunc func() bool

	// SharesFromTokensFunc mocks the SharesFromTokens method.
	SharesFromTokensFunc func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)

	// SharesFromTokensTruncatedFunc mocks the SharesFromTokensTruncated method.
	SharesFromTokensTruncatedFunc func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)

	// TmConsPublicKeyFunc mocks the TmConsPublicKey method.
	TmConsPublicKeyFunc func() (crypto.PublicKey, error)

	// TokensFromSharesFunc mocks the TokensFromShares method.
	TokensFromSharesFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec

	// TokensFromSharesRoundUpFunc mocks the TokensFromSharesRoundUp method.
	TokensFromSharesRoundUpFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec

	// TokensFromSharesTruncatedFunc mocks the TokensFromSharesTruncated method.
	TokensFromSharesTruncatedFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec
	// contains filtered or unexported fields
}

ValidatorIMock is a mock implementation of ValidatorI.

func TestSomethingThatUsesValidatorI(t *testing.T) {

	// make and configure a mocked ValidatorI
	mockedValidatorI := &ValidatorIMock{
		ConsPubKeyFunc: func() (cryptotypes.PubKey, error) {
			panic("mock out the ConsPubKey method")
		},
		GetBondedTokensFunc: func() cosmossdktypes.Int {
			panic("mock out the GetBondedTokens method")
		},
		GetCommissionFunc: func() cosmossdktypes.Dec {
			panic("mock out the GetCommission method")
		},
		GetConsAddrFunc: func() (cosmossdktypes.ConsAddress, error) {
			panic("mock out the GetConsAddr method")
		},
		GetConsensusPowerFunc: func(intMoqParam cosmossdktypes.Int) int64 {
			panic("mock out the GetConsensusPower method")
		},
		GetDelegatorSharesFunc: func() cosmossdktypes.Dec {
			panic("mock out the GetDelegatorShares method")
		},
		GetMinSelfDelegationFunc: func() cosmossdktypes.Int {
			panic("mock out the GetMinSelfDelegation method")
		},
		GetMonikerFunc: func() string {
			panic("mock out the GetMoniker method")
		},
		GetOperatorFunc: func() cosmossdktypes.ValAddress {
			panic("mock out the GetOperator method")
		},
		GetStatusFunc: func() types.BondStatus {
			panic("mock out the GetStatus method")
		},
		GetTokensFunc: func() cosmossdktypes.Int {
			panic("mock out the GetTokens method")
		},
		IsBondedFunc: func() bool {
			panic("mock out the IsBonded method")
		},
		IsJailedFunc: func() bool {
			panic("mock out the IsJailed method")
		},
		IsUnbondedFunc: func() bool {
			panic("mock out the IsUnbonded method")
		},
		IsUnbondingFunc: func() bool {
			panic("mock out the IsUnbonding method")
		},
		SharesFromTokensFunc: func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
			panic("mock out the SharesFromTokens method")
		},
		SharesFromTokensTruncatedFunc: func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
			panic("mock out the SharesFromTokensTruncated method")
		},
		TmConsPublicKeyFunc: func() (crypto.PublicKey, error) {
			panic("mock out the TmConsPublicKey method")
		},
		TokensFromSharesFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
			panic("mock out the TokensFromShares method")
		},
		TokensFromSharesRoundUpFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
			panic("mock out the TokensFromSharesRoundUp method")
		},
		TokensFromSharesTruncatedFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
			panic("mock out the TokensFromSharesTruncated method")
		},
	}

	// use mockedValidatorI in code that requires ValidatorI
	// and then make assertions.

}

func (*ValidatorIMock) ConsPubKey

func (mock *ValidatorIMock) ConsPubKey() (cryptotypes.PubKey, error)

ConsPubKey calls ConsPubKeyFunc.

func (*ValidatorIMock) ConsPubKeyCalls

func (mock *ValidatorIMock) ConsPubKeyCalls() []struct {
}

ConsPubKeyCalls gets all the calls that were made to ConsPubKey. Check the length with:

len(mockedValidatorI.ConsPubKeyCalls())

func (*ValidatorIMock) GetBondedTokens

func (mock *ValidatorIMock) GetBondedTokens() cosmossdktypes.Int

GetBondedTokens calls GetBondedTokensFunc.

func (*ValidatorIMock) GetBondedTokensCalls

func (mock *ValidatorIMock) GetBondedTokensCalls() []struct {
}

GetBondedTokensCalls gets all the calls that were made to GetBondedTokens. Check the length with:

len(mockedValidatorI.GetBondedTokensCalls())

func (*ValidatorIMock) GetCommission

func (mock *ValidatorIMock) GetCommission() cosmossdktypes.Dec

GetCommission calls GetCommissionFunc.

func (*ValidatorIMock) GetCommissionCalls

func (mock *ValidatorIMock) GetCommissionCalls() []struct {
}

GetCommissionCalls gets all the calls that were made to GetCommission. Check the length with:

len(mockedValidatorI.GetCommissionCalls())

func (*ValidatorIMock) GetConsAddr

func (mock *ValidatorIMock) GetConsAddr() (cosmossdktypes.ConsAddress, error)

GetConsAddr calls GetConsAddrFunc.

func (*ValidatorIMock) GetConsAddrCalls

func (mock *ValidatorIMock) GetConsAddrCalls() []struct {
}

GetConsAddrCalls gets all the calls that were made to GetConsAddr. Check the length with:

len(mockedValidatorI.GetConsAddrCalls())

func (*ValidatorIMock) GetConsensusPower

func (mock *ValidatorIMock) GetConsensusPower(intMoqParam cosmossdktypes.Int) int64

GetConsensusPower calls GetConsensusPowerFunc.

func (*ValidatorIMock) GetConsensusPowerCalls

func (mock *ValidatorIMock) GetConsensusPowerCalls() []struct {
	IntMoqParam cosmossdktypes.Int
}

GetConsensusPowerCalls gets all the calls that were made to GetConsensusPower. Check the length with:

len(mockedValidatorI.GetConsensusPowerCalls())

func (*ValidatorIMock) GetDelegatorShares

func (mock *ValidatorIMock) GetDelegatorShares() cosmossdktypes.Dec

GetDelegatorShares calls GetDelegatorSharesFunc.

func (*ValidatorIMock) GetDelegatorSharesCalls

func (mock *ValidatorIMock) GetDelegatorSharesCalls() []struct {
}

GetDelegatorSharesCalls gets all the calls that were made to GetDelegatorShares. Check the length with:

len(mockedValidatorI.GetDelegatorSharesCalls())

func (*ValidatorIMock) GetMinSelfDelegation

func (mock *ValidatorIMock) GetMinSelfDelegation() cosmossdktypes.Int

GetMinSelfDelegation calls GetMinSelfDelegationFunc.

func (*ValidatorIMock) GetMinSelfDelegationCalls

func (mock *ValidatorIMock) GetMinSelfDelegationCalls() []struct {
}

GetMinSelfDelegationCalls gets all the calls that were made to GetMinSelfDelegation. Check the length with:

len(mockedValidatorI.GetMinSelfDelegationCalls())

func (*ValidatorIMock) GetMoniker

func (mock *ValidatorIMock) GetMoniker() string

GetMoniker calls GetMonikerFunc.

func (*ValidatorIMock) GetMonikerCalls

func (mock *ValidatorIMock) GetMonikerCalls() []struct {
}

GetMonikerCalls gets all the calls that were made to GetMoniker. Check the length with:

len(mockedValidatorI.GetMonikerCalls())

func (*ValidatorIMock) GetOperator

func (mock *ValidatorIMock) GetOperator() cosmossdktypes.ValAddress

GetOperator calls GetOperatorFunc.

func (*ValidatorIMock) GetOperatorCalls

func (mock *ValidatorIMock) GetOperatorCalls() []struct {
}

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

len(mockedValidatorI.GetOperatorCalls())

func (*ValidatorIMock) GetStatus

func (mock *ValidatorIMock) GetStatus() types.BondStatus

GetStatus calls GetStatusFunc.

func (*ValidatorIMock) GetStatusCalls

func (mock *ValidatorIMock) GetStatusCalls() []struct {
}

GetStatusCalls gets all the calls that were made to GetStatus. Check the length with:

len(mockedValidatorI.GetStatusCalls())

func (*ValidatorIMock) GetTokens

func (mock *ValidatorIMock) GetTokens() cosmossdktypes.Int

GetTokens calls GetTokensFunc.

func (*ValidatorIMock) GetTokensCalls

func (mock *ValidatorIMock) GetTokensCalls() []struct {
}

GetTokensCalls gets all the calls that were made to GetTokens. Check the length with:

len(mockedValidatorI.GetTokensCalls())

func (*ValidatorIMock) IsBonded

func (mock *ValidatorIMock) IsBonded() bool

IsBonded calls IsBondedFunc.

func (*ValidatorIMock) IsBondedCalls

func (mock *ValidatorIMock) IsBondedCalls() []struct {
}

IsBondedCalls gets all the calls that were made to IsBonded. Check the length with:

len(mockedValidatorI.IsBondedCalls())

func (*ValidatorIMock) IsJailed

func (mock *ValidatorIMock) IsJailed() bool

IsJailed calls IsJailedFunc.

func (*ValidatorIMock) IsJailedCalls

func (mock *ValidatorIMock) IsJailedCalls() []struct {
}

IsJailedCalls gets all the calls that were made to IsJailed. Check the length with:

len(mockedValidatorI.IsJailedCalls())

func (*ValidatorIMock) IsUnbonded

func (mock *ValidatorIMock) IsUnbonded() bool

IsUnbonded calls IsUnbondedFunc.

func (*ValidatorIMock) IsUnbondedCalls

func (mock *ValidatorIMock) IsUnbondedCalls() []struct {
}

IsUnbondedCalls gets all the calls that were made to IsUnbonded. Check the length with:

len(mockedValidatorI.IsUnbondedCalls())

func (*ValidatorIMock) IsUnbonding

func (mock *ValidatorIMock) IsUnbonding() bool

IsUnbonding calls IsUnbondingFunc.

func (*ValidatorIMock) IsUnbondingCalls

func (mock *ValidatorIMock) IsUnbondingCalls() []struct {
}

IsUnbondingCalls gets all the calls that were made to IsUnbonding. Check the length with:

len(mockedValidatorI.IsUnbondingCalls())

func (*ValidatorIMock) SharesFromTokens

func (mock *ValidatorIMock) SharesFromTokens(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)

SharesFromTokens calls SharesFromTokensFunc.

func (*ValidatorIMock) SharesFromTokensCalls

func (mock *ValidatorIMock) SharesFromTokensCalls() []struct {
	Amt cosmossdktypes.Int
}

SharesFromTokensCalls gets all the calls that were made to SharesFromTokens. Check the length with:

len(mockedValidatorI.SharesFromTokensCalls())

func (*ValidatorIMock) SharesFromTokensTruncated

func (mock *ValidatorIMock) SharesFromTokensTruncated(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)

SharesFromTokensTruncated calls SharesFromTokensTruncatedFunc.

func (*ValidatorIMock) SharesFromTokensTruncatedCalls

func (mock *ValidatorIMock) SharesFromTokensTruncatedCalls() []struct {
	Amt cosmossdktypes.Int
}

SharesFromTokensTruncatedCalls gets all the calls that were made to SharesFromTokensTruncated. Check the length with:

len(mockedValidatorI.SharesFromTokensTruncatedCalls())

func (*ValidatorIMock) TmConsPublicKey

func (mock *ValidatorIMock) TmConsPublicKey() (crypto.PublicKey, error)

TmConsPublicKey calls TmConsPublicKeyFunc.

func (*ValidatorIMock) TmConsPublicKeyCalls

func (mock *ValidatorIMock) TmConsPublicKeyCalls() []struct {
}

TmConsPublicKeyCalls gets all the calls that were made to TmConsPublicKey. Check the length with:

len(mockedValidatorI.TmConsPublicKeyCalls())

func (*ValidatorIMock) TokensFromShares

func (mock *ValidatorIMock) TokensFromShares(dec cosmossdktypes.Dec) cosmossdktypes.Dec

TokensFromShares calls TokensFromSharesFunc.

func (*ValidatorIMock) TokensFromSharesCalls

func (mock *ValidatorIMock) TokensFromSharesCalls() []struct {
	Dec cosmossdktypes.Dec
}

TokensFromSharesCalls gets all the calls that were made to TokensFromShares. Check the length with:

len(mockedValidatorI.TokensFromSharesCalls())

func (*ValidatorIMock) TokensFromSharesRoundUp

func (mock *ValidatorIMock) TokensFromSharesRoundUp(dec cosmossdktypes.Dec) cosmossdktypes.Dec

TokensFromSharesRoundUp calls TokensFromSharesRoundUpFunc.

func (*ValidatorIMock) TokensFromSharesRoundUpCalls

func (mock *ValidatorIMock) TokensFromSharesRoundUpCalls() []struct {
	Dec cosmossdktypes.Dec
}

TokensFromSharesRoundUpCalls gets all the calls that were made to TokensFromSharesRoundUp. Check the length with:

len(mockedValidatorI.TokensFromSharesRoundUpCalls())

func (*ValidatorIMock) TokensFromSharesTruncated

func (mock *ValidatorIMock) TokensFromSharesTruncated(dec cosmossdktypes.Dec) cosmossdktypes.Dec

TokensFromSharesTruncated calls TokensFromSharesTruncatedFunc.

func (*ValidatorIMock) TokensFromSharesTruncatedCalls

func (mock *ValidatorIMock) TokensFromSharesTruncatedCalls() []struct {
	Dec cosmossdktypes.Dec
}

TokensFromSharesTruncatedCalls gets all the calls that were made to TokensFromSharesTruncated. Check the length with:

len(mockedValidatorI.TokensFromSharesTruncatedCalls())

Jump to

Keyboard shortcuts

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