diff --git a/packages/vm/test/util.ts b/packages/vm/test/util.ts index a1b1e67f6c..a478879cef 100644 --- a/packages/vm/test/util.ts +++ b/packages/vm/test/util.ts @@ -136,8 +136,17 @@ export function makeTx( if (signature.v !== undefined) { signature.yParity = bytesToHex(unpadBytes(hexToBytes(signature.v))) } - if (signature.nonce !== undefined && signature.nonce[0] === '0x00') { - signature.nonce[0] = '0x' + if (signature.r !== undefined) { + signature.r = bytesToHex(unpadBytes(hexToBytes(signature.r))) + } + if (signature.s !== undefined) { + signature.s = bytesToHex(unpadBytes(hexToBytes(signature.s))) + } + if (signature.chainId !== undefined) { + signature.chainId = bytesToHex(unpadBytes(hexToBytes(signature.chainId))) + } + if (signature.nonce !== undefined && signature.nonce === '0x00') { + signature.nonce = '0x' } } tx = createEOACode7702Tx(txData, opts)