Skip to content

Commit

Permalink
Block: deprecation tasks (#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonmacro authored and holgerd77 committed May 4, 2022
1 parent 27447b3 commit 275dfc8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
16 changes: 0 additions & 16 deletions packages/block/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ export class BlockHeader {
hash: undefined,
}

/**
* Backwards compatible alias for {@link BlockHeader.logsBloom}
* (planned to be removed in next major release)
* @deprecated
*/
get bloom() {
return this.logsBloom
}

/**
* EIP-4399: After merge to PoS, `mixHash` supplanted as `prevRandao`
*
Expand All @@ -88,11 +79,6 @@ export class BlockHeader {
* @param opts
*/
public static fromHeaderData(headerData: HeaderData = {}, opts: BlockOptions = {}) {
if (headerData.logsBloom === undefined && headerData.bloom !== undefined) {
// backwards compatible alias for deprecated `bloom` key renamed to `logsBloom`
// (planned to be removed in next major release)
headerData.logsBloom = headerData.bloom
}
const {
parentHash,
uncleHash,
Expand Down Expand Up @@ -990,9 +976,7 @@ export class BlockHeader {
}
if (this._common.isActivatedEIP(1559)) {
jsonDict.baseFeePerGas = '0x' + this.baseFeePerGas!.toString('hex')
jsonDict.baseFee = '0x' + this.baseFeePerGas!.toString('hex') // deprecated alias, please use `baseFeePerGas`, will be removed in next major release
}
jsonDict.bloom = jsonDict.logsBloom // deprecated alias, please use `logsBloom`, will be removed in next major release
return jsonDict
}

Expand Down
21 changes: 0 additions & 21 deletions packages/block/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ export interface HeaderData {
mixHash?: BufferLike
nonce?: BufferLike
baseFeePerGas?: BNLike

/*
* Backwards compatible alias for {@link HeaderData.logsBloom}
* Will only be used if {@link HeaderData.logsBloom} is undefined
* (planned to be removed in next major release)
* @deprecated
*/
bloom?: BufferLike
}

/**
Expand Down Expand Up @@ -162,19 +154,6 @@ export interface JsonHeader {
mixHash?: string
nonce?: string
baseFeePerGas?: string

/*
* Backwards compatible alias for {@link JsonHeader.baseFeePerGas}
* (planned to be removed in next major release)
* @deprecated
*/
baseFee?: string
/*
* Backwards compatible alias for {@link JsonHeader.logsBloom}
* (planned to be removed in next major release)
* @deprecated
*/
bloom?: BufferLike
}

export interface Blockchain {
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/eip1559block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ tape('EIP1559 tests', function (t) {
common,
}
)
st.equal(header.toJSON().baseFee, '0x5')
st.equal(header.toJSON().baseFeePerGas, '0x5')
st.end()
})
})

0 comments on commit 275dfc8

Please sign in to comment.