github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/core/committer/txvalidator/mocks/query_executor.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 package mocks 4 5 import coreledger "github.com/hechain20/hechain/core/ledger" 6 import ledger "github.com/hechain20/hechain/common/ledger" 7 import mock "github.com/stretchr/testify/mock" 8 9 // QueryExecutor is an autogenerated mock type for the QueryExecutor type 10 type QueryExecutor struct { 11 mock.Mock 12 } 13 14 // Done provides a mock function with given fields: 15 func (_m *QueryExecutor) Done() { 16 _m.Called() 17 } 18 19 // ExecuteQuery provides a mock function with given fields: namespace, query 20 func (_m *QueryExecutor) ExecuteQuery(namespace string, query string) (ledger.ResultsIterator, error) { 21 ret := _m.Called(namespace, query) 22 23 var r0 ledger.ResultsIterator 24 if rf, ok := ret.Get(0).(func(string, string) ledger.ResultsIterator); ok { 25 r0 = rf(namespace, query) 26 } else { 27 if ret.Get(0) != nil { 28 r0 = ret.Get(0).(ledger.ResultsIterator) 29 } 30 } 31 32 var r1 error 33 if rf, ok := ret.Get(1).(func(string, string) error); ok { 34 r1 = rf(namespace, query) 35 } else { 36 r1 = ret.Error(1) 37 } 38 39 return r0, r1 40 } 41 42 // ExecuteQueryOnPrivateData provides a mock function with given fields: namespace, collection, query 43 func (_m *QueryExecutor) ExecuteQueryOnPrivateData(namespace string, collection string, query string) (ledger.ResultsIterator, error) { 44 ret := _m.Called(namespace, collection, query) 45 46 var r0 ledger.ResultsIterator 47 if rf, ok := ret.Get(0).(func(string, string, string) ledger.ResultsIterator); ok { 48 r0 = rf(namespace, collection, query) 49 } else { 50 if ret.Get(0) != nil { 51 r0 = ret.Get(0).(ledger.ResultsIterator) 52 } 53 } 54 55 var r1 error 56 if rf, ok := ret.Get(1).(func(string, string, string) error); ok { 57 r1 = rf(namespace, collection, query) 58 } else { 59 r1 = ret.Error(1) 60 } 61 62 return r0, r1 63 } 64 65 // ExecuteQueryWithPagination provides a mock function with given fields: namespace, query, bookmark, pageSize 66 func (_m *QueryExecutor) ExecuteQueryWithPagination(namespace string, query string, bookmark string, pageSize int32) (coreledger.QueryResultsIterator, error) { 67 ret := _m.Called(namespace, query, bookmark, pageSize) 68 69 var r0 coreledger.QueryResultsIterator 70 if rf, ok := ret.Get(0).(func(string, string, string, int32) coreledger.QueryResultsIterator); ok { 71 r0 = rf(namespace, query, bookmark, pageSize) 72 } else { 73 if ret.Get(0) != nil { 74 r0 = ret.Get(0).(coreledger.QueryResultsIterator) 75 } 76 } 77 78 var r1 error 79 if rf, ok := ret.Get(1).(func(string, string, string, int32) error); ok { 80 r1 = rf(namespace, query, bookmark, pageSize) 81 } else { 82 r1 = ret.Error(1) 83 } 84 85 return r0, r1 86 } 87 88 // GetPrivateData provides a mock function with given fields: namespace, collection, key 89 func (_m *QueryExecutor) GetPrivateData(namespace string, collection string, key string) ([]byte, error) { 90 ret := _m.Called(namespace, collection, key) 91 92 var r0 []byte 93 if rf, ok := ret.Get(0).(func(string, string, string) []byte); ok { 94 r0 = rf(namespace, collection, key) 95 } else { 96 if ret.Get(0) != nil { 97 r0 = ret.Get(0).([]byte) 98 } 99 } 100 101 var r1 error 102 if rf, ok := ret.Get(1).(func(string, string, string) error); ok { 103 r1 = rf(namespace, collection, key) 104 } else { 105 r1 = ret.Error(1) 106 } 107 108 return r0, r1 109 } 110 111 // GetPrivateDataHash provides a mock function with given fields: namespace, collection, key 112 func (_m *QueryExecutor) GetPrivateDataHash(namespace string, collection string, key string) ([]byte, error) { 113 ret := _m.Called(namespace, collection, key) 114 115 var r0 []byte 116 if rf, ok := ret.Get(0).(func(string, string, string) []byte); ok { 117 r0 = rf(namespace, collection, key) 118 } else { 119 if ret.Get(0) != nil { 120 r0 = ret.Get(0).([]byte) 121 } 122 } 123 124 var r1 error 125 if rf, ok := ret.Get(1).(func(string, string, string) error); ok { 126 r1 = rf(namespace, collection, key) 127 } else { 128 r1 = ret.Error(1) 129 } 130 131 return r0, r1 132 } 133 134 // GetPrivateDataMetadata provides a mock function with given fields: namespace, collection, key 135 func (_m *QueryExecutor) GetPrivateDataMetadata(namespace string, collection string, key string) (map[string][]byte, error) { 136 ret := _m.Called(namespace, collection, key) 137 138 var r0 map[string][]byte 139 if rf, ok := ret.Get(0).(func(string, string, string) map[string][]byte); ok { 140 r0 = rf(namespace, collection, key) 141 } else { 142 if ret.Get(0) != nil { 143 r0 = ret.Get(0).(map[string][]byte) 144 } 145 } 146 147 var r1 error 148 if rf, ok := ret.Get(1).(func(string, string, string) error); ok { 149 r1 = rf(namespace, collection, key) 150 } else { 151 r1 = ret.Error(1) 152 } 153 154 return r0, r1 155 } 156 157 // GetPrivateDataMetadataByHash provides a mock function with given fields: namespace, collection, keyhash 158 func (_m *QueryExecutor) GetPrivateDataMetadataByHash(namespace string, collection string, keyhash []byte) (map[string][]byte, error) { 159 ret := _m.Called(namespace, collection, keyhash) 160 161 var r0 map[string][]byte 162 if rf, ok := ret.Get(0).(func(string, string, []byte) map[string][]byte); ok { 163 r0 = rf(namespace, collection, keyhash) 164 } else { 165 if ret.Get(0) != nil { 166 r0 = ret.Get(0).(map[string][]byte) 167 } 168 } 169 170 var r1 error 171 if rf, ok := ret.Get(1).(func(string, string, []byte) error); ok { 172 r1 = rf(namespace, collection, keyhash) 173 } else { 174 r1 = ret.Error(1) 175 } 176 177 return r0, r1 178 } 179 180 // GetPrivateDataMultipleKeys provides a mock function with given fields: namespace, collection, keys 181 func (_m *QueryExecutor) GetPrivateDataMultipleKeys(namespace string, collection string, keys []string) ([][]byte, error) { 182 ret := _m.Called(namespace, collection, keys) 183 184 var r0 [][]byte 185 if rf, ok := ret.Get(0).(func(string, string, []string) [][]byte); ok { 186 r0 = rf(namespace, collection, keys) 187 } else { 188 if ret.Get(0) != nil { 189 r0 = ret.Get(0).([][]byte) 190 } 191 } 192 193 var r1 error 194 if rf, ok := ret.Get(1).(func(string, string, []string) error); ok { 195 r1 = rf(namespace, collection, keys) 196 } else { 197 r1 = ret.Error(1) 198 } 199 200 return r0, r1 201 } 202 203 // GetPrivateDataRangeScanIterator provides a mock function with given fields: namespace, collection, startKey, endKey 204 func (_m *QueryExecutor) GetPrivateDataRangeScanIterator(namespace string, collection string, startKey string, endKey string) (ledger.ResultsIterator, error) { 205 ret := _m.Called(namespace, collection, startKey, endKey) 206 207 var r0 ledger.ResultsIterator 208 if rf, ok := ret.Get(0).(func(string, string, string, string) ledger.ResultsIterator); ok { 209 r0 = rf(namespace, collection, startKey, endKey) 210 } else { 211 if ret.Get(0) != nil { 212 r0 = ret.Get(0).(ledger.ResultsIterator) 213 } 214 } 215 216 var r1 error 217 if rf, ok := ret.Get(1).(func(string, string, string, string) error); ok { 218 r1 = rf(namespace, collection, startKey, endKey) 219 } else { 220 r1 = ret.Error(1) 221 } 222 223 return r0, r1 224 } 225 226 // GetState provides a mock function with given fields: namespace, key 227 func (_m *QueryExecutor) GetState(namespace string, key string) ([]byte, error) { 228 ret := _m.Called(namespace, key) 229 230 var r0 []byte 231 if rf, ok := ret.Get(0).(func(string, string) []byte); ok { 232 r0 = rf(namespace, key) 233 } else { 234 if ret.Get(0) != nil { 235 r0 = ret.Get(0).([]byte) 236 } 237 } 238 239 var r1 error 240 if rf, ok := ret.Get(1).(func(string, string) error); ok { 241 r1 = rf(namespace, key) 242 } else { 243 r1 = ret.Error(1) 244 } 245 246 return r0, r1 247 } 248 249 // GetStateMetadata provides a mock function with given fields: namespace, key 250 func (_m *QueryExecutor) GetStateMetadata(namespace string, key string) (map[string][]byte, error) { 251 ret := _m.Called(namespace, key) 252 253 var r0 map[string][]byte 254 if rf, ok := ret.Get(0).(func(string, string) map[string][]byte); ok { 255 r0 = rf(namespace, key) 256 } else { 257 if ret.Get(0) != nil { 258 r0 = ret.Get(0).(map[string][]byte) 259 } 260 } 261 262 var r1 error 263 if rf, ok := ret.Get(1).(func(string, string) error); ok { 264 r1 = rf(namespace, key) 265 } else { 266 r1 = ret.Error(1) 267 } 268 269 return r0, r1 270 } 271 272 // GetStateMultipleKeys provides a mock function with given fields: namespace, keys 273 func (_m *QueryExecutor) GetStateMultipleKeys(namespace string, keys []string) ([][]byte, error) { 274 ret := _m.Called(namespace, keys) 275 276 var r0 [][]byte 277 if rf, ok := ret.Get(0).(func(string, []string) [][]byte); ok { 278 r0 = rf(namespace, keys) 279 } else { 280 if ret.Get(0) != nil { 281 r0 = ret.Get(0).([][]byte) 282 } 283 } 284 285 var r1 error 286 if rf, ok := ret.Get(1).(func(string, []string) error); ok { 287 r1 = rf(namespace, keys) 288 } else { 289 r1 = ret.Error(1) 290 } 291 292 return r0, r1 293 } 294 295 // GetStateRangeScanIterator provides a mock function with given fields: namespace, startKey, endKey 296 func (_m *QueryExecutor) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (ledger.ResultsIterator, error) { 297 ret := _m.Called(namespace, startKey, endKey) 298 299 var r0 ledger.ResultsIterator 300 if rf, ok := ret.Get(0).(func(string, string, string) ledger.ResultsIterator); ok { 301 r0 = rf(namespace, startKey, endKey) 302 } else { 303 if ret.Get(0) != nil { 304 r0 = ret.Get(0).(ledger.ResultsIterator) 305 } 306 } 307 308 var r1 error 309 if rf, ok := ret.Get(1).(func(string, string, string) error); ok { 310 r1 = rf(namespace, startKey, endKey) 311 } else { 312 r1 = ret.Error(1) 313 } 314 315 return r0, r1 316 } 317 318 // GetStateRangeScanIteratorWithPagination provides a mock function with given fields: namespace, startKey, endKey, pageSize 319 func (_m *QueryExecutor) GetStateRangeScanIteratorWithPagination(namespace string, startKey string, endKey string, pageSize int32) (coreledger.QueryResultsIterator, error) { 320 ret := _m.Called(namespace, startKey, endKey, pageSize) 321 322 var r0 coreledger.QueryResultsIterator 323 if rf, ok := ret.Get(0).(func(string, string, string, int32) coreledger.QueryResultsIterator); ok { 324 r0 = rf(namespace, startKey, endKey, pageSize) 325 } else { 326 if ret.Get(0) != nil { 327 r0 = ret.Get(0).(coreledger.QueryResultsIterator) 328 } 329 } 330 331 var r1 error 332 if rf, ok := ret.Get(1).(func(string, string, string, int32) error); ok { 333 r1 = rf(namespace, startKey, endKey, pageSize) 334 } else { 335 r1 = ret.Error(1) 336 } 337 338 return r0, r1 339 }