github.com/onflow/flow-go@v0.33.17/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 // GetLastFullBlockHeight provides a mock function with given fields: 96 func (_m *Blocks) GetLastFullBlockHeight() (uint64, error) { 97 ret := _m.Called() 98 99 var r0 uint64 100 var r1 error 101 if rf, ok := ret.Get(0).(func() (uint64, error)); ok { 102 return rf() 103 } 104 if rf, ok := ret.Get(0).(func() uint64); ok { 105 r0 = rf() 106 } else { 107 r0 = ret.Get(0).(uint64) 108 } 109 110 if rf, ok := ret.Get(1).(func() error); ok { 111 r1 = rf() 112 } else { 113 r1 = ret.Error(1) 114 } 115 116 return r0, r1 117 } 118 119 // IndexBlockForCollections provides a mock function with given fields: blockID, collIDs 120 func (_m *Blocks) IndexBlockForCollections(blockID flow.Identifier, collIDs []flow.Identifier) error { 121 ret := _m.Called(blockID, collIDs) 122 123 var r0 error 124 if rf, ok := ret.Get(0).(func(flow.Identifier, []flow.Identifier) error); ok { 125 r0 = rf(blockID, collIDs) 126 } else { 127 r0 = ret.Error(0) 128 } 129 130 return r0 131 } 132 133 // InsertLastFullBlockHeightIfNotExists provides a mock function with given fields: height 134 func (_m *Blocks) InsertLastFullBlockHeightIfNotExists(height uint64) error { 135 ret := _m.Called(height) 136 137 var r0 error 138 if rf, ok := ret.Get(0).(func(uint64) error); ok { 139 r0 = rf(height) 140 } else { 141 r0 = ret.Error(0) 142 } 143 144 return r0 145 } 146 147 // Store provides a mock function with given fields: block 148 func (_m *Blocks) Store(block *flow.Block) error { 149 ret := _m.Called(block) 150 151 var r0 error 152 if rf, ok := ret.Get(0).(func(*flow.Block) error); ok { 153 r0 = rf(block) 154 } else { 155 r0 = ret.Error(0) 156 } 157 158 return r0 159 } 160 161 // StoreTx provides a mock function with given fields: block 162 func (_m *Blocks) StoreTx(block *flow.Block) func(*transaction.Tx) error { 163 ret := _m.Called(block) 164 165 var r0 func(*transaction.Tx) error 166 if rf, ok := ret.Get(0).(func(*flow.Block) func(*transaction.Tx) error); ok { 167 r0 = rf(block) 168 } else { 169 if ret.Get(0) != nil { 170 r0 = ret.Get(0).(func(*transaction.Tx) error) 171 } 172 } 173 174 return r0 175 } 176 177 // UpdateLastFullBlockHeight provides a mock function with given fields: height 178 func (_m *Blocks) UpdateLastFullBlockHeight(height uint64) error { 179 ret := _m.Called(height) 180 181 var r0 error 182 if rf, ok := ret.Get(0).(func(uint64) error); ok { 183 r0 = rf(height) 184 } else { 185 r0 = ret.Error(0) 186 } 187 188 return r0 189 } 190 191 type mockConstructorTestingTNewBlocks interface { 192 mock.TestingT 193 Cleanup(func()) 194 } 195 196 // 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. 197 func NewBlocks(t mockConstructorTestingTNewBlocks) *Blocks { 198 mock := &Blocks{} 199 mock.Mock.Test(t) 200 201 t.Cleanup(func() { mock.AssertExpectations(t) }) 202 203 return mock 204 }