go_study/fabric-main/orderer/consensus/smartbft/mocks/ledger.go

59 lines
1.2 KiB
Go

// Code generated by mockery v2.14.1. DO NOT EDIT.
package mocks
import (
common "github.com/hyperledger/fabric-protos-go/common"
mock "github.com/stretchr/testify/mock"
)
// Ledger is an autogenerated mock type for the Ledger type
type Ledger struct {
mock.Mock
}
// Block provides a mock function with given fields: number
func (_m *Ledger) Block(number uint64) *common.Block {
ret := _m.Called(number)
var r0 *common.Block
if rf, ok := ret.Get(0).(func(uint64) *common.Block); ok {
r0 = rf(number)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*common.Block)
}
}
return r0
}
// Height provides a mock function with given fields:
func (_m *Ledger) Height() uint64 {
ret := _m.Called()
var r0 uint64
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
type mockConstructorTestingTNewLedger interface {
mock.TestingT
Cleanup(func())
}
// NewLedger creates a new instance of Ledger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewLedger(t mockConstructorTestingTNewLedger) *Ledger {
mock := &Ledger{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}