github.com/onflow/flow-go@v0.33.17/engine/execution/state/mock/execution_state.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  	execution "github.com/onflow/flow-go/engine/execution"
     9  	flow "github.com/onflow/flow-go/model/flow"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	snapshot "github.com/onflow/flow-go/fvm/storage/snapshot"
    14  )
    15  
    16  // ExecutionState is an autogenerated mock type for the ExecutionState type
    17  type ExecutionState struct {
    18  	mock.Mock
    19  }
    20  
    21  // ChunkDataPackByChunkID provides a mock function with given fields: _a0
    22  func (_m *ExecutionState) ChunkDataPackByChunkID(_a0 flow.Identifier) (*flow.ChunkDataPack, error) {
    23  	ret := _m.Called(_a0)
    24  
    25  	var r0 *flow.ChunkDataPack
    26  	var r1 error
    27  	if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.ChunkDataPack, error)); ok {
    28  		return rf(_a0)
    29  	}
    30  	if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.ChunkDataPack); ok {
    31  		r0 = rf(_a0)
    32  	} else {
    33  		if ret.Get(0) != nil {
    34  			r0 = ret.Get(0).(*flow.ChunkDataPack)
    35  		}
    36  	}
    37  
    38  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    39  		r1 = rf(_a0)
    40  	} else {
    41  		r1 = ret.Error(1)
    42  	}
    43  
    44  	return r0, r1
    45  }
    46  
    47  // CreateStorageSnapshot provides a mock function with given fields: blockID
    48  func (_m *ExecutionState) CreateStorageSnapshot(blockID flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error) {
    49  	ret := _m.Called(blockID)
    50  
    51  	var r0 snapshot.StorageSnapshot
    52  	var r1 *flow.Header
    53  	var r2 error
    54  	if rf, ok := ret.Get(0).(func(flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error)); ok {
    55  		return rf(blockID)
    56  	}
    57  	if rf, ok := ret.Get(0).(func(flow.Identifier) snapshot.StorageSnapshot); ok {
    58  		r0 = rf(blockID)
    59  	} else {
    60  		if ret.Get(0) != nil {
    61  			r0 = ret.Get(0).(snapshot.StorageSnapshot)
    62  		}
    63  	}
    64  
    65  	if rf, ok := ret.Get(1).(func(flow.Identifier) *flow.Header); ok {
    66  		r1 = rf(blockID)
    67  	} else {
    68  		if ret.Get(1) != nil {
    69  			r1 = ret.Get(1).(*flow.Header)
    70  		}
    71  	}
    72  
    73  	if rf, ok := ret.Get(2).(func(flow.Identifier) error); ok {
    74  		r2 = rf(blockID)
    75  	} else {
    76  		r2 = ret.Error(2)
    77  	}
    78  
    79  	return r0, r1, r2
    80  }
    81  
    82  // GetExecutionResultID provides a mock function with given fields: _a0, _a1
    83  func (_m *ExecutionState) GetExecutionResultID(_a0 context.Context, _a1 flow.Identifier) (flow.Identifier, error) {
    84  	ret := _m.Called(_a0, _a1)
    85  
    86  	var r0 flow.Identifier
    87  	var r1 error
    88  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (flow.Identifier, error)); ok {
    89  		return rf(_a0, _a1)
    90  	}
    91  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) flow.Identifier); ok {
    92  		r0 = rf(_a0, _a1)
    93  	} else {
    94  		if ret.Get(0) != nil {
    95  			r0 = ret.Get(0).(flow.Identifier)
    96  		}
    97  	}
    98  
    99  	if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok {
   100  		r1 = rf(_a0, _a1)
   101  	} else {
   102  		r1 = ret.Error(1)
   103  	}
   104  
   105  	return r0, r1
   106  }
   107  
   108  // GetHighestExecutedBlockID provides a mock function with given fields: _a0
   109  func (_m *ExecutionState) GetHighestExecutedBlockID(_a0 context.Context) (uint64, flow.Identifier, error) {
   110  	ret := _m.Called(_a0)
   111  
   112  	var r0 uint64
   113  	var r1 flow.Identifier
   114  	var r2 error
   115  	if rf, ok := ret.Get(0).(func(context.Context) (uint64, flow.Identifier, error)); ok {
   116  		return rf(_a0)
   117  	}
   118  	if rf, ok := ret.Get(0).(func(context.Context) uint64); ok {
   119  		r0 = rf(_a0)
   120  	} else {
   121  		r0 = ret.Get(0).(uint64)
   122  	}
   123  
   124  	if rf, ok := ret.Get(1).(func(context.Context) flow.Identifier); ok {
   125  		r1 = rf(_a0)
   126  	} else {
   127  		if ret.Get(1) != nil {
   128  			r1 = ret.Get(1).(flow.Identifier)
   129  		}
   130  	}
   131  
   132  	if rf, ok := ret.Get(2).(func(context.Context) error); ok {
   133  		r2 = rf(_a0)
   134  	} else {
   135  		r2 = ret.Error(2)
   136  	}
   137  
   138  	return r0, r1, r2
   139  }
   140  
   141  // GetHighestFinalizedExecuted provides a mock function with given fields:
   142  func (_m *ExecutionState) GetHighestFinalizedExecuted() uint64 {
   143  	ret := _m.Called()
   144  
   145  	var r0 uint64
   146  	if rf, ok := ret.Get(0).(func() uint64); ok {
   147  		r0 = rf()
   148  	} else {
   149  		r0 = ret.Get(0).(uint64)
   150  	}
   151  
   152  	return r0
   153  }
   154  
   155  // IsBlockExecuted provides a mock function with given fields: height, blockID
   156  func (_m *ExecutionState) IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error) {
   157  	ret := _m.Called(height, blockID)
   158  
   159  	var r0 bool
   160  	var r1 error
   161  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (bool, error)); ok {
   162  		return rf(height, blockID)
   163  	}
   164  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) bool); ok {
   165  		r0 = rf(height, blockID)
   166  	} else {
   167  		r0 = ret.Get(0).(bool)
   168  	}
   169  
   170  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok {
   171  		r1 = rf(height, blockID)
   172  	} else {
   173  		r1 = ret.Error(1)
   174  	}
   175  
   176  	return r0, r1
   177  }
   178  
   179  // NewStorageSnapshot provides a mock function with given fields: commit, blockID, height
   180  func (_m *ExecutionState) NewStorageSnapshot(commit flow.StateCommitment, blockID flow.Identifier, height uint64) snapshot.StorageSnapshot {
   181  	ret := _m.Called(commit, blockID, height)
   182  
   183  	var r0 snapshot.StorageSnapshot
   184  	if rf, ok := ret.Get(0).(func(flow.StateCommitment, flow.Identifier, uint64) snapshot.StorageSnapshot); ok {
   185  		r0 = rf(commit, blockID, height)
   186  	} else {
   187  		if ret.Get(0) != nil {
   188  			r0 = ret.Get(0).(snapshot.StorageSnapshot)
   189  		}
   190  	}
   191  
   192  	return r0
   193  }
   194  
   195  // SaveExecutionResults provides a mock function with given fields: ctx, result
   196  func (_m *ExecutionState) SaveExecutionResults(ctx context.Context, result *execution.ComputationResult) error {
   197  	ret := _m.Called(ctx, result)
   198  
   199  	var r0 error
   200  	if rf, ok := ret.Get(0).(func(context.Context, *execution.ComputationResult) error); ok {
   201  		r0 = rf(ctx, result)
   202  	} else {
   203  		r0 = ret.Error(0)
   204  	}
   205  
   206  	return r0
   207  }
   208  
   209  // StateCommitmentByBlockID provides a mock function with given fields: _a0
   210  func (_m *ExecutionState) StateCommitmentByBlockID(_a0 flow.Identifier) (flow.StateCommitment, error) {
   211  	ret := _m.Called(_a0)
   212  
   213  	var r0 flow.StateCommitment
   214  	var r1 error
   215  	if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.StateCommitment, error)); ok {
   216  		return rf(_a0)
   217  	}
   218  	if rf, ok := ret.Get(0).(func(flow.Identifier) flow.StateCommitment); ok {
   219  		r0 = rf(_a0)
   220  	} else {
   221  		if ret.Get(0) != nil {
   222  			r0 = ret.Get(0).(flow.StateCommitment)
   223  		}
   224  	}
   225  
   226  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
   227  		r1 = rf(_a0)
   228  	} else {
   229  		r1 = ret.Error(1)
   230  	}
   231  
   232  	return r0, r1
   233  }
   234  
   235  // UpdateHighestExecutedBlockIfHigher provides a mock function with given fields: _a0, _a1
   236  func (_m *ExecutionState) UpdateHighestExecutedBlockIfHigher(_a0 context.Context, _a1 *flow.Header) error {
   237  	ret := _m.Called(_a0, _a1)
   238  
   239  	var r0 error
   240  	if rf, ok := ret.Get(0).(func(context.Context, *flow.Header) error); ok {
   241  		r0 = rf(_a0, _a1)
   242  	} else {
   243  		r0 = ret.Error(0)
   244  	}
   245  
   246  	return r0
   247  }
   248  
   249  type mockConstructorTestingTNewExecutionState interface {
   250  	mock.TestingT
   251  	Cleanup(func())
   252  }
   253  
   254  // NewExecutionState creates a new instance of ExecutionState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   255  func NewExecutionState(t mockConstructorTestingTNewExecutionState) *ExecutionState {
   256  	mock := &ExecutionState{}
   257  	mock.Mock.Test(t)
   258  
   259  	t.Cleanup(func() { mock.AssertExpectations(t) })
   260  
   261  	return mock
   262  }