github.com/koko1123/flow-go-1@v0.29.6/storage/mock/blocks.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	flow "github.com/koko1123/flow-go-1/model/flow"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	transaction "github.com/koko1123/flow-go-1/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  	if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Block); ok {
    23  		r0 = rf(collID)
    24  	} else {
    25  		if ret.Get(0) != nil {
    26  			r0 = ret.Get(0).(*flow.Block)
    27  		}
    28  	}
    29  
    30  	var r1 error
    31  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    32  		r1 = rf(collID)
    33  	} else {
    34  		r1 = ret.Error(1)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  // ByHeight provides a mock function with given fields: height
    41  func (_m *Blocks) ByHeight(height uint64) (*flow.Block, error) {
    42  	ret := _m.Called(height)
    43  
    44  	var r0 *flow.Block
    45  	if rf, ok := ret.Get(0).(func(uint64) *flow.Block); ok {
    46  		r0 = rf(height)
    47  	} else {
    48  		if ret.Get(0) != nil {
    49  			r0 = ret.Get(0).(*flow.Block)
    50  		}
    51  	}
    52  
    53  	var r1 error
    54  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
    55  		r1 = rf(height)
    56  	} else {
    57  		r1 = ret.Error(1)
    58  	}
    59  
    60  	return r0, r1
    61  }
    62  
    63  // ByID provides a mock function with given fields: blockID
    64  func (_m *Blocks) ByID(blockID flow.Identifier) (*flow.Block, error) {
    65  	ret := _m.Called(blockID)
    66  
    67  	var r0 *flow.Block
    68  	if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Block); ok {
    69  		r0 = rf(blockID)
    70  	} else {
    71  		if ret.Get(0) != nil {
    72  			r0 = ret.Get(0).(*flow.Block)
    73  		}
    74  	}
    75  
    76  	var r1 error
    77  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    78  		r1 = rf(blockID)
    79  	} else {
    80  		r1 = ret.Error(1)
    81  	}
    82  
    83  	return r0, r1
    84  }
    85  
    86  // GetLastFullBlockHeight provides a mock function with given fields:
    87  func (_m *Blocks) GetLastFullBlockHeight() (uint64, error) {
    88  	ret := _m.Called()
    89  
    90  	var r0 uint64
    91  	if rf, ok := ret.Get(0).(func() uint64); ok {
    92  		r0 = rf()
    93  	} else {
    94  		r0 = ret.Get(0).(uint64)
    95  	}
    96  
    97  	var r1 error
    98  	if rf, ok := ret.Get(1).(func() error); ok {
    99  		r1 = rf()
   100  	} else {
   101  		r1 = ret.Error(1)
   102  	}
   103  
   104  	return r0, r1
   105  }
   106  
   107  // IndexBlockForCollections provides a mock function with given fields: blockID, collIDs
   108  func (_m *Blocks) IndexBlockForCollections(blockID flow.Identifier, collIDs []flow.Identifier) error {
   109  	ret := _m.Called(blockID, collIDs)
   110  
   111  	var r0 error
   112  	if rf, ok := ret.Get(0).(func(flow.Identifier, []flow.Identifier) error); ok {
   113  		r0 = rf(blockID, collIDs)
   114  	} else {
   115  		r0 = ret.Error(0)
   116  	}
   117  
   118  	return r0
   119  }
   120  
   121  // InsertLastFullBlockHeightIfNotExists provides a mock function with given fields: height
   122  func (_m *Blocks) InsertLastFullBlockHeightIfNotExists(height uint64) error {
   123  	ret := _m.Called(height)
   124  
   125  	var r0 error
   126  	if rf, ok := ret.Get(0).(func(uint64) error); ok {
   127  		r0 = rf(height)
   128  	} else {
   129  		r0 = ret.Error(0)
   130  	}
   131  
   132  	return r0
   133  }
   134  
   135  // Store provides a mock function with given fields: block
   136  func (_m *Blocks) Store(block *flow.Block) error {
   137  	ret := _m.Called(block)
   138  
   139  	var r0 error
   140  	if rf, ok := ret.Get(0).(func(*flow.Block) error); ok {
   141  		r0 = rf(block)
   142  	} else {
   143  		r0 = ret.Error(0)
   144  	}
   145  
   146  	return r0
   147  }
   148  
   149  // StoreTx provides a mock function with given fields: block
   150  func (_m *Blocks) StoreTx(block *flow.Block) func(*transaction.Tx) error {
   151  	ret := _m.Called(block)
   152  
   153  	var r0 func(*transaction.Tx) error
   154  	if rf, ok := ret.Get(0).(func(*flow.Block) func(*transaction.Tx) error); ok {
   155  		r0 = rf(block)
   156  	} else {
   157  		if ret.Get(0) != nil {
   158  			r0 = ret.Get(0).(func(*transaction.Tx) error)
   159  		}
   160  	}
   161  
   162  	return r0
   163  }
   164  
   165  // UpdateLastFullBlockHeight provides a mock function with given fields: height
   166  func (_m *Blocks) UpdateLastFullBlockHeight(height uint64) error {
   167  	ret := _m.Called(height)
   168  
   169  	var r0 error
   170  	if rf, ok := ret.Get(0).(func(uint64) error); ok {
   171  		r0 = rf(height)
   172  	} else {
   173  		r0 = ret.Error(0)
   174  	}
   175  
   176  	return r0
   177  }
   178  
   179  type mockConstructorTestingTNewBlocks interface {
   180  	mock.TestingT
   181  	Cleanup(func())
   182  }
   183  
   184  // 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.
   185  func NewBlocks(t mockConstructorTestingTNewBlocks) *Blocks {
   186  	mock := &Blocks{}
   187  	mock.Mock.Test(t)
   188  
   189  	t.Cleanup(func() { mock.AssertExpectations(t) })
   190  
   191  	return mock
   192  }