Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Setting hardfork on common
Browse files Browse the repository at this point in the history
  • Loading branch information
micahriggan committed Jul 23, 2019
1 parent 0eff24b commit 85c8a59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ var Block = module.exports = function (data, opts) {
let chain = opts.chain ? opts.chain : 'mainnet'
let hardfork = opts.hardfork ? opts.hardfork : null
this._common = new Common(chain, hardfork)
if (!hardfork) {
hardfork = this._common.activeHardforks()

This comment has been minimized.

Copy link
@alcuadrado

alcuadrado Jul 23, 2019

Member

How can this know which hardfork to return?

this._common._hardfork = hardfork

This comment has been minimized.

Copy link
@alcuadrado

alcuadrado Jul 23, 2019

Member

There's this._common.setHardfork. Can we use that instead?

}
}

this.transactions = []
Expand Down Expand Up @@ -69,9 +73,8 @@ var Block = module.exports = function (data, opts) {
for (var i = 0; i < rawUncleHeaders.length; i++) {
this.uncleHeaders.push(new BlockHeader(rawUncleHeaders[i], opts))
}

for (i = 0; i < rawTransactions.length; i++) {
var tx = new Tx(rawTransactions[i], opts)
var tx = new Tx(rawTransactions[i], {common: this._common})
this.transactions.push(tx)
}
}
Expand Down

0 comments on commit 85c8a59

Please sign in to comment.