github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/access/state_stream/mock/api.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	context "context"
     7  
     8  	flow "github.com/onflow/flow-go/model/flow"
     9  	execution_data "github.com/onflow/flow-go/module/executiondatasync/execution_data"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	state_stream "github.com/onflow/flow-go/engine/access/state_stream"
    14  
    15  	subscription "github.com/onflow/flow-go/engine/access/subscription"
    16  )
    17  
    18  // API is an autogenerated mock type for the API type
    19  type API struct {
    20  	mock.Mock
    21  }
    22  
    23  // GetExecutionDataByBlockID provides a mock function with given fields: ctx, blockID
    24  func (_m *API) GetExecutionDataByBlockID(ctx context.Context, blockID flow.Identifier) (*execution_data.BlockExecutionData, error) {
    25  	ret := _m.Called(ctx, blockID)
    26  
    27  	var r0 *execution_data.BlockExecutionData
    28  	var r1 error
    29  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*execution_data.BlockExecutionData, error)); ok {
    30  		return rf(ctx, blockID)
    31  	}
    32  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *execution_data.BlockExecutionData); ok {
    33  		r0 = rf(ctx, blockID)
    34  	} else {
    35  		if ret.Get(0) != nil {
    36  			r0 = ret.Get(0).(*execution_data.BlockExecutionData)
    37  		}
    38  	}
    39  
    40  	if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok {
    41  		r1 = rf(ctx, blockID)
    42  	} else {
    43  		r1 = ret.Error(1)
    44  	}
    45  
    46  	return r0, r1
    47  }
    48  
    49  // GetRegisterValues provides a mock function with given fields: registerIDs, height
    50  func (_m *API) GetRegisterValues(registerIDs flow.RegisterIDs, height uint64) ([][]byte, error) {
    51  	ret := _m.Called(registerIDs, height)
    52  
    53  	var r0 [][]byte
    54  	var r1 error
    55  	if rf, ok := ret.Get(0).(func(flow.RegisterIDs, uint64) ([][]byte, error)); ok {
    56  		return rf(registerIDs, height)
    57  	}
    58  	if rf, ok := ret.Get(0).(func(flow.RegisterIDs, uint64) [][]byte); ok {
    59  		r0 = rf(registerIDs, height)
    60  	} else {
    61  		if ret.Get(0) != nil {
    62  			r0 = ret.Get(0).([][]byte)
    63  		}
    64  	}
    65  
    66  	if rf, ok := ret.Get(1).(func(flow.RegisterIDs, uint64) error); ok {
    67  		r1 = rf(registerIDs, height)
    68  	} else {
    69  		r1 = ret.Error(1)
    70  	}
    71  
    72  	return r0, r1
    73  }
    74  
    75  // SubscribeAccountStatusesFromLatestBlock provides a mock function with given fields: ctx, filter
    76  func (_m *API) SubscribeAccountStatusesFromLatestBlock(ctx context.Context, filter state_stream.AccountStatusFilter) subscription.Subscription {
    77  	ret := _m.Called(ctx, filter)
    78  
    79  	var r0 subscription.Subscription
    80  	if rf, ok := ret.Get(0).(func(context.Context, state_stream.AccountStatusFilter) subscription.Subscription); ok {
    81  		r0 = rf(ctx, filter)
    82  	} else {
    83  		if ret.Get(0) != nil {
    84  			r0 = ret.Get(0).(subscription.Subscription)
    85  		}
    86  	}
    87  
    88  	return r0
    89  }
    90  
    91  // SubscribeAccountStatusesFromStartBlockID provides a mock function with given fields: ctx, startBlockID, filter
    92  func (_m *API) SubscribeAccountStatusesFromStartBlockID(ctx context.Context, startBlockID flow.Identifier, filter state_stream.AccountStatusFilter) subscription.Subscription {
    93  	ret := _m.Called(ctx, startBlockID, filter)
    94  
    95  	var r0 subscription.Subscription
    96  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, state_stream.AccountStatusFilter) subscription.Subscription); ok {
    97  		r0 = rf(ctx, startBlockID, filter)
    98  	} else {
    99  		if ret.Get(0) != nil {
   100  			r0 = ret.Get(0).(subscription.Subscription)
   101  		}
   102  	}
   103  
   104  	return r0
   105  }
   106  
   107  // SubscribeAccountStatusesFromStartHeight provides a mock function with given fields: ctx, startHeight, filter
   108  func (_m *API) SubscribeAccountStatusesFromStartHeight(ctx context.Context, startHeight uint64, filter state_stream.AccountStatusFilter) subscription.Subscription {
   109  	ret := _m.Called(ctx, startHeight, filter)
   110  
   111  	var r0 subscription.Subscription
   112  	if rf, ok := ret.Get(0).(func(context.Context, uint64, state_stream.AccountStatusFilter) subscription.Subscription); ok {
   113  		r0 = rf(ctx, startHeight, filter)
   114  	} else {
   115  		if ret.Get(0) != nil {
   116  			r0 = ret.Get(0).(subscription.Subscription)
   117  		}
   118  	}
   119  
   120  	return r0
   121  }
   122  
   123  // SubscribeEvents provides a mock function with given fields: ctx, startBlockID, startHeight, filter
   124  func (_m *API) SubscribeEvents(ctx context.Context, startBlockID flow.Identifier, startHeight uint64, filter state_stream.EventFilter) subscription.Subscription {
   125  	ret := _m.Called(ctx, startBlockID, startHeight, filter)
   126  
   127  	var r0 subscription.Subscription
   128  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, uint64, state_stream.EventFilter) subscription.Subscription); ok {
   129  		r0 = rf(ctx, startBlockID, startHeight, filter)
   130  	} else {
   131  		if ret.Get(0) != nil {
   132  			r0 = ret.Get(0).(subscription.Subscription)
   133  		}
   134  	}
   135  
   136  	return r0
   137  }
   138  
   139  // SubscribeEventsFromLatest provides a mock function with given fields: ctx, filter
   140  func (_m *API) SubscribeEventsFromLatest(ctx context.Context, filter state_stream.EventFilter) subscription.Subscription {
   141  	ret := _m.Called(ctx, filter)
   142  
   143  	var r0 subscription.Subscription
   144  	if rf, ok := ret.Get(0).(func(context.Context, state_stream.EventFilter) subscription.Subscription); ok {
   145  		r0 = rf(ctx, filter)
   146  	} else {
   147  		if ret.Get(0) != nil {
   148  			r0 = ret.Get(0).(subscription.Subscription)
   149  		}
   150  	}
   151  
   152  	return r0
   153  }
   154  
   155  // SubscribeEventsFromStartBlockID provides a mock function with given fields: ctx, startBlockID, filter
   156  func (_m *API) SubscribeEventsFromStartBlockID(ctx context.Context, startBlockID flow.Identifier, filter state_stream.EventFilter) subscription.Subscription {
   157  	ret := _m.Called(ctx, startBlockID, filter)
   158  
   159  	var r0 subscription.Subscription
   160  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, state_stream.EventFilter) subscription.Subscription); ok {
   161  		r0 = rf(ctx, startBlockID, filter)
   162  	} else {
   163  		if ret.Get(0) != nil {
   164  			r0 = ret.Get(0).(subscription.Subscription)
   165  		}
   166  	}
   167  
   168  	return r0
   169  }
   170  
   171  // SubscribeEventsFromStartHeight provides a mock function with given fields: ctx, startHeight, filter
   172  func (_m *API) SubscribeEventsFromStartHeight(ctx context.Context, startHeight uint64, filter state_stream.EventFilter) subscription.Subscription {
   173  	ret := _m.Called(ctx, startHeight, filter)
   174  
   175  	var r0 subscription.Subscription
   176  	if rf, ok := ret.Get(0).(func(context.Context, uint64, state_stream.EventFilter) subscription.Subscription); ok {
   177  		r0 = rf(ctx, startHeight, filter)
   178  	} else {
   179  		if ret.Get(0) != nil {
   180  			r0 = ret.Get(0).(subscription.Subscription)
   181  		}
   182  	}
   183  
   184  	return r0
   185  }
   186  
   187  // SubscribeExecutionData provides a mock function with given fields: ctx, startBlockID, startBlockHeight
   188  func (_m *API) SubscribeExecutionData(ctx context.Context, startBlockID flow.Identifier, startBlockHeight uint64) subscription.Subscription {
   189  	ret := _m.Called(ctx, startBlockID, startBlockHeight)
   190  
   191  	var r0 subscription.Subscription
   192  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, uint64) subscription.Subscription); ok {
   193  		r0 = rf(ctx, startBlockID, startBlockHeight)
   194  	} else {
   195  		if ret.Get(0) != nil {
   196  			r0 = ret.Get(0).(subscription.Subscription)
   197  		}
   198  	}
   199  
   200  	return r0
   201  }
   202  
   203  // SubscribeExecutionDataFromLatest provides a mock function with given fields: ctx
   204  func (_m *API) SubscribeExecutionDataFromLatest(ctx context.Context) subscription.Subscription {
   205  	ret := _m.Called(ctx)
   206  
   207  	var r0 subscription.Subscription
   208  	if rf, ok := ret.Get(0).(func(context.Context) subscription.Subscription); ok {
   209  		r0 = rf(ctx)
   210  	} else {
   211  		if ret.Get(0) != nil {
   212  			r0 = ret.Get(0).(subscription.Subscription)
   213  		}
   214  	}
   215  
   216  	return r0
   217  }
   218  
   219  // SubscribeExecutionDataFromStartBlockHeight provides a mock function with given fields: ctx, startBlockHeight
   220  func (_m *API) SubscribeExecutionDataFromStartBlockHeight(ctx context.Context, startBlockHeight uint64) subscription.Subscription {
   221  	ret := _m.Called(ctx, startBlockHeight)
   222  
   223  	var r0 subscription.Subscription
   224  	if rf, ok := ret.Get(0).(func(context.Context, uint64) subscription.Subscription); ok {
   225  		r0 = rf(ctx, startBlockHeight)
   226  	} else {
   227  		if ret.Get(0) != nil {
   228  			r0 = ret.Get(0).(subscription.Subscription)
   229  		}
   230  	}
   231  
   232  	return r0
   233  }
   234  
   235  // SubscribeExecutionDataFromStartBlockID provides a mock function with given fields: ctx, startBlockID
   236  func (_m *API) SubscribeExecutionDataFromStartBlockID(ctx context.Context, startBlockID flow.Identifier) subscription.Subscription {
   237  	ret := _m.Called(ctx, startBlockID)
   238  
   239  	var r0 subscription.Subscription
   240  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) subscription.Subscription); ok {
   241  		r0 = rf(ctx, startBlockID)
   242  	} else {
   243  		if ret.Get(0) != nil {
   244  			r0 = ret.Get(0).(subscription.Subscription)
   245  		}
   246  	}
   247  
   248  	return r0
   249  }
   250  
   251  type mockConstructorTestingTNewAPI interface {
   252  	mock.TestingT
   253  	Cleanup(func())
   254  }
   255  
   256  // 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.
   257  func NewAPI(t mockConstructorTestingTNewAPI) *API {
   258  	mock := &API{}
   259  	mock.Mock.Test(t)
   260  
   261  	t.Cleanup(func() { mock.AssertExpectations(t) })
   262  
   263  	return mock
   264  }