github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/mock/mutable_protocol_state.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  	protocol "github.com/onflow/flow-go/state/protocol"
    10  
    11  	transaction "github.com/onflow/flow-go/storage/badger/transaction"
    12  )
    13  
    14  // MutableProtocolState is an autogenerated mock type for the MutableProtocolState type
    15  type MutableProtocolState struct {
    16  	mock.Mock
    17  }
    18  
    19  // AtBlockID provides a mock function with given fields: blockID
    20  func (_m *MutableProtocolState) AtBlockID(blockID flow.Identifier) (protocol.DynamicProtocolState, error) {
    21  	ret := _m.Called(blockID)
    22  
    23  	var r0 protocol.DynamicProtocolState
    24  	var r1 error
    25  	if rf, ok := ret.Get(0).(func(flow.Identifier) (protocol.DynamicProtocolState, error)); ok {
    26  		return rf(blockID)
    27  	}
    28  	if rf, ok := ret.Get(0).(func(flow.Identifier) protocol.DynamicProtocolState); ok {
    29  		r0 = rf(blockID)
    30  	} else {
    31  		if ret.Get(0) != nil {
    32  			r0 = ret.Get(0).(protocol.DynamicProtocolState)
    33  		}
    34  	}
    35  
    36  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    37  		r1 = rf(blockID)
    38  	} else {
    39  		r1 = ret.Error(1)
    40  	}
    41  
    42  	return r0, r1
    43  }
    44  
    45  // EvolveState provides a mock function with given fields: parentBlockID, candidateView, candidateSeals
    46  func (_m *MutableProtocolState) EvolveState(parentBlockID flow.Identifier, candidateView uint64, candidateSeals []*flow.Seal) (flow.Identifier, *transaction.DeferredBlockPersist, error) {
    47  	ret := _m.Called(parentBlockID, candidateView, candidateSeals)
    48  
    49  	var r0 flow.Identifier
    50  	var r1 *transaction.DeferredBlockPersist
    51  	var r2 error
    52  	if rf, ok := ret.Get(0).(func(flow.Identifier, uint64, []*flow.Seal) (flow.Identifier, *transaction.DeferredBlockPersist, error)); ok {
    53  		return rf(parentBlockID, candidateView, candidateSeals)
    54  	}
    55  	if rf, ok := ret.Get(0).(func(flow.Identifier, uint64, []*flow.Seal) flow.Identifier); ok {
    56  		r0 = rf(parentBlockID, candidateView, candidateSeals)
    57  	} else {
    58  		if ret.Get(0) != nil {
    59  			r0 = ret.Get(0).(flow.Identifier)
    60  		}
    61  	}
    62  
    63  	if rf, ok := ret.Get(1).(func(flow.Identifier, uint64, []*flow.Seal) *transaction.DeferredBlockPersist); ok {
    64  		r1 = rf(parentBlockID, candidateView, candidateSeals)
    65  	} else {
    66  		if ret.Get(1) != nil {
    67  			r1 = ret.Get(1).(*transaction.DeferredBlockPersist)
    68  		}
    69  	}
    70  
    71  	if rf, ok := ret.Get(2).(func(flow.Identifier, uint64, []*flow.Seal) error); ok {
    72  		r2 = rf(parentBlockID, candidateView, candidateSeals)
    73  	} else {
    74  		r2 = ret.Error(2)
    75  	}
    76  
    77  	return r0, r1, r2
    78  }
    79  
    80  // GlobalParams provides a mock function with given fields:
    81  func (_m *MutableProtocolState) GlobalParams() protocol.GlobalParams {
    82  	ret := _m.Called()
    83  
    84  	var r0 protocol.GlobalParams
    85  	if rf, ok := ret.Get(0).(func() protocol.GlobalParams); ok {
    86  		r0 = rf()
    87  	} else {
    88  		if ret.Get(0) != nil {
    89  			r0 = ret.Get(0).(protocol.GlobalParams)
    90  		}
    91  	}
    92  
    93  	return r0
    94  }
    95  
    96  // KVStoreAtBlockID provides a mock function with given fields: blockID
    97  func (_m *MutableProtocolState) KVStoreAtBlockID(blockID flow.Identifier) (protocol.KVStoreReader, error) {
    98  	ret := _m.Called(blockID)
    99  
   100  	var r0 protocol.KVStoreReader
   101  	var r1 error
   102  	if rf, ok := ret.Get(0).(func(flow.Identifier) (protocol.KVStoreReader, error)); ok {
   103  		return rf(blockID)
   104  	}
   105  	if rf, ok := ret.Get(0).(func(flow.Identifier) protocol.KVStoreReader); ok {
   106  		r0 = rf(blockID)
   107  	} else {
   108  		if ret.Get(0) != nil {
   109  			r0 = ret.Get(0).(protocol.KVStoreReader)
   110  		}
   111  	}
   112  
   113  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
   114  		r1 = rf(blockID)
   115  	} else {
   116  		r1 = ret.Error(1)
   117  	}
   118  
   119  	return r0, r1
   120  }
   121  
   122  type mockConstructorTestingTNewMutableProtocolState interface {
   123  	mock.TestingT
   124  	Cleanup(func())
   125  }
   126  
   127  // NewMutableProtocolState creates a new instance of MutableProtocolState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   128  func NewMutableProtocolState(t mockConstructorTestingTNewMutableProtocolState) *MutableProtocolState {
   129  	mock := &MutableProtocolState{}
   130  	mock.Mock.Test(t)
   131  
   132  	t.Cleanup(func() { mock.AssertExpectations(t) })
   133  
   134  	return mock
   135  }