github.com/koko1123/flow-go-1@v0.29.6/ledger/mock/ledger.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 ledger "github.com/koko1123/flow-go-1/ledger" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // Ledger is an autogenerated mock type for the Ledger type 11 type Ledger struct { 12 mock.Mock 13 } 14 15 // Done provides a mock function with given fields: 16 func (_m *Ledger) Done() <-chan struct{} { 17 ret := _m.Called() 18 19 var r0 <-chan struct{} 20 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 21 r0 = rf() 22 } else { 23 if ret.Get(0) != nil { 24 r0 = ret.Get(0).(<-chan struct{}) 25 } 26 } 27 28 return r0 29 } 30 31 // Get provides a mock function with given fields: query 32 func (_m *Ledger) Get(query *ledger.Query) ([]ledger.Value, error) { 33 ret := _m.Called(query) 34 35 var r0 []ledger.Value 36 if rf, ok := ret.Get(0).(func(*ledger.Query) []ledger.Value); ok { 37 r0 = rf(query) 38 } else { 39 if ret.Get(0) != nil { 40 r0 = ret.Get(0).([]ledger.Value) 41 } 42 } 43 44 var r1 error 45 if rf, ok := ret.Get(1).(func(*ledger.Query) error); ok { 46 r1 = rf(query) 47 } else { 48 r1 = ret.Error(1) 49 } 50 51 return r0, r1 52 } 53 54 // GetSingleValue provides a mock function with given fields: query 55 func (_m *Ledger) GetSingleValue(query *ledger.QuerySingleValue) (ledger.Value, error) { 56 ret := _m.Called(query) 57 58 var r0 ledger.Value 59 if rf, ok := ret.Get(0).(func(*ledger.QuerySingleValue) ledger.Value); ok { 60 r0 = rf(query) 61 } else { 62 if ret.Get(0) != nil { 63 r0 = ret.Get(0).(ledger.Value) 64 } 65 } 66 67 var r1 error 68 if rf, ok := ret.Get(1).(func(*ledger.QuerySingleValue) error); ok { 69 r1 = rf(query) 70 } else { 71 r1 = ret.Error(1) 72 } 73 74 return r0, r1 75 } 76 77 // HasState provides a mock function with given fields: state 78 func (_m *Ledger) HasState(state ledger.State) bool { 79 ret := _m.Called(state) 80 81 var r0 bool 82 if rf, ok := ret.Get(0).(func(ledger.State) bool); ok { 83 r0 = rf(state) 84 } else { 85 r0 = ret.Get(0).(bool) 86 } 87 88 return r0 89 } 90 91 // InitialState provides a mock function with given fields: 92 func (_m *Ledger) InitialState() ledger.State { 93 ret := _m.Called() 94 95 var r0 ledger.State 96 if rf, ok := ret.Get(0).(func() ledger.State); ok { 97 r0 = rf() 98 } else { 99 if ret.Get(0) != nil { 100 r0 = ret.Get(0).(ledger.State) 101 } 102 } 103 104 return r0 105 } 106 107 // Prove provides a mock function with given fields: query 108 func (_m *Ledger) Prove(query *ledger.Query) (ledger.Proof, error) { 109 ret := _m.Called(query) 110 111 var r0 ledger.Proof 112 if rf, ok := ret.Get(0).(func(*ledger.Query) ledger.Proof); ok { 113 r0 = rf(query) 114 } else { 115 if ret.Get(0) != nil { 116 r0 = ret.Get(0).(ledger.Proof) 117 } 118 } 119 120 var r1 error 121 if rf, ok := ret.Get(1).(func(*ledger.Query) error); ok { 122 r1 = rf(query) 123 } else { 124 r1 = ret.Error(1) 125 } 126 127 return r0, r1 128 } 129 130 // Ready provides a mock function with given fields: 131 func (_m *Ledger) Ready() <-chan struct{} { 132 ret := _m.Called() 133 134 var r0 <-chan struct{} 135 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 136 r0 = rf() 137 } else { 138 if ret.Get(0) != nil { 139 r0 = ret.Get(0).(<-chan struct{}) 140 } 141 } 142 143 return r0 144 } 145 146 // Set provides a mock function with given fields: update 147 func (_m *Ledger) Set(update *ledger.Update) (ledger.State, *ledger.TrieUpdate, error) { 148 ret := _m.Called(update) 149 150 var r0 ledger.State 151 if rf, ok := ret.Get(0).(func(*ledger.Update) ledger.State); ok { 152 r0 = rf(update) 153 } else { 154 if ret.Get(0) != nil { 155 r0 = ret.Get(0).(ledger.State) 156 } 157 } 158 159 var r1 *ledger.TrieUpdate 160 if rf, ok := ret.Get(1).(func(*ledger.Update) *ledger.TrieUpdate); ok { 161 r1 = rf(update) 162 } else { 163 if ret.Get(1) != nil { 164 r1 = ret.Get(1).(*ledger.TrieUpdate) 165 } 166 } 167 168 var r2 error 169 if rf, ok := ret.Get(2).(func(*ledger.Update) error); ok { 170 r2 = rf(update) 171 } else { 172 r2 = ret.Error(2) 173 } 174 175 return r0, r1, r2 176 } 177 178 type mockConstructorTestingTNewLedger interface { 179 mock.TestingT 180 Cleanup(func()) 181 } 182 183 // 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. 184 func NewLedger(t mockConstructorTestingTNewLedger) *Ledger { 185 mock := &Ledger{} 186 mock.Mock.Test(t) 187 188 t.Cleanup(func() { mock.AssertExpectations(t) }) 189 190 return mock 191 }