github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/protocol_state/mock/kv_store_api.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 14 // KVStoreAPI is an autogenerated mock type for the KVStoreAPI type 15 type KVStoreAPI struct { 16 mock.Mock 17 } 18 19 // GetEpochStateID provides a mock function with given fields: 20 func (_m *KVStoreAPI) GetEpochStateID() flow.Identifier { 21 ret := _m.Called() 22 23 var r0 flow.Identifier 24 if rf, ok := ret.Get(0).(func() flow.Identifier); ok { 25 r0 = rf() 26 } else { 27 if ret.Get(0) != nil { 28 r0 = ret.Get(0).(flow.Identifier) 29 } 30 } 31 32 return r0 33 } 34 35 // GetProtocolStateVersion provides a mock function with given fields: 36 func (_m *KVStoreAPI) GetProtocolStateVersion() uint64 { 37 ret := _m.Called() 38 39 var r0 uint64 40 if rf, ok := ret.Get(0).(func() uint64); ok { 41 r0 = rf() 42 } else { 43 r0 = ret.Get(0).(uint64) 44 } 45 46 return r0 47 } 48 49 // GetVersionUpgrade provides a mock function with given fields: 50 func (_m *KVStoreAPI) GetVersionUpgrade() *protocol.ViewBasedActivator[uint64] { 51 ret := _m.Called() 52 53 var r0 *protocol.ViewBasedActivator[uint64] 54 if rf, ok := ret.Get(0).(func() *protocol.ViewBasedActivator[uint64]); ok { 55 r0 = rf() 56 } else { 57 if ret.Get(0) != nil { 58 r0 = ret.Get(0).(*protocol.ViewBasedActivator[uint64]) 59 } 60 } 61 62 return r0 63 } 64 65 // ID provides a mock function with given fields: 66 func (_m *KVStoreAPI) ID() flow.Identifier { 67 ret := _m.Called() 68 69 var r0 flow.Identifier 70 if rf, ok := ret.Get(0).(func() flow.Identifier); ok { 71 r0 = rf() 72 } else { 73 if ret.Get(0) != nil { 74 r0 = ret.Get(0).(flow.Identifier) 75 } 76 } 77 78 return r0 79 } 80 81 // Replicate provides a mock function with given fields: protocolVersion 82 func (_m *KVStoreAPI) Replicate(protocolVersion uint64) (protocol_state.KVStoreMutator, error) { 83 ret := _m.Called(protocolVersion) 84 85 var r0 protocol_state.KVStoreMutator 86 var r1 error 87 if rf, ok := ret.Get(0).(func(uint64) (protocol_state.KVStoreMutator, error)); ok { 88 return rf(protocolVersion) 89 } 90 if rf, ok := ret.Get(0).(func(uint64) protocol_state.KVStoreMutator); ok { 91 r0 = rf(protocolVersion) 92 } else { 93 if ret.Get(0) != nil { 94 r0 = ret.Get(0).(protocol_state.KVStoreMutator) 95 } 96 } 97 98 if rf, ok := ret.Get(1).(func(uint64) error); ok { 99 r1 = rf(protocolVersion) 100 } else { 101 r1 = ret.Error(1) 102 } 103 104 return r0, r1 105 } 106 107 // VersionedEncode provides a mock function with given fields: 108 func (_m *KVStoreAPI) VersionedEncode() (uint64, []byte, error) { 109 ret := _m.Called() 110 111 var r0 uint64 112 var r1 []byte 113 var r2 error 114 if rf, ok := ret.Get(0).(func() (uint64, []byte, error)); ok { 115 return rf() 116 } 117 if rf, ok := ret.Get(0).(func() uint64); ok { 118 r0 = rf() 119 } else { 120 r0 = ret.Get(0).(uint64) 121 } 122 123 if rf, ok := ret.Get(1).(func() []byte); ok { 124 r1 = rf() 125 } else { 126 if ret.Get(1) != nil { 127 r1 = ret.Get(1).([]byte) 128 } 129 } 130 131 if rf, ok := ret.Get(2).(func() error); ok { 132 r2 = rf() 133 } else { 134 r2 = ret.Error(2) 135 } 136 137 return r0, r1, r2 138 } 139 140 type mockConstructorTestingTNewKVStoreAPI interface { 141 mock.TestingT 142 Cleanup(func()) 143 } 144 145 // NewKVStoreAPI creates a new instance of KVStoreAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 146 func NewKVStoreAPI(t mockConstructorTestingTNewKVStoreAPI) *KVStoreAPI { 147 mock := &KVStoreAPI{} 148 mock.Mock.Test(t) 149 150 t.Cleanup(func() { mock.AssertExpectations(t) }) 151 152 return mock 153 }