From 15228fc92a4d244bd910a96a11a01adbf943b34c Mon Sep 17 00:00:00 2001 From: Micah Riggan Date: Tue, 23 Jul 2019 15:09:44 -0400 Subject: [PATCH] Setting hardfork on common --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5ead7f1..cd682ca 100644 --- a/index.js +++ b/index.js @@ -65,13 +65,16 @@ var Block = module.exports = function (data, opts) { rawUncleHeaders = data.uncleHeaders || [] } + const height = new BN(this.header.number).toNumber() + const hardfork = this._common.activeHardfork(height) + this._common.setHardfork(hardfork) + // parse uncle headers 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) } }