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