github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/protocol_state/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 protocol "github.com/onflow/flow-go/state/protocol" 10 11 protocol_state "github.com/onflow/flow-go/state/protocol/protocol_state" 12 13 transaction "github.com/onflow/flow-go/storage/badger/transaction" 14 ) 15 16 // ProtocolKVStore is an autogenerated mock type for the ProtocolKVStore type 17 type ProtocolKVStore struct { 18 mock.Mock 19 } 20 21 // ByBlockID provides a mock function with given fields: blockID 22 func (_m *ProtocolKVStore) ByBlockID(blockID flow.Identifier) (protocol_state.KVStoreAPI, error) { 23 ret := _m.Called(blockID) 24 25 var r0 protocol_state.KVStoreAPI 26 var r1 error 27 if rf, ok := ret.Get(0).(func(flow.Identifier) (protocol_state.KVStoreAPI, error)); ok { 28 return rf(blockID) 29 } 30 if rf, ok := ret.Get(0).(func(flow.Identifier) protocol_state.KVStoreAPI); ok { 31 r0 = rf(blockID) 32 } else { 33 if ret.Get(0) != nil { 34 r0 = ret.Get(0).(protocol_state.KVStoreAPI) 35 } 36 } 37 38 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 39 r1 = rf(blockID) 40 } else { 41 r1 = ret.Error(1) 42 } 43 44 return r0, r1 45 } 46 47 // ByID provides a mock function with given fields: id 48 func (_m *ProtocolKVStore) ByID(id flow.Identifier) (protocol_state.KVStoreAPI, error) { 49 ret := _m.Called(id) 50 51 var r0 protocol_state.KVStoreAPI 52 var r1 error 53 if rf, ok := ret.Get(0).(func(flow.Identifier) (protocol_state.KVStoreAPI, error)); ok { 54 return rf(id) 55 } 56 if rf, ok := ret.Get(0).(func(flow.Identifier) protocol_state.KVStoreAPI); ok { 57 r0 = rf(id) 58 } else { 59 if ret.Get(0) != nil { 60 r0 = ret.Get(0).(protocol_state.KVStoreAPI) 61 } 62 } 63 64 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 65 r1 = rf(id) 66 } else { 67 r1 = ret.Error(1) 68 } 69 70 return r0, r1 71 } 72 73 // IndexTx provides a mock function with given fields: blockID, stateID 74 func (_m *ProtocolKVStore) IndexTx(blockID flow.Identifier, stateID flow.Identifier) func(*transaction.Tx) error { 75 ret := _m.Called(blockID, stateID) 76 77 var r0 func(*transaction.Tx) error 78 if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier) func(*transaction.Tx) error); ok { 79 r0 = rf(blockID, stateID) 80 } else { 81 if ret.Get(0) != nil { 82 r0 = ret.Get(0).(func(*transaction.Tx) error) 83 } 84 } 85 86 return r0 87 } 88 89 // StoreTx provides a mock function with given fields: stateID, kvStore 90 func (_m *ProtocolKVStore) StoreTx(stateID flow.Identifier, kvStore protocol.KVStoreReader) func(*transaction.Tx) error { 91 ret := _m.Called(stateID, kvStore) 92 93 var r0 func(*transaction.Tx) error 94 if rf, ok := ret.Get(0).(func(flow.Identifier, protocol.KVStoreReader) func(*transaction.Tx) error); ok { 95 r0 = rf(stateID, kvStore) 96 } else { 97 if ret.Get(0) != nil { 98 r0 = ret.Get(0).(func(*transaction.Tx) error) 99 } 100 } 101 102 return r0 103 } 104 105 type mockConstructorTestingTNewProtocolKVStore interface { 106 mock.TestingT 107 Cleanup(func()) 108 } 109 110 // 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. 111 func NewProtocolKVStore(t mockConstructorTestingTNewProtocolKVStore) *ProtocolKVStore { 112 mock := &ProtocolKVStore{} 113 mock.Mock.Test(t) 114 115 t.Cleanup(func() { mock.AssertExpectations(t) }) 116 117 return mock 118 }