@@ -213,14 +213,14 @@ func (c *Clique) Author(header *types.Header) (common.Address, error) {
213213}
214214
215215// VerifyHeader checks whether a header conforms to the consensus rules.
216- func (c * Clique ) VerifyHeader (chain consensus.ChainReader , header * types.Header , seal bool ) error {
216+ func (c * Clique ) VerifyHeader (chain consensus.ChainHeaderReader , header * types.Header , seal bool ) error {
217217 return c .verifyHeader (chain , header , nil )
218218}
219219
220220// VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers. The
221221// method returns a quit channel to abort the operations and a results channel to
222222// retrieve the async verifications (the order is that of the input slice).
223- func (c * Clique ) VerifyHeaders (chain consensus.ChainReader , headers []* types.Header , seals []bool ) (chan <- struct {}, <- chan error ) {
223+ func (c * Clique ) VerifyHeaders (chain consensus.ChainHeaderReader , headers []* types.Header , seals []bool ) (chan <- struct {}, <- chan error ) {
224224 abort := make (chan struct {})
225225 results := make (chan error , len (headers ))
226226
@@ -242,7 +242,7 @@ func (c *Clique) VerifyHeaders(chain consensus.ChainReader, headers []*types.Hea
242242// caller may optionally pass in a batch of parents (ascending order) to avoid
243243// looking those up from the database. This is useful for concurrently verifying
244244// a batch of new headers.
245- func (c * Clique ) verifyHeader (chain consensus.ChainReader , header * types.Header , parents []* types.Header ) error {
245+ func (c * Clique ) verifyHeader (chain consensus.ChainHeaderReader , header * types.Header , parents []* types.Header ) error {
246246 if header .Number == nil {
247247 return errUnknownBlock
248248 }
@@ -305,7 +305,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainReader, header *types.Header,
305305// rather depend on a batch of previous headers. The caller may optionally pass
306306// in a batch of parents (ascending order) to avoid looking those up from the
307307// database. This is useful for concurrently verifying a batch of new headers.
308- func (c * Clique ) verifyCascadingFields (chain consensus.ChainReader , header * types.Header , parents []* types.Header ) error {
308+ func (c * Clique ) verifyCascadingFields (chain consensus.ChainHeaderReader , header * types.Header , parents []* types.Header ) error {
309309 // The genesis block is the always valid dead-end
310310 number := header .Number .Uint64 ()
311311 if number == 0 {
@@ -345,7 +345,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainReader, header *type
345345}
346346
347347// snapshot retrieves the authorization snapshot at a given point in time.
348- func (c * Clique ) snapshot (chain consensus.ChainReader , number uint64 , hash common.Hash , parents []* types.Header ) (* Snapshot , error ) {
348+ func (c * Clique ) snapshot (chain consensus.ChainHeaderReader , number uint64 , hash common.Hash , parents []* types.Header ) (* Snapshot , error ) {
349349 // Search for a snapshot in memory or on disk for checkpoints
350350 var (
351351 headers []* types.Header
@@ -436,15 +436,15 @@ func (c *Clique) VerifyUncles(chain consensus.ChainReader, block *types.Block) e
436436
437437// VerifySeal implements consensus.Engine, checking whether the signature contained
438438// in the header satisfies the consensus protocol requirements.
439- func (c * Clique ) VerifySeal (chain consensus.ChainReader , header * types.Header ) error {
439+ func (c * Clique ) VerifySeal (chain consensus.ChainHeaderReader , header * types.Header ) error {
440440 return c .verifySeal (chain , header , nil )
441441}
442442
443443// verifySeal checks whether the signature contained in the header satisfies the
444444// consensus protocol requirements. The method accepts an optional list of parent
445445// headers that aren't yet part of the local blockchain to generate the snapshots
446446// from.
447- func (c * Clique ) verifySeal (chain consensus.ChainReader , header * types.Header , parents []* types.Header ) error {
447+ func (c * Clique ) verifySeal (chain consensus.ChainHeaderReader , header * types.Header , parents []* types.Header ) error {
448448 // Verifying the genesis block is not supported
449449 number := header .Number .Uint64 ()
450450 if number == 0 {
@@ -487,7 +487,7 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p
487487
488488// Prepare implements consensus.Engine, preparing all the consensus fields of the
489489// header for running the transactions on top.
490- func (c * Clique ) Prepare (chain consensus.ChainReader , header * types.Header ) error {
490+ func (c * Clique ) Prepare (chain consensus.ChainHeaderReader , header * types.Header ) error {
491491 // If the block isn't a checkpoint, cast a random vote (good enough for now)
492492 header .Coinbase = common.Address {}
493493 header .Nonce = types.BlockNonce {}
@@ -552,15 +552,15 @@ func (c *Clique) Prepare(chain consensus.ChainReader, header *types.Header) erro
552552
553553// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
554554// rewards given.
555- func (c * Clique ) Finalize (chain consensus.ChainReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header ) {
555+ func (c * Clique ) Finalize (chain consensus.ChainHeaderReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header ) {
556556 // No block rewards in PoA, so the state remains as is and uncles are dropped
557557 header .Root = state .IntermediateRoot (chain .Config ().IsEIP158 (header .Number ))
558558 header .UncleHash = types .CalcUncleHash (nil )
559559}
560560
561561// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set,
562562// nor block rewards given, and returns the final block.
563- func (c * Clique ) FinalizeAndAssemble (chain consensus.ChainReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header , receipts []* types.Receipt ) (* types.Block , error ) {
563+ func (c * Clique ) FinalizeAndAssemble (chain consensus.ChainHeaderReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header , receipts []* types.Receipt ) (* types.Block , error ) {
564564 // No block rewards in PoA, so the state remains as is and uncles are dropped
565565 header .Root = state .IntermediateRoot (chain .Config ().IsEIP158 (header .Number ))
566566 header .UncleHash = types .CalcUncleHash (nil )
@@ -581,7 +581,7 @@ func (c *Clique) Authorize(signer common.Address, signFn SignerFn) {
581581
582582// Seal implements consensus.Engine, attempting to create a sealed block using
583583// the local signing credentials.
584- func (c * Clique ) Seal (chain consensus.ChainReader , block * types.Block , results chan <- * types.Block , stop <- chan struct {}) error {
584+ func (c * Clique ) Seal (chain consensus.ChainHeaderReader , block * types.Block , results chan <- * types.Block , stop <- chan struct {}) error {
585585 header := block .Header ()
586586
587587 // Sealing the genesis block is not supported
@@ -654,7 +654,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, results c
654654// CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty
655655// that a new block should have based on the previous blocks in the chain and the
656656// current signer.
657- func (c * Clique ) CalcDifficulty (chain consensus.ChainReader , time uint64 , parent * types.Header ) * big.Int {
657+ func (c * Clique ) CalcDifficulty (chain consensus.ChainHeaderReader , time uint64 , parent * types.Header ) * big.Int {
658658 snap , err := c .snapshot (chain , parent .Number .Uint64 (), parent .Hash (), nil )
659659 if err != nil {
660660 return nil
@@ -684,7 +684,7 @@ func (c *Clique) Close() error {
684684
685685// APIs implements consensus.Engine, returning the user facing RPC API to allow
686686// controlling the signer voting.
687- func (c * Clique ) APIs (chain consensus.ChainReader ) []rpc.API {
687+ func (c * Clique ) APIs (chain consensus.ChainHeaderReader ) []rpc.API {
688688 return []rpc.API {{
689689 Namespace : "clique" ,
690690 Version : "1.0" ,
0 commit comments