From 88dfdd0b69c75759cb834ed5d64fbf7d6e564e23 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:30:29 -0400 Subject: [PATCH] fix example --- packages/tx/examples/EOACodeTx.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tx/examples/EOACodeTx.ts b/packages/tx/examples/EOACodeTx.ts index 482600669b..d23700ae5c 100644 --- a/packages/tx/examples/EOACodeTx.ts +++ b/packages/tx/examples/EOACodeTx.ts @@ -1,7 +1,6 @@ import { Common, Hardfork, Mainnet } from '@ethereumjs/common' import { createEOACode7702Tx } from '@ethereumjs/tx' - -import type { PrefixedHexString } from '@ethereumjs/util' +import { type PrefixedHexString, createAddressFromPrivateKey, randomBytes } from '@ethereumjs/util' const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString @@ -12,12 +11,13 @@ const tx = createEOACode7702Tx( { chainId: '0x2', address: `0x${'20'.repeat(20)}`, - nonce: ['0x1'], + nonce: '0x1', yParity: '0x1', r: ones32, s: ones32, }, ], + to: createAddressFromPrivateKey(randomBytes(32)), }, { common }, )