@ethereumjs/block
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -112,10 +112,8 @@ "use strict"; | ||
else { | ||
var chain = common_1.Chain.Mainnet; // default | ||
this._common = new common_1.default({ | ||
chain: common_1.Chain.Mainnet, // default | ||
}); | ||
if (options.initWithGenesisHeader) { | ||
this._common = new common_1.default({ chain: chain, hardfork: common_1.Hardfork.Chainstart }); | ||
this._common.setHardforkByBlockNumber(0); | ||
} | ||
else { | ||
// This initializes on the Common default hardfork | ||
this._common = new common_1.default({ chain: chain }); | ||
} | ||
} | ||
@@ -127,3 +125,3 @@ if (options.hardforkByBlockNumber !== undefined && options.hardforkByTD !== undefined) { | ||
if (hardforkByBlockNumber || options.hardforkByTD) { | ||
this._common.setHardforkByBlockNumber(number.toNumber(), options.hardforkByTD); | ||
this._common.setHardforkByBlockNumber(number, options.hardforkByTD); | ||
} | ||
@@ -130,0 +128,0 @@ if (this._common.isActivatedEIP(1559)) { |
@@ -48,10 +48,8 @@ "use strict"; | ||
else { | ||
const chain = common_1.Chain.Mainnet; // default | ||
this._common = new common_1.default({ | ||
chain: common_1.Chain.Mainnet, // default | ||
}); | ||
if (options.initWithGenesisHeader) { | ||
this._common = new common_1.default({ chain, hardfork: common_1.Hardfork.Chainstart }); | ||
this._common.setHardforkByBlockNumber(0); | ||
} | ||
else { | ||
// This initializes on the Common default hardfork | ||
this._common = new common_1.default({ chain }); | ||
} | ||
} | ||
@@ -63,3 +61,3 @@ if (options.hardforkByBlockNumber !== undefined && options.hardforkByTD !== undefined) { | ||
if (hardforkByBlockNumber || options.hardforkByTD) { | ||
this._common.setHardforkByBlockNumber(number.toNumber(), options.hardforkByTD); | ||
this._common.setHardforkByBlockNumber(number, options.hardforkByTD); | ||
} | ||
@@ -66,0 +64,0 @@ if (this._common.isActivatedEIP(1559)) { |
{ | ||
"name": "@ethereumjs/block", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "Provides Block serialization and help functions", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
@@ -1,2 +0,2 @@ | ||
import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' | ||
import Common, { Chain, ConsensusAlgorithm, ConsensusType } from '@ethereumjs/common' | ||
import { | ||
@@ -213,8 +213,7 @@ Address, | ||
} else { | ||
const chain = Chain.Mainnet // default | ||
this._common = new Common({ | ||
chain: Chain.Mainnet, // default | ||
}) | ||
if (options.initWithGenesisHeader) { | ||
this._common = new Common({ chain, hardfork: Hardfork.Chainstart }) | ||
} else { | ||
// This initializes on the Common default hardfork | ||
this._common = new Common({ chain }) | ||
this._common.setHardforkByBlockNumber(0) | ||
} | ||
@@ -231,3 +230,3 @@ } | ||
if (hardforkByBlockNumber || options.hardforkByTD) { | ||
this._common.setHardforkByBlockNumber(number.toNumber(), options.hardforkByTD) | ||
this._common.setHardforkByBlockNumber(number, options.hardforkByTD) | ||
} | ||
@@ -234,0 +233,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93372
345481
5646