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