Skip to content

Commit

Permalink
use Errorf from fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Sep 6, 2022
1 parent adf3666 commit c0a899e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/arb-rpc-node/nitroexport/crossdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ func (c *CrossDB) importBlock(ctx context.Context, blockNumber uint64) error {
blockHashBefore := block.Header().Hash()
_, err = rawdb.WriteAncientBlocks(c.ethDB, []*types.Block{block}, []types.Receipts{outputReceipts}, big.NewInt(0))
if err != nil {
return errors.Errorf("%w: while storing block %d", err, blockNumber)
return fmt.Errorf("%w: while storing block %d", err, blockNumber)
}
readBlock := rawdb.ReadBlock(c.ethDB, blockHashBefore, blockNumber)
if readBlock == nil {
return errors.Errorf("failed saving block %v", blockNumber)
return fmt.Errorf("failed saving block %v", blockNumber)
}
blockHash := readBlock.Header().Hash()
if blockHash != machineBlockInfo.Header.Hash() {
errStr := ""
for i, tx := range outputTxs {
errStr += fmt.Sprint(i, ": ", tx.Hash(), "\n")
}
return errors.Errorf("bad block %v", blockNumber)
return fmt.Errorf("bad block %v", blockNumber)
}
for i := range outputTxs {
if !reflect.DeepEqual(outputTxs[i].GetInner(), readBlock.Transactions()[i].GetInner()) {
Expand Down

0 comments on commit c0a899e

Please sign in to comment.