Skip to content

Commit 88dfdd0

Browse files
committed
fix example
1 parent ea9f88d commit 88dfdd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/tx/examples/EOACodeTx.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
22
import { createEOACode7702Tx } from '@ethereumjs/tx'
3-
4-
import type { PrefixedHexString } from '@ethereumjs/util'
3+
import { type PrefixedHexString, createAddressFromPrivateKey, randomBytes } from '@ethereumjs/util'
54

65
const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString
76

@@ -12,12 +11,13 @@ const tx = createEOACode7702Tx(
1211
{
1312
chainId: '0x2',
1413
address: `0x${'20'.repeat(20)}`,
15-
nonce: ['0x1'],
14+
nonce: '0x1',
1615
yParity: '0x1',
1716
r: ones32,
1817
s: ones32,
1918
},
2019
],
20+
to: createAddressFromPrivateKey(randomBytes(32)),
2121
},
2222
{ common },
2323
)

0 commit comments

Comments
 (0)