mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
dev: provide previous block number to UnauthorizedSignerError
This commit is contained in:
parent
c7ea09a019
commit
1be0c4894a
2 changed files with 5 additions and 3 deletions
|
|
@ -555,7 +555,8 @@ func (c *Bor) verifySeal(chain consensus.ChainReader, header *types.Header, pare
|
|||
return err
|
||||
}
|
||||
if !snap.ValidatorSet.HasAddress(signer.Bytes()) {
|
||||
return &UnauthorizedSignerError{number, signer.Bytes()}
|
||||
// Check the UnauthorizedSignerError.Error() msg to see why we pass number-1
|
||||
return &UnauthorizedSignerError{number - 1, signer.Bytes()}
|
||||
}
|
||||
|
||||
succession, err := snap.GetSignerSuccessionNumber(signer)
|
||||
|
|
@ -741,7 +742,8 @@ func (c *Bor) Seal(chain consensus.ChainReader, block *types.Block, results chan
|
|||
|
||||
// Bail out if we're unauthorized to sign a block
|
||||
if !snap.ValidatorSet.HasAddress(signer.Bytes()) {
|
||||
return &UnauthorizedSignerError{number, signer.Bytes()}
|
||||
// Check the UnauthorizedSignerError.Error() msg to see why we pass number-1
|
||||
return &UnauthorizedSignerError{number - 1, signer.Bytes()}
|
||||
}
|
||||
|
||||
successionNumber, err := snap.GetSignerSuccessionNumber(signer)
|
||||
|
|
|
|||
|
|
@ -185,5 +185,5 @@ func TestSignerNotFound(t *testing.T) {
|
|||
_, err := chain.InsertChain([]*types.Block{block})
|
||||
assert.Equal(t,
|
||||
*err.(*bor.UnauthorizedSignerError),
|
||||
bor.UnauthorizedSignerError{Number: 1, Signer: addr.Bytes()})
|
||||
bor.UnauthorizedSignerError{Number: 0, Signer: addr.Bytes()})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue