github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/state/mocks/block_store.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	mock "github.com/stretchr/testify/mock"
     7  
     8  	types "github.com/badrootd/celestia-core/types"
     9  )
    10  
    11  // BlockStore is an autogenerated mock type for the BlockStore type
    12  type BlockStore struct {
    13  	mock.Mock
    14  }
    15  
    16  // Base provides a mock function with given fields:
    17  func (_m *BlockStore) Base() int64 {
    18  	ret := _m.Called()
    19  
    20  	var r0 int64
    21  	if rf, ok := ret.Get(0).(func() int64); ok {
    22  		r0 = rf()
    23  	} else {
    24  		r0 = ret.Get(0).(int64)
    25  	}
    26  
    27  	return r0
    28  }
    29  
    30  // DeleteLatestBlock provides a mock function with given fields:
    31  func (_m *BlockStore) DeleteLatestBlock() error {
    32  	ret := _m.Called()
    33  
    34  	var r0 error
    35  	if rf, ok := ret.Get(0).(func() error); ok {
    36  		r0 = rf()
    37  	} else {
    38  		r0 = ret.Error(0)
    39  	}
    40  
    41  	return r0
    42  }
    43  
    44  // Height provides a mock function with given fields:
    45  func (_m *BlockStore) Height() int64 {
    46  	ret := _m.Called()
    47  
    48  	var r0 int64
    49  	if rf, ok := ret.Get(0).(func() int64); ok {
    50  		r0 = rf()
    51  	} else {
    52  		r0 = ret.Get(0).(int64)
    53  	}
    54  
    55  	return r0
    56  }
    57  
    58  // LoadBaseMeta provides a mock function with given fields:
    59  func (_m *BlockStore) LoadBaseMeta() *types.BlockMeta {
    60  	ret := _m.Called()
    61  
    62  	var r0 *types.BlockMeta
    63  	if rf, ok := ret.Get(0).(func() *types.BlockMeta); ok {
    64  		r0 = rf()
    65  	} else {
    66  		if ret.Get(0) != nil {
    67  			r0 = ret.Get(0).(*types.BlockMeta)
    68  		}
    69  	}
    70  
    71  	return r0
    72  }
    73  
    74  // LoadBlock provides a mock function with given fields: height
    75  func (_m *BlockStore) LoadBlock(height int64) *types.Block {
    76  	ret := _m.Called(height)
    77  
    78  	var r0 *types.Block
    79  	if rf, ok := ret.Get(0).(func(int64) *types.Block); ok {
    80  		r0 = rf(height)
    81  	} else {
    82  		if ret.Get(0) != nil {
    83  			r0 = ret.Get(0).(*types.Block)
    84  		}
    85  	}
    86  
    87  	return r0
    88  }
    89  
    90  // LoadBlockByHash provides a mock function with given fields: hash
    91  func (_m *BlockStore) LoadBlockByHash(hash []byte) *types.Block {
    92  	ret := _m.Called(hash)
    93  
    94  	var r0 *types.Block
    95  	if rf, ok := ret.Get(0).(func([]byte) *types.Block); ok {
    96  		r0 = rf(hash)
    97  	} else {
    98  		if ret.Get(0) != nil {
    99  			r0 = ret.Get(0).(*types.Block)
   100  		}
   101  	}
   102  
   103  	return r0
   104  }
   105  
   106  // LoadBlockCommit provides a mock function with given fields: height
   107  func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit {
   108  	ret := _m.Called(height)
   109  
   110  	var r0 *types.Commit
   111  	if rf, ok := ret.Get(0).(func(int64) *types.Commit); ok {
   112  		r0 = rf(height)
   113  	} else {
   114  		if ret.Get(0) != nil {
   115  			r0 = ret.Get(0).(*types.Commit)
   116  		}
   117  	}
   118  
   119  	return r0
   120  }
   121  
   122  // LoadBlockMeta provides a mock function with given fields: height
   123  func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta {
   124  	ret := _m.Called(height)
   125  
   126  	var r0 *types.BlockMeta
   127  	if rf, ok := ret.Get(0).(func(int64) *types.BlockMeta); ok {
   128  		r0 = rf(height)
   129  	} else {
   130  		if ret.Get(0) != nil {
   131  			r0 = ret.Get(0).(*types.BlockMeta)
   132  		}
   133  	}
   134  
   135  	return r0
   136  }
   137  
   138  // LoadBlockMetaByHash provides a mock function with given fields: hash
   139  func (_m *BlockStore) LoadBlockMetaByHash(hash []byte) *types.BlockMeta {
   140  	ret := _m.Called(hash)
   141  
   142  	var r0 *types.BlockMeta
   143  	if rf, ok := ret.Get(0).(func([]byte) *types.BlockMeta); ok {
   144  		r0 = rf(hash)
   145  	} else {
   146  		if ret.Get(0) != nil {
   147  			r0 = ret.Get(0).(*types.BlockMeta)
   148  		}
   149  	}
   150  
   151  	return r0
   152  }
   153  
   154  // LoadBlockPart provides a mock function with given fields: height, index
   155  func (_m *BlockStore) LoadBlockPart(height int64, index int) *types.Part {
   156  	ret := _m.Called(height, index)
   157  
   158  	var r0 *types.Part
   159  	if rf, ok := ret.Get(0).(func(int64, int) *types.Part); ok {
   160  		r0 = rf(height, index)
   161  	} else {
   162  		if ret.Get(0) != nil {
   163  			r0 = ret.Get(0).(*types.Part)
   164  		}
   165  	}
   166  
   167  	return r0
   168  }
   169  
   170  // LoadSeenCommit provides a mock function with given fields: height
   171  func (_m *BlockStore) LoadSeenCommit(height int64) *types.Commit {
   172  	ret := _m.Called(height)
   173  
   174  	var r0 *types.Commit
   175  	if rf, ok := ret.Get(0).(func(int64) *types.Commit); ok {
   176  		r0 = rf(height)
   177  	} else {
   178  		if ret.Get(0) != nil {
   179  			r0 = ret.Get(0).(*types.Commit)
   180  		}
   181  	}
   182  
   183  	return r0
   184  }
   185  
   186  // PruneBlocks provides a mock function with given fields: height
   187  func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) {
   188  	ret := _m.Called(height)
   189  
   190  	var r0 uint64
   191  	if rf, ok := ret.Get(0).(func(int64) uint64); ok {
   192  		r0 = rf(height)
   193  	} else {
   194  		r0 = ret.Get(0).(uint64)
   195  	}
   196  
   197  	var r1 error
   198  	if rf, ok := ret.Get(1).(func(int64) error); ok {
   199  		r1 = rf(height)
   200  	} else {
   201  		r1 = ret.Error(1)
   202  	}
   203  
   204  	return r0, r1
   205  }
   206  
   207  // SaveBlock provides a mock function with given fields: block, blockParts, seenCommit
   208  func (_m *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) {
   209  	_m.Called(block, blockParts, seenCommit)
   210  }
   211  
   212  // Size provides a mock function with given fields:
   213  func (_m *BlockStore) Size() int64 {
   214  	ret := _m.Called()
   215  
   216  	var r0 int64
   217  	if rf, ok := ret.Get(0).(func() int64); ok {
   218  		r0 = rf()
   219  	} else {
   220  		r0 = ret.Get(0).(int64)
   221  	}
   222  
   223  	return r0
   224  }
   225  
   226  type mockConstructorTestingTNewBlockStore interface {
   227  	mock.TestingT
   228  	Cleanup(func())
   229  }
   230  
   231  // NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   232  func NewBlockStore(t mockConstructorTestingTNewBlockStore) *BlockStore {
   233  	mock := &BlockStore{}
   234  	mock.Mock.Test(t)
   235  
   236  	t.Cleanup(func() { mock.AssertExpectations(t) })
   237  
   238  	return mock
   239  }