github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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, error) {
   143  	ret := _m.Called()
   144  
   145  	var r0 uint64
   146  	var r1 error
   147  	if rf, ok := ret.Get(0).(func() (uint64, error)); ok {
   148  		return rf()
   149  	}
   150  	if rf, ok := ret.Get(0).(func() uint64); ok {
   151  		r0 = rf()
   152  	} else {
   153  		r0 = ret.Get(0).(uint64)
   154  	}
   155  
   156  	if rf, ok := ret.Get(1).(func() error); ok {
   157  		r1 = rf()
   158  	} else {
   159  		r1 = ret.Error(1)
   160  	}
   161  
   162  	return r0, r1
   163  }
   164  
   165  // IsBlockExecuted provides a mock function with given fields: height, blockID
   166  func (_m *ExecutionState) IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error) {
   167  	ret := _m.Called(height, blockID)
   168  
   169  	var r0 bool
   170  	var r1 error
   171  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (bool, error)); ok {
   172  		return rf(height, blockID)
   173  	}
   174  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) bool); ok {
   175  		r0 = rf(height, blockID)
   176  	} else {
   177  		r0 = ret.Get(0).(bool)
   178  	}
   179  
   180  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok {
   181  		r1 = rf(height, blockID)
   182  	} else {
   183  		r1 = ret.Error(1)
   184  	}
   185  
   186  	return r0, r1
   187  }
   188  
   189  // NewStorageSnapshot provides a mock function with given fields: commit, blockID, height
   190  func (_m *ExecutionState) NewStorageSnapshot(commit flow.StateCommitment, blockID flow.Identifier, height uint64) snapshot.StorageSnapshot {
   191  	ret := _m.Called(commit, blockID, height)
   192  
   193  	var r0 snapshot.StorageSnapshot
   194  	if rf, ok := ret.Get(0).(func(flow.StateCommitment, flow.Identifier, uint64) snapshot.StorageSnapshot); ok {
   195  		r0 = rf(commit, blockID, height)
   196  	} else {
   197  		if ret.Get(0) != nil {
   198  			r0 = ret.Get(0).(snapshot.StorageSnapshot)
   199  		}
   200  	}
   201  
   202  	return r0
   203  }
   204  
   205  // SaveExecutionResults provides a mock function with given fields: ctx, result
   206  func (_m *ExecutionState) SaveExecutionResults(ctx context.Context, result *execution.ComputationResult) error {
   207  	ret := _m.Called(ctx, result)
   208  
   209  	var r0 error
   210  	if rf, ok := ret.Get(0).(func(context.Context, *execution.ComputationResult) error); ok {
   211  		r0 = rf(ctx, result)
   212  	} else {
   213  		r0 = ret.Error(0)
   214  	}
   215  
   216  	return r0
   217  }
   218  
   219  // StateCommitmentByBlockID provides a mock function with given fields: _a0
   220  func (_m *ExecutionState) StateCommitmentByBlockID(_a0 flow.Identifier) (flow.StateCommitment, error) {
   221  	ret := _m.Called(_a0)
   222  
   223  	var r0 flow.StateCommitment
   224  	var r1 error
   225  	if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.StateCommitment, error)); ok {
   226  		return rf(_a0)
   227  	}
   228  	if rf, ok := ret.Get(0).(func(flow.Identifier) flow.StateCommitment); ok {
   229  		r0 = rf(_a0)
   230  	} else {
   231  		if ret.Get(0) != nil {
   232  			r0 = ret.Get(0).(flow.StateCommitment)
   233  		}
   234  	}
   235  
   236  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
   237  		r1 = rf(_a0)
   238  	} else {
   239  		r1 = ret.Error(1)
   240  	}
   241  
   242  	return r0, r1
   243  }
   244  
   245  // UpdateHighestExecutedBlockIfHigher provides a mock function with given fields: _a0, _a1
   246  func (_m *ExecutionState) UpdateHighestExecutedBlockIfHigher(_a0 context.Context, _a1 *flow.Header) error {
   247  	ret := _m.Called(_a0, _a1)
   248  
   249  	var r0 error
   250  	if rf, ok := ret.Get(0).(func(context.Context, *flow.Header) error); ok {
   251  		r0 = rf(_a0, _a1)
   252  	} else {
   253  		r0 = ret.Error(0)
   254  	}
   255  
   256  	return r0
   257  }
   258  
   259  type mockConstructorTestingTNewExecutionState interface {
   260  	mock.TestingT
   261  	Cleanup(func())
   262  }
   263  
   264  // 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.
   265  func NewExecutionState(t mockConstructorTestingTNewExecutionState) *ExecutionState {
   266  	mock := &ExecutionState{}
   267  	mock.Mock.Test(t)
   268  
   269  	t.Cleanup(func() { mock.AssertExpectations(t) })
   270  
   271  	return mock
   272  }