1
- import { TransactionFactory } from '@ethereumjs/tx'
1
+ import { createTx } from '@ethereumjs/tx'
2
2
import { bigIntToHex , hexToBytes } from '@ethereumjs/util'
3
3
import { assert , describe , it } from 'vitest'
4
4
5
- import blocks from '../../testdata/blocks/beacon.json '
6
- import genesisJSON from '../../testdata/geth-genesis/post-merge.json '
7
- import { getRpcClient , setupChain } from '../helpers.js'
5
+ import { beaconData } from '../../testdata/blocks/beacon.js '
6
+ import { postMergeData } from '../../testdata/geth-genesis/post-merge.js '
7
+ import { getRPCClient , setupChain } from '../helpers.js'
8
8
9
9
const method = 'engine_newPayloadV4'
10
- const [ blockData ] = blocks
10
+ const [ blockData ] = beaconData
11
11
12
12
const parentBeaconBlockRoot = '0x42942949c4ed512cd85c2cb54ca88591338cbb0564d3a2bea7961a639ef29d64'
13
13
const validForkChoiceState = {
@@ -48,9 +48,9 @@ describe(`${method}: call with executionPayloadV4`, () => {
48
48
it ( 'valid data' , async ( ) => {
49
49
// get the genesis json with late enougt date with respect to block data in batchBlocks
50
50
51
- const { pragueJson, pragueTime } = readyEip6493Genesis ( genesisJSON )
51
+ const { pragueJson, pragueTime } = readyEip6493Genesis ( postMergeData )
52
52
const { service, server, common } = await setupChain ( pragueJson , 'post-merge' , { engine : true } )
53
- const rpc = getRpcClient ( server )
53
+ const rpc = getRPCClient ( server )
54
54
const validBlock = {
55
55
...blockData ,
56
56
timestamp : bigIntToHex ( BigInt ( pragueTime ) ) ,
@@ -78,7 +78,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
78
78
79
79
// address 0x610adc49ecd66cbf176a8247ebd59096c031bd9f has been sufficiently funded in genesis
80
80
const pk = hexToBytes ( '0x9c9996335451aab4fc4eac58e31a8c300e095cdbcee532d53d09280e83360355' )
81
- const depositTx = TransactionFactory . fromTxData (
81
+ const depositTx = createTx (
82
82
{
83
83
data : '0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001208cd4e5a69709cf8ee5b1b73d6efbf3f33bcac92fb7e4ce62b2467542fb50a72d0000000000000000000000000000000000000000000000000000000000000030ac842878bb70009552a4cfcad801d6e659c50bd50d7d03306790cb455ce7363c5b6972f0159d170f625a99b2064dbefc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000818ccb1c4eda80270b04d6df822b1e72dd83c3030000000000000000000000000000000000000000000000000000000000000060a747f75c72d0cf0d2b52504c7385b516f0523e2f0842416399f42b4aee5c6384a5674f6426b1cc3d0827886fa9b909e616f5c9f61f986013ed2b9bf37071cbae951136265b549f44e3c8e26233c0433e9124b7fd0dc86e82f9fedfc0a179d769' ,
84
84
value : 32000000000000000000n ,
@@ -87,11 +87,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
87
87
type : 2 ,
88
88
to : '0x00000000219ab540356cBB839Cbe05303d7705Fa' ,
89
89
} ,
90
- { common }
90
+ { common } ,
91
91
) . sign ( pk )
92
92
await service . txPool . add ( depositTx , true )
93
93
94
- const normalLegacyTx = TransactionFactory . fromTxData (
94
+ const normalLegacyTx = createTx (
95
95
{
96
96
data : '0x' ,
97
97
value : 32000000000000000000n ,
@@ -101,7 +101,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
101
101
to : '0x10000000219ab540356cBB839Cbe05303d7705Fa' ,
102
102
nonce : 1 ,
103
103
} ,
104
- { common }
104
+ { common } ,
105
105
) . sign ( pk )
106
106
await service . txPool . add ( normalLegacyTx , true )
107
107
@@ -115,11 +115,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
115
115
assert . ok ( executionPayload . transactions . length === 2 , 'two transactions should have been added' )
116
116
assert . ok (
117
117
executionPayload . depositRequests ?. length === 1 ,
118
- 'depositRequests should have 1 deposit request'
118
+ 'depositRequests should have 1 deposit request' ,
119
119
)
120
120
assert . ok (
121
121
executionPayload . withdrawalRequests !== undefined ,
122
- 'depositRequests field should be received'
122
+ 'depositRequests field should be received' ,
123
123
)
124
124
125
125
res = await rpc . request ( method , [ executionPayload , [ ] , parentBeaconBlockRoot ] )
0 commit comments