mock

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidatorIMock added in v0.21.0

type ValidatorIMock struct {
	// GetConsAddrFunc mocks the GetConsAddr method.
	GetConsAddrFunc func() (github_com_cosmos_cosmos_sdk_types.ConsAddress, error)

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

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

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

	// IsJailedFunc mocks the IsJailed method.
	IsJailedFunc func() bool
	// contains filtered or unexported fields
}

ValidatorIMock is a mock implementation of exported.ValidatorI.

func TestSomethingThatUsesValidatorI(t *testing.T) {

	// make and configure a mocked exported.ValidatorI
	mockedValidatorI := &ValidatorIMock{
		GetConsAddrFunc: func() (github_com_cosmos_cosmos_sdk_types.ConsAddress, error) {
			panic("mock out the GetConsAddr method")
		},
		GetConsensusPowerFunc: func(intMoqParam github_com_cosmos_cosmos_sdk_types.Int) int64 {
			panic("mock out the GetConsensusPower method")
		},
		GetOperatorFunc: func() github_com_cosmos_cosmos_sdk_types.ValAddress {
			panic("mock out the GetOperator method")
		},
		IsBondedFunc: func() bool {
			panic("mock out the IsBonded method")
		},
		IsJailedFunc: func() bool {
			panic("mock out the IsJailed method")
		},
	}

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

}

func (*ValidatorIMock) GetConsAddr added in v0.21.0

GetConsAddr calls GetConsAddrFunc.

func (*ValidatorIMock) GetConsAddrCalls added in v0.21.0

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 added in v0.21.0

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

GetConsensusPower calls GetConsensusPowerFunc.

func (*ValidatorIMock) GetConsensusPowerCalls added in v0.21.0

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

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

len(mockedValidatorI.GetConsensusPowerCalls())

func (*ValidatorIMock) GetOperator added in v0.21.0

GetOperator calls GetOperatorFunc.

func (*ValidatorIMock) GetOperatorCalls added in v0.21.0

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

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

len(mockedValidatorI.GetOperatorCalls())

func (*ValidatorIMock) IsBonded added in v0.21.0

func (mock *ValidatorIMock) IsBonded() bool

IsBonded calls IsBondedFunc.

func (*ValidatorIMock) IsBondedCalls added in v0.21.0

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 added in v0.21.0

func (mock *ValidatorIMock) IsJailed() bool

IsJailed calls IsJailedFunc.

func (*ValidatorIMock) IsJailedCalls added in v0.21.0

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

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

len(mockedValidatorI.IsJailedCalls())

Jump to

Keyboard shortcuts

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