@@ -25,7 +25,11 @@ export class Block {
25
25
// parse transactions
26
26
const transactions = [ ]
27
27
for ( const txData of txsData || [ ] ) {
28
- const tx = Transaction . fromTxData ( txData , opts as TxOptions )
28
+ const tx = Transaction . fromTxData ( txData , {
29
+ ...opts ,
30
+ // Use header common in case of hardforkByBlockNumber being activated
31
+ common : header . _common ,
32
+ } as TxOptions )
29
33
transactions . push ( tx )
30
34
}
31
35
@@ -34,7 +38,10 @@ export class Block {
34
38
for ( const uhData of uhsData || [ ] ) {
35
39
const uh = BlockHeader . fromHeaderData ( uhData , {
36
40
...opts ,
37
- // Disable this option here (all other options carried over), since this overwrites the provided Difficulty to an incorrect value
41
+ // Use header common in case of hardforkByBlockNumber being activated
42
+ common : header . _common ,
43
+ // Disable this option here (all other options carried over), since this overwrites
44
+ // the provided Difficulty to an incorrect value
38
45
calcDifficultyFromHeader : undefined ,
39
46
} )
40
47
uncleHeaders . push ( uh )
@@ -65,7 +72,13 @@ export class Block {
65
72
// parse transactions
66
73
const transactions = [ ]
67
74
for ( const txData of txsData || [ ] ) {
68
- transactions . push ( Transaction . fromValuesArray ( txData , opts ) )
75
+ transactions . push (
76
+ Transaction . fromValuesArray ( txData , {
77
+ ...opts ,
78
+ // Use header common in case of hardforkByBlockNumber being activated
79
+ common : header . _common ,
80
+ } )
81
+ )
69
82
}
70
83
71
84
// parse uncle headers
@@ -74,6 +87,8 @@ export class Block {
74
87
uncleHeaders . push (
75
88
BlockHeader . fromValuesArray ( uncleHeaderData , {
76
89
...opts ,
90
+ // Use header common in case of hardforkByBlockNumber being activated
91
+ common : header . _common ,
77
92
// Disable this option here (all other options carried over), since this overwrites the provided Difficulty to an incorrect value
78
93
calcDifficultyFromHeader : undefined ,
79
94
} )
0 commit comments