Skip to content

Commit

Permalink
WithBlockExtras -> WithBlockExtra
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 22, 2025
1 parent 923b496 commit a3593f6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func ReadBlock(db ethdb.Reader, hash common.Hash, number uint64) *types.Block {
}
block := types.NewBlockWithHeader(header).WithBody(body.Transactions, body.Uncles)
bodyExtra := types.GetBodyExtra(body)
block = types.WithBlockExtras(block, bodyExtra.Version, bodyExtra.ExtData, false)
block = types.WithBlockExtra(block, bodyExtra.Version, bodyExtra.ExtData, false)
return block
}

Expand Down
2 changes: 1 addition & 1 deletion core/types/block_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func NewBlockWithExtData(
) *Block {
b := NewBlock(header, txs, uncles, receipts, hasher)
const version = 0
return WithBlockExtras(b, version, &extdata, recalc)
return WithBlockExtra(b, version, &extdata, recalc)
}

func WrapWithTimestamp(b *Block) *BlockWithTimestamp {
Expand Down
2 changes: 1 addition & 1 deletion core/types/libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func GetBlockExtra(b *Block) *BlockExtra {
return extras.Block.Get(b)
}

func WithBlockExtras(b *Block, version uint32, extdata *[]byte, recalc bool) *Block {
func WithBlockExtra(b *Block, version uint32, extdata *[]byte, recalc bool) *Block {
extras := GetBlockExtra(b)

extras.version = version
Expand Down
2 changes: 1 addition & 1 deletion ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (ec *client) getBlock(ctx context.Context, method string, args ...interface
txs[i] = tx.tx
}
block := types.NewBlockWithHeader(head).WithBody(txs, uncles)
block = types.WithBlockExtras(block, body.Version, (*[]byte)(body.BlockExtraData), false)
block = types.WithBlockExtra(block, body.Version, (*[]byte)(body.BlockExtraData), false)
return block, nil
}

Expand Down

0 comments on commit a3593f6

Please sign in to comment.