github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/storage/mock/protocol_state.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 // ProtocolState is an autogenerated mock type for the ProtocolState type 13 type ProtocolState struct { 14 mock.Mock 15 } 16 17 // ByBlockID provides a mock function with given fields: blockID 18 func (_m *ProtocolState) ByBlockID(blockID flow.Identifier) (*flow.RichProtocolStateEntry, error) { 19 ret := _m.Called(blockID) 20 21 var r0 *flow.RichProtocolStateEntry 22 var r1 error 23 if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.RichProtocolStateEntry, error)); ok { 24 return rf(blockID) 25 } 26 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.RichProtocolStateEntry); ok { 27 r0 = rf(blockID) 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(*flow.RichProtocolStateEntry) 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 *ProtocolState) ByID(id flow.Identifier) (*flow.RichProtocolStateEntry, error) { 45 ret := _m.Called(id) 46 47 var r0 *flow.RichProtocolStateEntry 48 var r1 error 49 if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.RichProtocolStateEntry, error)); ok { 50 return rf(id) 51 } 52 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.RichProtocolStateEntry); ok { 53 r0 = rf(id) 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).(*flow.RichProtocolStateEntry) 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 // Index provides a mock function with given fields: blockID, protocolStateID 70 func (_m *ProtocolState) Index(blockID flow.Identifier, protocolStateID flow.Identifier) func(*transaction.Tx) error { 71 ret := _m.Called(blockID, protocolStateID) 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, protocolStateID) 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: protocolStateID, protocolState 86 func (_m *ProtocolState) StoreTx(protocolStateID flow.Identifier, protocolState *flow.ProtocolStateEntry) func(*transaction.Tx) error { 87 ret := _m.Called(protocolStateID, protocolState) 88 89 var r0 func(*transaction.Tx) error 90 if rf, ok := ret.Get(0).(func(flow.Identifier, *flow.ProtocolStateEntry) func(*transaction.Tx) error); ok { 91 r0 = rf(protocolStateID, protocolState) 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 mockConstructorTestingTNewProtocolState interface { 102 mock.TestingT 103 Cleanup(func()) 104 } 105 106 // NewProtocolState creates a new instance of ProtocolState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 107 func NewProtocolState(t mockConstructorTestingTNewProtocolState) *ProtocolState { 108 mock := &ProtocolState{} 109 mock.Mock.Test(t) 110 111 t.Cleanup(func() { mock.AssertExpectations(t) }) 112 113 return mock 114 }