github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/timeout_signature_aggregator.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 crypto "github.com/onflow/crypto" 7 flow "github.com/onflow/flow-go/model/flow" 8 9 hotstuff "github.com/onflow/flow-go/consensus/hotstuff" 10 11 mock "github.com/stretchr/testify/mock" 12 ) 13 14 // TimeoutSignatureAggregator is an autogenerated mock type for the TimeoutSignatureAggregator type 15 type TimeoutSignatureAggregator struct { 16 mock.Mock 17 } 18 19 // Aggregate provides a mock function with given fields: 20 func (_m *TimeoutSignatureAggregator) Aggregate() ([]hotstuff.TimeoutSignerInfo, crypto.Signature, error) { 21 ret := _m.Called() 22 23 var r0 []hotstuff.TimeoutSignerInfo 24 var r1 crypto.Signature 25 var r2 error 26 if rf, ok := ret.Get(0).(func() ([]hotstuff.TimeoutSignerInfo, crypto.Signature, error)); ok { 27 return rf() 28 } 29 if rf, ok := ret.Get(0).(func() []hotstuff.TimeoutSignerInfo); ok { 30 r0 = rf() 31 } else { 32 if ret.Get(0) != nil { 33 r0 = ret.Get(0).([]hotstuff.TimeoutSignerInfo) 34 } 35 } 36 37 if rf, ok := ret.Get(1).(func() crypto.Signature); ok { 38 r1 = rf() 39 } else { 40 if ret.Get(1) != nil { 41 r1 = ret.Get(1).(crypto.Signature) 42 } 43 } 44 45 if rf, ok := ret.Get(2).(func() error); ok { 46 r2 = rf() 47 } else { 48 r2 = ret.Error(2) 49 } 50 51 return r0, r1, r2 52 } 53 54 // TotalWeight provides a mock function with given fields: 55 func (_m *TimeoutSignatureAggregator) TotalWeight() uint64 { 56 ret := _m.Called() 57 58 var r0 uint64 59 if rf, ok := ret.Get(0).(func() uint64); ok { 60 r0 = rf() 61 } else { 62 r0 = ret.Get(0).(uint64) 63 } 64 65 return r0 66 } 67 68 // VerifyAndAdd provides a mock function with given fields: signerID, sig, newestQCView 69 func (_m *TimeoutSignatureAggregator) VerifyAndAdd(signerID flow.Identifier, sig crypto.Signature, newestQCView uint64) (uint64, error) { 70 ret := _m.Called(signerID, sig, newestQCView) 71 72 var r0 uint64 73 var r1 error 74 if rf, ok := ret.Get(0).(func(flow.Identifier, crypto.Signature, uint64) (uint64, error)); ok { 75 return rf(signerID, sig, newestQCView) 76 } 77 if rf, ok := ret.Get(0).(func(flow.Identifier, crypto.Signature, uint64) uint64); ok { 78 r0 = rf(signerID, sig, newestQCView) 79 } else { 80 r0 = ret.Get(0).(uint64) 81 } 82 83 if rf, ok := ret.Get(1).(func(flow.Identifier, crypto.Signature, uint64) error); ok { 84 r1 = rf(signerID, sig, newestQCView) 85 } else { 86 r1 = ret.Error(1) 87 } 88 89 return r0, r1 90 } 91 92 // View provides a mock function with given fields: 93 func (_m *TimeoutSignatureAggregator) View() uint64 { 94 ret := _m.Called() 95 96 var r0 uint64 97 if rf, ok := ret.Get(0).(func() uint64); ok { 98 r0 = rf() 99 } else { 100 r0 = ret.Get(0).(uint64) 101 } 102 103 return r0 104 } 105 106 type mockConstructorTestingTNewTimeoutSignatureAggregator interface { 107 mock.TestingT 108 Cleanup(func()) 109 } 110 111 // NewTimeoutSignatureAggregator creates a new instance of TimeoutSignatureAggregator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 112 func NewTimeoutSignatureAggregator(t mockConstructorTestingTNewTimeoutSignatureAggregator) *TimeoutSignatureAggregator { 113 mock := &TimeoutSignatureAggregator{} 114 mock.Mock.Test(t) 115 116 t.Cleanup(func() { mock.AssertExpectations(t) }) 117 118 return mock 119 }