1- import { TransactionFactory } from '@ethereumjs/tx'
1+ import { createTx } from '@ethereumjs/tx'
22import { bigIntToHex , hexToBytes } from '@ethereumjs/util'
33import { assert , describe , it } from 'vitest'
44
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'
88
99const method = 'engine_newPayloadV4'
10- const [ blockData ] = blocks
10+ const [ blockData ] = beaconData
1111
1212const parentBeaconBlockRoot = '0x42942949c4ed512cd85c2cb54ca88591338cbb0564d3a2bea7961a639ef29d64'
1313const validForkChoiceState = {
@@ -48,9 +48,9 @@ describe(`${method}: call with executionPayloadV4`, () => {
4848 it ( 'valid data' , async ( ) => {
4949 // get the genesis json with late enougt date with respect to block data in batchBlocks
5050
51- const { pragueJson, pragueTime } = readyEip6493Genesis ( genesisJSON )
51+ const { pragueJson, pragueTime } = readyEip6493Genesis ( postMergeData )
5252 const { service, server, common } = await setupChain ( pragueJson , 'post-merge' , { engine : true } )
53- const rpc = getRpcClient ( server )
53+ const rpc = getRPCClient ( server )
5454 const validBlock = {
5555 ...blockData ,
5656 timestamp : bigIntToHex ( BigInt ( pragueTime ) ) ,
@@ -78,7 +78,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
7878
7979 // address 0x610adc49ecd66cbf176a8247ebd59096c031bd9f has been sufficiently funded in genesis
8080 const pk = hexToBytes ( '0x9c9996335451aab4fc4eac58e31a8c300e095cdbcee532d53d09280e83360355' )
81- const depositTx = TransactionFactory . fromTxData (
81+ const depositTx = createTx (
8282 {
8383 data : '0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001208cd4e5a69709cf8ee5b1b73d6efbf3f33bcac92fb7e4ce62b2467542fb50a72d0000000000000000000000000000000000000000000000000000000000000030ac842878bb70009552a4cfcad801d6e659c50bd50d7d03306790cb455ce7363c5b6972f0159d170f625a99b2064dbefc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000818ccb1c4eda80270b04d6df822b1e72dd83c3030000000000000000000000000000000000000000000000000000000000000060a747f75c72d0cf0d2b52504c7385b516f0523e2f0842416399f42b4aee5c6384a5674f6426b1cc3d0827886fa9b909e616f5c9f61f986013ed2b9bf37071cbae951136265b549f44e3c8e26233c0433e9124b7fd0dc86e82f9fedfc0a179d769' ,
8484 value : 32000000000000000000n ,
@@ -87,11 +87,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
8787 type : 2 ,
8888 to : '0x00000000219ab540356cBB839Cbe05303d7705Fa' ,
8989 } ,
90- { common }
90+ { common } ,
9191 ) . sign ( pk )
9292 await service . txPool . add ( depositTx , true )
9393
94- const normalLegacyTx = TransactionFactory . fromTxData (
94+ const normalLegacyTx = createTx (
9595 {
9696 data : '0x' ,
9797 value : 32000000000000000000n ,
@@ -101,7 +101,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
101101 to : '0x10000000219ab540356cBB839Cbe05303d7705Fa' ,
102102 nonce : 1 ,
103103 } ,
104- { common }
104+ { common } ,
105105 ) . sign ( pk )
106106 await service . txPool . add ( normalLegacyTx , true )
107107
@@ -115,11 +115,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
115115 assert . ok ( executionPayload . transactions . length === 2 , 'two transactions should have been added' )
116116 assert . ok (
117117 executionPayload . depositRequests ?. length === 1 ,
118- 'depositRequests should have 1 deposit request'
118+ 'depositRequests should have 1 deposit request' ,
119119 )
120120 assert . ok (
121121 executionPayload . withdrawalRequests !== undefined ,
122- 'depositRequests field should be received'
122+ 'depositRequests field should be received' ,
123123 )
124124
125125 res = await rpc . request ( method , [ executionPayload , [ ] , parentBeaconBlockRoot ] )
0 commit comments