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