Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anshalshukla committed Oct 20, 2023
1 parent 9f44579 commit aff2f1f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ func encodeSigHeader(w io.Writer, header *types.Header, c *params.BorConfig) {
}
}

if header.WithdrawalsHash != nil {
header.WithdrawalsHash = nil

log.Warn("Bor does not support withdrawals", "number", header.Number)
}

if err := rlp.Encode(w, enc); err != nil {
panic("can't encode: " + err.Error())
}
Expand Down Expand Up @@ -817,13 +823,14 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
headerNumber := header.Number.Uint64()

if withdrawals != nil {
withdrawals = nil
log.Error("Bor does not support withdrawals", "number", headerNumber)
// withdrawals = nil is not required because withdrawals are not used
log.Warn("Bor does not support withdrawals", "number", headerNumber)
}

if header.WithdrawalsHash != nil {
header.WithdrawalsHash = nil
log.Error("Bor does not support withdrawalHash", "number", headerNumber)

log.Warn("Bor does not support withdrawalHash", "number", headerNumber)
}

if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
Expand Down Expand Up @@ -901,11 +908,14 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
headerNumber := header.Number.Uint64()

if withdrawals != nil {
log.Error("Bor does not support withdrawals", "number", headerNumber)
// withdrawals != nil not required because withdrawals are not used
log.Warn("Bor does not support withdrawals", "number", headerNumber)
}

if header.WithdrawalsHash != nil {
log.Error("Bor does not support withdrawalHash", "number", headerNumber)
header.WithdrawalsHash = nil

log.Warn("Bor does not support withdrawalHash", "number", headerNumber)
}

stateSyncData := []*types.StateSyncData{}
Expand Down

0 comments on commit aff2f1f

Please sign in to comment.