github.com/klaytn/klaytn@v1.12.1/consensus/mocks/engine_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: github.com/klaytn/klaytn/consensus (interfaces: Engine) 3 4 // Package mocks is a generated GoMock package. 5 package mocks 6 7 import ( 8 big "math/big" 9 reflect "reflect" 10 11 gomock "github.com/golang/mock/gomock" 12 state "github.com/klaytn/klaytn/blockchain/state" 13 types "github.com/klaytn/klaytn/blockchain/types" 14 common "github.com/klaytn/klaytn/common" 15 consensus "github.com/klaytn/klaytn/consensus" 16 rpc "github.com/klaytn/klaytn/networks/rpc" 17 ) 18 19 // MockEngine is a mock of Engine interface. 20 type MockEngine struct { 21 ctrl *gomock.Controller 22 recorder *MockEngineMockRecorder 23 } 24 25 // MockEngineMockRecorder is the mock recorder for MockEngine. 26 type MockEngineMockRecorder struct { 27 mock *MockEngine 28 } 29 30 // NewMockEngine creates a new mock instance. 31 func NewMockEngine(ctrl *gomock.Controller) *MockEngine { 32 mock := &MockEngine{ctrl: ctrl} 33 mock.recorder = &MockEngineMockRecorder{mock} 34 return mock 35 } 36 37 // EXPECT returns an object that allows the caller to indicate expected use. 38 func (m *MockEngine) EXPECT() *MockEngineMockRecorder { 39 return m.recorder 40 } 41 42 // APIs mocks base method. 43 func (m *MockEngine) APIs(arg0 consensus.ChainReader) []rpc.API { 44 m.ctrl.T.Helper() 45 ret := m.ctrl.Call(m, "APIs", arg0) 46 ret0, _ := ret[0].([]rpc.API) 47 return ret0 48 } 49 50 // APIs indicates an expected call of APIs. 51 func (mr *MockEngineMockRecorder) APIs(arg0 interface{}) *gomock.Call { 52 mr.mock.ctrl.T.Helper() 53 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIs", reflect.TypeOf((*MockEngine)(nil).APIs), arg0) 54 } 55 56 // Author mocks base method. 57 func (m *MockEngine) Author(arg0 *types.Header) (common.Address, error) { 58 m.ctrl.T.Helper() 59 ret := m.ctrl.Call(m, "Author", arg0) 60 ret0, _ := ret[0].(common.Address) 61 ret1, _ := ret[1].(error) 62 return ret0, ret1 63 } 64 65 // Author indicates an expected call of Author. 66 func (mr *MockEngineMockRecorder) Author(arg0 interface{}) *gomock.Call { 67 mr.mock.ctrl.T.Helper() 68 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Author", reflect.TypeOf((*MockEngine)(nil).Author), arg0) 69 } 70 71 // CalcBlockScore mocks base method. 72 func (m *MockEngine) CalcBlockScore(arg0 consensus.ChainReader, arg1 uint64, arg2 *types.Header) *big.Int { 73 m.ctrl.T.Helper() 74 ret := m.ctrl.Call(m, "CalcBlockScore", arg0, arg1, arg2) 75 ret0, _ := ret[0].(*big.Int) 76 return ret0 77 } 78 79 // CalcBlockScore indicates an expected call of CalcBlockScore. 80 func (mr *MockEngineMockRecorder) CalcBlockScore(arg0, arg1, arg2 interface{}) *gomock.Call { 81 mr.mock.ctrl.T.Helper() 82 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcBlockScore", reflect.TypeOf((*MockEngine)(nil).CalcBlockScore), arg0, arg1, arg2) 83 } 84 85 // CanVerifyHeadersConcurrently mocks base method. 86 func (m *MockEngine) CanVerifyHeadersConcurrently() bool { 87 m.ctrl.T.Helper() 88 ret := m.ctrl.Call(m, "CanVerifyHeadersConcurrently") 89 ret0, _ := ret[0].(bool) 90 return ret0 91 } 92 93 // CanVerifyHeadersConcurrently indicates an expected call of CanVerifyHeadersConcurrently. 94 func (mr *MockEngineMockRecorder) CanVerifyHeadersConcurrently() *gomock.Call { 95 mr.mock.ctrl.T.Helper() 96 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanVerifyHeadersConcurrently", reflect.TypeOf((*MockEngine)(nil).CanVerifyHeadersConcurrently)) 97 } 98 99 // CreateSnapshot mocks base method. 100 func (m *MockEngine) CreateSnapshot(arg0 consensus.ChainReader, arg1 uint64, arg2 common.Hash, arg3 []*types.Header) error { 101 m.ctrl.T.Helper() 102 ret := m.ctrl.Call(m, "CreateSnapshot", arg0, arg1, arg2, arg3) 103 ret0, _ := ret[0].(error) 104 return ret0 105 } 106 107 // CreateSnapshot indicates an expected call of CreateSnapshot. 108 func (mr *MockEngineMockRecorder) CreateSnapshot(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { 109 mr.mock.ctrl.T.Helper() 110 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSnapshot", reflect.TypeOf((*MockEngine)(nil).CreateSnapshot), arg0, arg1, arg2, arg3) 111 } 112 113 // Finalize mocks base method. 114 func (m *MockEngine) Finalize(arg0 consensus.ChainReader, arg1 *types.Header, arg2 *state.StateDB, arg3 []*types.Transaction, arg4 []*types.Receipt) (*types.Block, error) { 115 m.ctrl.T.Helper() 116 ret := m.ctrl.Call(m, "Finalize", arg0, arg1, arg2, arg3, arg4) 117 ret0, _ := ret[0].(*types.Block) 118 ret1, _ := ret[1].(error) 119 return ret0, ret1 120 } 121 122 // Finalize indicates an expected call of Finalize. 123 func (mr *MockEngineMockRecorder) Finalize(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { 124 mr.mock.ctrl.T.Helper() 125 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finalize", reflect.TypeOf((*MockEngine)(nil).Finalize), arg0, arg1, arg2, arg3, arg4) 126 } 127 128 // GetConsensusInfo mocks base method. 129 func (m *MockEngine) GetConsensusInfo(arg0 *types.Block) (consensus.ConsensusInfo, error) { 130 m.ctrl.T.Helper() 131 ret := m.ctrl.Call(m, "GetConsensusInfo", arg0) 132 ret0, _ := ret[0].(consensus.ConsensusInfo) 133 ret1, _ := ret[1].(error) 134 return ret0, ret1 135 } 136 137 // GetConsensusInfo indicates an expected call of GetConsensusInfo. 138 func (mr *MockEngineMockRecorder) GetConsensusInfo(arg0 interface{}) *gomock.Call { 139 mr.mock.ctrl.T.Helper() 140 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusInfo", reflect.TypeOf((*MockEngine)(nil).GetConsensusInfo), arg0) 141 } 142 143 // InitSnapshot mocks base method. 144 func (m *MockEngine) InitSnapshot() { 145 m.ctrl.T.Helper() 146 m.ctrl.Call(m, "InitSnapshot") 147 } 148 149 // InitSnapshot indicates an expected call of InitSnapshot. 150 func (mr *MockEngineMockRecorder) InitSnapshot() *gomock.Call { 151 mr.mock.ctrl.T.Helper() 152 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitSnapshot", reflect.TypeOf((*MockEngine)(nil).InitSnapshot)) 153 } 154 155 // Prepare mocks base method. 156 func (m *MockEngine) Prepare(arg0 consensus.ChainReader, arg1 *types.Header) error { 157 m.ctrl.T.Helper() 158 ret := m.ctrl.Call(m, "Prepare", arg0, arg1) 159 ret0, _ := ret[0].(error) 160 return ret0 161 } 162 163 // Prepare indicates an expected call of Prepare. 164 func (mr *MockEngineMockRecorder) Prepare(arg0, arg1 interface{}) *gomock.Call { 165 mr.mock.ctrl.T.Helper() 166 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockEngine)(nil).Prepare), arg0, arg1) 167 } 168 169 // PreprocessHeaderVerification mocks base method. 170 func (m *MockEngine) PreprocessHeaderVerification(arg0 []*types.Header) (chan<- struct{}, <-chan error) { 171 m.ctrl.T.Helper() 172 ret := m.ctrl.Call(m, "PreprocessHeaderVerification", arg0) 173 ret0, _ := ret[0].(chan<- struct{}) 174 ret1, _ := ret[1].(<-chan error) 175 return ret0, ret1 176 } 177 178 // PreprocessHeaderVerification indicates an expected call of PreprocessHeaderVerification. 179 func (mr *MockEngineMockRecorder) PreprocessHeaderVerification(arg0 interface{}) *gomock.Call { 180 mr.mock.ctrl.T.Helper() 181 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreprocessHeaderVerification", reflect.TypeOf((*MockEngine)(nil).PreprocessHeaderVerification), arg0) 182 } 183 184 // Protocol mocks base method. 185 func (m *MockEngine) Protocol() consensus.Protocol { 186 m.ctrl.T.Helper() 187 ret := m.ctrl.Call(m, "Protocol") 188 ret0, _ := ret[0].(consensus.Protocol) 189 return ret0 190 } 191 192 // Protocol indicates an expected call of Protocol. 193 func (mr *MockEngineMockRecorder) Protocol() *gomock.Call { 194 mr.mock.ctrl.T.Helper() 195 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Protocol", reflect.TypeOf((*MockEngine)(nil).Protocol)) 196 } 197 198 // Seal mocks base method. 199 func (m *MockEngine) Seal(arg0 consensus.ChainReader, arg1 *types.Block, arg2 <-chan struct{}) (*types.Block, error) { 200 m.ctrl.T.Helper() 201 ret := m.ctrl.Call(m, "Seal", arg0, arg1, arg2) 202 ret0, _ := ret[0].(*types.Block) 203 ret1, _ := ret[1].(error) 204 return ret0, ret1 205 } 206 207 // Seal indicates an expected call of Seal. 208 func (mr *MockEngineMockRecorder) Seal(arg0, arg1, arg2 interface{}) *gomock.Call { 209 mr.mock.ctrl.T.Helper() 210 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockEngine)(nil).Seal), arg0, arg1, arg2) 211 } 212 213 // VerifyHeader mocks base method. 214 func (m *MockEngine) VerifyHeader(arg0 consensus.ChainReader, arg1 *types.Header, arg2 bool) error { 215 m.ctrl.T.Helper() 216 ret := m.ctrl.Call(m, "VerifyHeader", arg0, arg1, arg2) 217 ret0, _ := ret[0].(error) 218 return ret0 219 } 220 221 // VerifyHeader indicates an expected call of VerifyHeader. 222 func (mr *MockEngineMockRecorder) VerifyHeader(arg0, arg1, arg2 interface{}) *gomock.Call { 223 mr.mock.ctrl.T.Helper() 224 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyHeader", reflect.TypeOf((*MockEngine)(nil).VerifyHeader), arg0, arg1, arg2) 225 } 226 227 // VerifyHeaders mocks base method. 228 func (m *MockEngine) VerifyHeaders(arg0 consensus.ChainReader, arg1 []*types.Header, arg2 []bool) (chan<- struct{}, <-chan error) { 229 m.ctrl.T.Helper() 230 ret := m.ctrl.Call(m, "VerifyHeaders", arg0, arg1, arg2) 231 ret0, _ := ret[0].(chan<- struct{}) 232 ret1, _ := ret[1].(<-chan error) 233 return ret0, ret1 234 } 235 236 // VerifyHeaders indicates an expected call of VerifyHeaders. 237 func (mr *MockEngineMockRecorder) VerifyHeaders(arg0, arg1, arg2 interface{}) *gomock.Call { 238 mr.mock.ctrl.T.Helper() 239 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyHeaders", reflect.TypeOf((*MockEngine)(nil).VerifyHeaders), arg0, arg1, arg2) 240 } 241 242 // VerifySeal mocks base method. 243 func (m *MockEngine) VerifySeal(arg0 consensus.ChainReader, arg1 *types.Header) error { 244 m.ctrl.T.Helper() 245 ret := m.ctrl.Call(m, "VerifySeal", arg0, arg1) 246 ret0, _ := ret[0].(error) 247 return ret0 248 } 249 250 // VerifySeal indicates an expected call of VerifySeal. 251 func (mr *MockEngineMockRecorder) VerifySeal(arg0, arg1 interface{}) *gomock.Call { 252 mr.mock.ctrl.T.Helper() 253 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifySeal", reflect.TypeOf((*MockEngine)(nil).VerifySeal), arg0, arg1) 254 }