github.com/koko1123/flow-go-1@v0.29.6/engine/protocol/mock/api.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 context "context" 7 8 access "github.com/koko1123/flow-go-1/access" 9 10 flow "github.com/koko1123/flow-go-1/model/flow" 11 12 mock "github.com/stretchr/testify/mock" 13 ) 14 15 // API is an autogenerated mock type for the API type 16 type API struct { 17 mock.Mock 18 } 19 20 // GetBlockByHeight provides a mock function with given fields: ctx, height 21 func (_m *API) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error) { 22 ret := _m.Called(ctx, height) 23 24 var r0 *flow.Block 25 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Block); ok { 26 r0 = rf(ctx, height) 27 } else { 28 if ret.Get(0) != nil { 29 r0 = ret.Get(0).(*flow.Block) 30 } 31 } 32 33 var r1 error 34 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 35 r1 = rf(ctx, height) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 // GetBlockByID provides a mock function with given fields: ctx, id 44 func (_m *API) GetBlockByID(ctx context.Context, id flow.Identifier) (*flow.Block, error) { 45 ret := _m.Called(ctx, id) 46 47 var r0 *flow.Block 48 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Block); ok { 49 r0 = rf(ctx, id) 50 } else { 51 if ret.Get(0) != nil { 52 r0 = ret.Get(0).(*flow.Block) 53 } 54 } 55 56 var r1 error 57 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 58 r1 = rf(ctx, id) 59 } else { 60 r1 = ret.Error(1) 61 } 62 63 return r0, r1 64 } 65 66 // GetBlockHeaderByHeight provides a mock function with given fields: ctx, height 67 func (_m *API) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.Header, error) { 68 ret := _m.Called(ctx, height) 69 70 var r0 *flow.Header 71 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Header); ok { 72 r0 = rf(ctx, height) 73 } else { 74 if ret.Get(0) != nil { 75 r0 = ret.Get(0).(*flow.Header) 76 } 77 } 78 79 var r1 error 80 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 81 r1 = rf(ctx, height) 82 } else { 83 r1 = ret.Error(1) 84 } 85 86 return r0, r1 87 } 88 89 // GetBlockHeaderByID provides a mock function with given fields: ctx, id 90 func (_m *API) GetBlockHeaderByID(ctx context.Context, id flow.Identifier) (*flow.Header, error) { 91 ret := _m.Called(ctx, id) 92 93 var r0 *flow.Header 94 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Header); ok { 95 r0 = rf(ctx, id) 96 } else { 97 if ret.Get(0) != nil { 98 r0 = ret.Get(0).(*flow.Header) 99 } 100 } 101 102 var r1 error 103 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 104 r1 = rf(ctx, id) 105 } else { 106 r1 = ret.Error(1) 107 } 108 109 return r0, r1 110 } 111 112 // GetLatestBlock provides a mock function with given fields: ctx, isSealed 113 func (_m *API) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, error) { 114 ret := _m.Called(ctx, isSealed) 115 116 var r0 *flow.Block 117 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Block); ok { 118 r0 = rf(ctx, isSealed) 119 } else { 120 if ret.Get(0) != nil { 121 r0 = ret.Get(0).(*flow.Block) 122 } 123 } 124 125 var r1 error 126 if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { 127 r1 = rf(ctx, isSealed) 128 } else { 129 r1 = ret.Error(1) 130 } 131 132 return r0, r1 133 } 134 135 // GetLatestBlockHeader provides a mock function with given fields: ctx, isSealed 136 func (_m *API) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.Header, error) { 137 ret := _m.Called(ctx, isSealed) 138 139 var r0 *flow.Header 140 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Header); ok { 141 r0 = rf(ctx, isSealed) 142 } else { 143 if ret.Get(0) != nil { 144 r0 = ret.Get(0).(*flow.Header) 145 } 146 } 147 148 var r1 error 149 if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { 150 r1 = rf(ctx, isSealed) 151 } else { 152 r1 = ret.Error(1) 153 } 154 155 return r0, r1 156 } 157 158 // GetLatestProtocolStateSnapshot provides a mock function with given fields: ctx 159 func (_m *API) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error) { 160 ret := _m.Called(ctx) 161 162 var r0 []byte 163 if rf, ok := ret.Get(0).(func(context.Context) []byte); ok { 164 r0 = rf(ctx) 165 } else { 166 if ret.Get(0) != nil { 167 r0 = ret.Get(0).([]byte) 168 } 169 } 170 171 var r1 error 172 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 173 r1 = rf(ctx) 174 } else { 175 r1 = ret.Error(1) 176 } 177 178 return r0, r1 179 } 180 181 // GetNetworkParameters provides a mock function with given fields: ctx 182 func (_m *API) GetNetworkParameters(ctx context.Context) access.NetworkParameters { 183 ret := _m.Called(ctx) 184 185 var r0 access.NetworkParameters 186 if rf, ok := ret.Get(0).(func(context.Context) access.NetworkParameters); ok { 187 r0 = rf(ctx) 188 } else { 189 r0 = ret.Get(0).(access.NetworkParameters) 190 } 191 192 return r0 193 } 194 195 type mockConstructorTestingTNewAPI interface { 196 mock.TestingT 197 Cleanup(func()) 198 } 199 200 // NewAPI creates a new instance of API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 201 func NewAPI(t mockConstructorTestingTNewAPI) *API { 202 mock := &API{} 203 mock.Mock.Test(t) 204 205 t.Cleanup(func() { mock.AssertExpectations(t) }) 206 207 return mock 208 }