mock

package
v0.33.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LatestFinalizedBlockCacheMock

type LatestFinalizedBlockCacheMock struct {
	// GetFunc mocks the Get method.
	GetFunc func(chain nexus.ChainName) *big.Int

	// SetFunc mocks the Set method.
	SetFunc func(chain nexus.ChainName, blockNumber *big.Int)
	// contains filtered or unexported fields
}

LatestFinalizedBlockCacheMock is a mock implementation of evm.LatestFinalizedBlockCache.

func TestSomethingThatUsesLatestFinalizedBlockCache(t *testing.T) {

	// make and configure a mocked evm.LatestFinalizedBlockCache
	mockedLatestFinalizedBlockCache := &LatestFinalizedBlockCacheMock{
		GetFunc: func(chain nexus.ChainName) *big.Int {
			panic("mock out the Get method")
		},
		SetFunc: func(chain nexus.ChainName, blockNumber *big.Int)  {
			panic("mock out the Set method")
		},
	}

	// use mockedLatestFinalizedBlockCache in code that requires evm.LatestFinalizedBlockCache
	// and then make assertions.

}

func (*LatestFinalizedBlockCacheMock) Get

Get calls GetFunc.

func (*LatestFinalizedBlockCacheMock) GetCalls

func (mock *LatestFinalizedBlockCacheMock) GetCalls() []struct {
	Chain nexus.ChainName
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedLatestFinalizedBlockCache.GetCalls())

func (*LatestFinalizedBlockCacheMock) Set

func (mock *LatestFinalizedBlockCacheMock) Set(chain nexus.ChainName, blockNumber *big.Int)

Set calls SetFunc.

func (*LatestFinalizedBlockCacheMock) SetCalls

func (mock *LatestFinalizedBlockCacheMock) SetCalls() []struct {
	Chain       nexus.ChainName
	BlockNumber *big.Int
}

SetCalls gets all the calls that were made to Set. Check the length with:

len(mockedLatestFinalizedBlockCache.SetCalls())

Jump to

Keyboard shortcuts

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