github.com/onflow/flow-go@v0.33.17/engine/execution/mock/in_memory_register_store.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  
    10  // InMemoryRegisterStore is an autogenerated mock type for the InMemoryRegisterStore type
    11  type InMemoryRegisterStore struct {
    12  	mock.Mock
    13  }
    14  
    15  // GetRegister provides a mock function with given fields: height, blockID, register
    16  func (_m *InMemoryRegisterStore) GetRegister(height uint64, blockID flow.Identifier, register flow.RegisterID) ([]byte, error) {
    17  	ret := _m.Called(height, blockID, register)
    18  
    19  	var r0 []byte
    20  	var r1 error
    21  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier, flow.RegisterID) ([]byte, error)); ok {
    22  		return rf(height, blockID, register)
    23  	}
    24  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier, flow.RegisterID) []byte); ok {
    25  		r0 = rf(height, blockID, register)
    26  	} else {
    27  		if ret.Get(0) != nil {
    28  			r0 = ret.Get(0).([]byte)
    29  		}
    30  	}
    31  
    32  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier, flow.RegisterID) error); ok {
    33  		r1 = rf(height, blockID, register)
    34  	} else {
    35  		r1 = ret.Error(1)
    36  	}
    37  
    38  	return r0, r1
    39  }
    40  
    41  // GetUpdatedRegisters provides a mock function with given fields: height, blockID
    42  func (_m *InMemoryRegisterStore) GetUpdatedRegisters(height uint64, blockID flow.Identifier) (flow.RegisterEntries, error) {
    43  	ret := _m.Called(height, blockID)
    44  
    45  	var r0 flow.RegisterEntries
    46  	var r1 error
    47  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (flow.RegisterEntries, error)); ok {
    48  		return rf(height, blockID)
    49  	}
    50  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) flow.RegisterEntries); ok {
    51  		r0 = rf(height, blockID)
    52  	} else {
    53  		if ret.Get(0) != nil {
    54  			r0 = ret.Get(0).(flow.RegisterEntries)
    55  		}
    56  	}
    57  
    58  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok {
    59  		r1 = rf(height, blockID)
    60  	} else {
    61  		r1 = ret.Error(1)
    62  	}
    63  
    64  	return r0, r1
    65  }
    66  
    67  // IsBlockExecuted provides a mock function with given fields: height, blockID
    68  func (_m *InMemoryRegisterStore) IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error) {
    69  	ret := _m.Called(height, blockID)
    70  
    71  	var r0 bool
    72  	var r1 error
    73  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (bool, error)); ok {
    74  		return rf(height, blockID)
    75  	}
    76  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) bool); ok {
    77  		r0 = rf(height, blockID)
    78  	} else {
    79  		r0 = ret.Get(0).(bool)
    80  	}
    81  
    82  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok {
    83  		r1 = rf(height, blockID)
    84  	} else {
    85  		r1 = ret.Error(1)
    86  	}
    87  
    88  	return r0, r1
    89  }
    90  
    91  // Prune provides a mock function with given fields: finalizedHeight, finalizedBlockID
    92  func (_m *InMemoryRegisterStore) Prune(finalizedHeight uint64, finalizedBlockID flow.Identifier) error {
    93  	ret := _m.Called(finalizedHeight, finalizedBlockID)
    94  
    95  	var r0 error
    96  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) error); ok {
    97  		r0 = rf(finalizedHeight, finalizedBlockID)
    98  	} else {
    99  		r0 = ret.Error(0)
   100  	}
   101  
   102  	return r0
   103  }
   104  
   105  // PrunedHeight provides a mock function with given fields:
   106  func (_m *InMemoryRegisterStore) PrunedHeight() uint64 {
   107  	ret := _m.Called()
   108  
   109  	var r0 uint64
   110  	if rf, ok := ret.Get(0).(func() uint64); ok {
   111  		r0 = rf()
   112  	} else {
   113  		r0 = ret.Get(0).(uint64)
   114  	}
   115  
   116  	return r0
   117  }
   118  
   119  // SaveRegisters provides a mock function with given fields: height, blockID, parentID, registers
   120  func (_m *InMemoryRegisterStore) SaveRegisters(height uint64, blockID flow.Identifier, parentID flow.Identifier, registers flow.RegisterEntries) error {
   121  	ret := _m.Called(height, blockID, parentID, registers)
   122  
   123  	var r0 error
   124  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier, flow.Identifier, flow.RegisterEntries) error); ok {
   125  		r0 = rf(height, blockID, parentID, registers)
   126  	} else {
   127  		r0 = ret.Error(0)
   128  	}
   129  
   130  	return r0
   131  }
   132  
   133  type mockConstructorTestingTNewInMemoryRegisterStore interface {
   134  	mock.TestingT
   135  	Cleanup(func())
   136  }
   137  
   138  // NewInMemoryRegisterStore creates a new instance of InMemoryRegisterStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   139  func NewInMemoryRegisterStore(t mockConstructorTestingTNewInMemoryRegisterStore) *InMemoryRegisterStore {
   140  	mock := &InMemoryRegisterStore{}
   141  	mock.Mock.Test(t)
   142  
   143  	t.Cleanup(func() { mock.AssertExpectations(t) })
   144  
   145  	return mock
   146  }