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