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