From 851495bb65b577bc18555e3e1006c41e2ec9081a Mon Sep 17 00:00:00 2001 From: Marian Radu Date: Thu, 16 Oct 2025 15:47:28 +0300 Subject: [PATCH 1/9] Add tests to validate return data. --- contracts/ReturnDataTester.sol | 25 ++++++++++++++ src/others.test.ts | 60 ++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 contracts/ReturnDataTester.sol diff --git a/contracts/ReturnDataTester.sol b/contracts/ReturnDataTester.sol new file mode 100644 index 0000000..c30e735 --- /dev/null +++ b/contracts/ReturnDataTester.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// Child contract with dummy state passed through constructor +contract Child { +} + +// Parent contract that creates a child and captures return data +contract ReturnDataTester { + uint public returndatasize; + + function createChildContract() external { + new Child(); + uint size; + assembly { + size := returndatasize() + } + returndatasize = size; + } + + // Read-only function to return the captured return data size + function getCapturedReturnDataSize() external view returns (uint) { + return returndatasize; + } +} \ No newline at end of file diff --git a/src/others.test.ts b/src/others.test.ts index 23ad972..a4c3295 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -9,6 +9,7 @@ import { expect } from '@std/expect' import { decodeEventLog, encodeFunctionData, parseEther } from 'viem' import { ErrorsAbi } from '../abi/Errors.ts' import { EventExampleAbi } from '../abi/EventExample.ts' +import { ReturnDataTesterAbi } from '../abi/ReturnDataTester.ts' // Initialize test environment const env = await getEnv() @@ -31,6 +32,15 @@ const getEventExampleAddr = memoizedDeploy( }), ) +const getReturnDataTesterAddr = memoizedDeploy( + env, + () => + env.serverWallet.deployContract({ + abi: ReturnDataTesterAbi, + bytecode: getByteCode('ReturnDataTester', env.evm), + }), +) + Deno.test('eth_call with insufficient funds', opts, async () => { try { await env.emptyWallet.simulateContract({ @@ -239,3 +249,53 @@ Deno.test('logs', opts, async () => { }, }) }) + +// execute the tx that create a child contract and record the return data size -> +// when we read the recoreded data size it should be 0 +// traces should look the same as geth -> TODO: +Deno.test('returndata works after create', opts, async () => { + const address = await getReturnDataTesterAddr() + const { request } = await env.serverWallet.simulateContract({ + address, + abi: ReturnDataTesterAbi, + functionName: 'createChildContract', + }) + + const hash = await env.serverWallet.writeContract(request) + const receipt = await env.serverWallet.waitForTransactionReceipt( + hash, + ) + expect(receipt.status).toEqual('success') + + const dataSize = await env.emptyWallet.readContract({ + address: address, + abi: ReturnDataTesterAbi, + functionName: 'getCapturedReturnDataSize', + args: [], + }) + + expect(dataSize).toBe(0n) +}) + +// eth_call deployment -> should return the runtime code +// deploy the contract +Deno.test('eth_call (deployment) returns runtime bytecode', opts, async () => { + const callData = + '0x6080604052348015600e575f5ffd5b50606f80601a5f395ff3fe6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033' + + // Use another wallet's raw request to send a direct eth_call while keeping + // the `from` set to the server wallet's address (serverWallet.request blocks raw RPCs). + const from = env.serverWallet.account.address + + // Type definitions for wallet.request don't include raw eth_call — cast to any to send the raw JSON-RPC. + const result = await (env.emptyWallet as any).request({ + method: 'eth_call', + params: [{ data: callData, from }, 'latest'], + }) + + // Basic assertions: result is a hex string and non-empty + expect(typeof result).toBe('string') + expect((result as string).slice(0, 2)).toBe('0x') + expect((result as string).length).toBeGreaterThan(2) + expect(result).toBe("0x6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033") +}) \ No newline at end of file From cc4e80cc68fa74ef9e4d76ff9b371045066c3d32 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Thu, 16 Oct 2025 15:50:43 +0300 Subject: [PATCH 2/9] Add artifacts --- abi/Child.json | 1 + abi/Child.ts | 1 + abi/ReturnDataTester.json | 35 +++++++++++++++++++++++++++++++++++ abi/ReturnDataTester.ts | 35 +++++++++++++++++++++++++++++++++++ evm/Child.bin | Bin 0 -> 88 bytes evm/ReturnDataTester.bin | Bin 0 -> 411 bytes pvm/Child.polkavm | Bin 0 -> 824 bytes pvm/ReturnDataTester.polkavm | Bin 0 -> 3022 bytes src/others.test.ts | 6 ++++-- 9 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 abi/Child.json create mode 100644 abi/Child.ts create mode 100644 abi/ReturnDataTester.json create mode 100644 abi/ReturnDataTester.ts create mode 100644 evm/Child.bin create mode 100644 evm/ReturnDataTester.bin create mode 100644 pvm/Child.polkavm create mode 100644 pvm/ReturnDataTester.polkavm diff --git a/abi/Child.json b/abi/Child.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/abi/Child.json @@ -0,0 +1 @@ +[] diff --git a/abi/Child.ts b/abi/Child.ts new file mode 100644 index 0000000..cb39487 --- /dev/null +++ b/abi/Child.ts @@ -0,0 +1 @@ +export const ChildAbi = [] as const diff --git a/abi/ReturnDataTester.json b/abi/ReturnDataTester.json new file mode 100644 index 0000000..3b6e538 --- /dev/null +++ b/abi/ReturnDataTester.json @@ -0,0 +1,35 @@ +[ + { + "inputs": [], + "name": "createChildContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCapturedReturnDataSize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "returndatasize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/ReturnDataTester.ts b/abi/ReturnDataTester.ts new file mode 100644 index 0000000..6fcb1b7 --- /dev/null +++ b/abi/ReturnDataTester.ts @@ -0,0 +1,35 @@ +export const ReturnDataTesterAbi = [ + { + 'inputs': [], + 'name': 'createChildContract', + 'outputs': [], + 'stateMutability': 'nonpayable', + 'type': 'function', + }, + { + 'inputs': [], + 'name': 'getCapturedReturnDataSize', + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], + 'stateMutability': 'view', + 'type': 'function', + }, + { + 'inputs': [], + 'name': 'returndatasize', + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], + 'stateMutability': 'view', + 'type': 'function', + }, +] as const diff --git a/evm/Child.bin b/evm/Child.bin new file mode 100644 index 0000000000000000000000000000000000000000..09ce995dc687cc0c624279da9344914b5ac7e703 GIT binary patch literal 88 zcmYdjNN@-;X%J1|3y+Wg8y%2f*N`9;ZyEpjUjj%5DE4nrN@hV?afFhPg3gN@ukGti q=S^Cn#5YU4l4WN1V%=rC70fp5HaStxB)%@CI6o)ZnSn!&!59EhJR?5< literal 0 HcmV?d00001 diff --git a/evm/ReturnDataTester.bin b/evm/ReturnDataTester.bin new file mode 100644 index 0000000000000000000000000000000000000000..9b9d2599272cf90e86684c237529ade86bff0e11 GIT binary patch literal 411 zcmYdjNN@-;X%J1|3y+Wg8y%3ySl^JyAQNvH|M_16np^^lnLvV7c)V%C1DS^8&MWSF zL=x=6858o6?hyb#7PJZYml8_J{4KgdiC7~)TI>8|@!GGd}gj--{!$jr@pQ97v z66(XE8KM)?5;j0o6r!n!4{3x*bWTXv0oNJ-p+OYr)P>=;@$q)HAm;|e+fE2*h;N(_ z8W0c$v^8WxzyzT32%sN6HCr+Q*+98~i4%a530E2uj)X-w1%Xv2C^Run2uOGx-^|#O za5gM@(nO#zrjP9!5~L7e0rb_sMJbsDX~hvrLJB%BZoIayH=Q?Wg%aN^@k*AN-HUaX z?N%_`u-oKBJ(Kvll;ZrHWM>8rIR;~drU1i^ zZB;AzM+N6J|4F`3b#j$be!INkluFKeNR^lx993Z2*t)Y*D7s^;k0f?C0#figY{0MZ zJJcjy${+-!CG;6uvIzpsT_s?AgvH0jhb&&~vji$05~`6JCN3g`57MMQ!v`j*U*ZFU z)GzXZPU_Qqppkll4=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{fMA4Ch}v9qt1=?Ocod zSJvu%6~7#8|zN^rstjkD`$TbkO$Uh!-epPIp3KBjg567eKKCxg2!5OzB-8c IT-byD4J7WPZU6uP literal 0 HcmV?d00001 diff --git a/src/others.test.ts b/src/others.test.ts index a4c3295..d16d4a4 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -297,5 +297,7 @@ Deno.test('eth_call (deployment) returns runtime bytecode', opts, async () => { expect(typeof result).toBe('string') expect((result as string).slice(0, 2)).toBe('0x') expect((result as string).length).toBeGreaterThan(2) - expect(result).toBe("0x6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033") -}) \ No newline at end of file + expect(result).toBe( + '0x6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033', + ) +}) From 9e86b8cfff436d4cc6b53b88b8117b7f2fe0506c Mon Sep 17 00:00:00 2001 From: pgherveou Date: Thu, 16 Oct 2025 17:46:07 +0300 Subject: [PATCH 3/9] wip --- abi/ReturnDataTester.json | 52 +++++++++++++- abi/ReturnDataTester.ts | 52 +++++++++++++- evm/Child.bin | Bin 88 -> 88 bytes evm/ReturnDataTester.bin | Bin 411 -> 971 bytes pvm/ReturnDataTester.polkavm | Bin 3022 -> 5240 bytes src/others.test.ts | 129 +++++++++++++++-------------------- 6 files changed, 156 insertions(+), 77 deletions(-) diff --git a/abi/ReturnDataTester.json b/abi/ReturnDataTester.json index 3b6e538..e3ae580 100644 --- a/abi/ReturnDataTester.json +++ b/abi/ReturnDataTester.json @@ -1,11 +1,48 @@ [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "callStuff", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "createChildContract", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "doStuff", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, { "inputs": [], "name": "getCapturedReturnDataSize", @@ -19,6 +56,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "otherField", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "returndatasize", diff --git a/abi/ReturnDataTester.ts b/abi/ReturnDataTester.ts index 6fcb1b7..4d46c3d 100644 --- a/abi/ReturnDataTester.ts +++ b/abi/ReturnDataTester.ts @@ -1,11 +1,48 @@ export const ReturnDataTesterAbi = [ + { + 'inputs': [], + 'stateMutability': 'nonpayable', + 'type': 'constructor', + }, + { + 'inputs': [], + 'name': 'callStuff', + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], + 'stateMutability': 'nonpayable', + 'type': 'function', + }, { 'inputs': [], 'name': 'createChildContract', - 'outputs': [], + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], 'stateMutability': 'nonpayable', 'type': 'function', }, + { + 'inputs': [], + 'name': 'doStuff', + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], + 'stateMutability': 'pure', + 'type': 'function', + }, { 'inputs': [], 'name': 'getCapturedReturnDataSize', @@ -19,6 +56,19 @@ export const ReturnDataTesterAbi = [ 'stateMutability': 'view', 'type': 'function', }, + { + 'inputs': [], + 'name': 'otherField', + 'outputs': [ + { + 'internalType': 'uint256', + 'name': '', + 'type': 'uint256', + }, + ], + 'stateMutability': 'view', + 'type': 'function', + }, { 'inputs': [], 'name': 'returndatasize', diff --git a/evm/Child.bin b/evm/Child.bin index 09ce995dc687cc0c624279da9344914b5ac7e703..44a91d442937ef81731c51e23e52e21336ee4665 100644 GIT binary patch delta 48 zcmV-00MGweSdc9%=GJ8J?62wU0ko@I)lbwKclzE0uyTazKdoYecODBqWOHw9V?zK4 G9so0R=oTpe delta 48 zcmV-00MGweSdc9%Ea=$lKYulzlBgmMniqKlnTw+>rn?|Eu)8$Ke*zb-WOHw9V?zK4 G9so1-SQ4TD diff --git a/evm/ReturnDataTester.bin b/evm/ReturnDataTester.bin index 9b9d2599272cf90e86684c237529ade86bff0e11..dde0fc983b5a6a135b036b6b48464c080a9b530e 100644 GIT binary patch literal 971 zcmb`GPiWI%7{>E{Ehq}EjJ3EaU9qPLlSy^3Lu+A&!aVeAsmV0p_r11=e=3s|8N-7~ zS|=MG(s}SE>R~8D^q}BCya+o_oPr=SVGNWCm0e`u^i7(z#dejs)FQV%Kx&B$MymxMVUOPJ zq>m8pdGtjmT}D{&=(|q3jMx|QYhC}hL} zn_rsC@kA}eahE+ZRIbzLBv zu2?q#*{G^hQ@3$5g3XjC4B6KTC(Ye{Sh#rgd};hpcVy#3p@CJLpAVt!QF9adtkqUaGw?OJ%89$b$2zZcZ`+{vMprPM}rW%6u& Q*1U3~t!U?e_}|O?0Y%PwjsO4v literal 411 zcmYdjNN@-;X%J1|3y+Wg8y%3ySl^JyAQNvH|M_16np^^lnLvV7c)V%C1DS^8&MWSF zL=x=6858o6?hyb#7PJZYml8_J{4KgdiC7~)TI>8|@!GGd}gj--{!$jr@pQ97v z66(XE8KM)?5;j0o6r!n!4{3x*bWTXv0oNJ-p+OYr)P>=;@$q)HAm;|e+fE2*h;N(_ z8W0c$v^8WxzyzT32%sN6HCr+Q*+98~i4%a530E2uj)X-w1%Xv2C^Run2uOGx-^|#O za5gM@(nO#zrjP9!5~L7e0rb_sMJbsDX~hvrLJB%BZoIayH=Q?Wg%aN^@k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;)Q_%7M6`DH2DncNRz6F5k1-Q9uf+c7AHA?v0QSvLik z1Wcf$Ji$PEoz;k;Ur(Vp9iK+@`Xr*?OrZbe_$_?A6%xF6<&1gQI|rBrbo?QHh2a>QN zfI%pmhX|-E7R7SmK-K*D^ulk51Wp4|fCTb^UJyE9N8fam1duxfRbYwLjf+I;BvJ>F zVy~K<3(A5>z^lGvais`fDK8dboC&RTiRJtB5`Ew9%B5c?fpI8^F~A5Q3x$zgE{rh< zWE=t+fx^f>E{xsW#wU&f*I#-nl)zK}B{Tj+tk6ts8Nr(e4q*_1QDC~bq5#LZsPyNL zEv#tX_+v5I3C%?_Ie`=0Mj7Y=j2U7KAz}bS1~6nK0ONo$0En+Q3+YQRj*?|ew80q| za=jh*IJ>h{Y^Korq*%>kxP*HXd1^ zY6z4-6^r_tZGWw;1Z~+U_BKb+Y*n+wP5b7T^I)7udzDfr=>4+=M2f9ZjQIbAR zMZJMYI1;&}6P;vuDV$0f7e!K+Nu{FIgo)}2eSbukJpEC97!35fGrmtp`rFdJ4bP-f zskTT&Ps8p=cU1Sj1{1jOLc^Z$W4PV&_ q+lm|3t|yI+naoAq(R;4=E;LkEdjljB@rL>CXv*iU%jlPM5BeAW*(T!v diff --git a/src/others.test.ts b/src/others.test.ts index d16d4a4..94db84c 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -14,31 +14,25 @@ import { ReturnDataTesterAbi } from '../abi/ReturnDataTester.ts' // Initialize test environment const env = await getEnv() -const getErrorTesterAddr = memoizedDeploy( - env, - () => - env.serverWallet.deployContract({ - abi: ErrorsAbi, - bytecode: getByteCode('Errors', env.evm), - }), +const getErrorTesterAddr = memoizedDeploy(env, () => + env.serverWallet.deployContract({ + abi: ErrorsAbi, + bytecode: getByteCode('Errors', env.evm), + }) ) -const getEventExampleAddr = memoizedDeploy( - env, - () => - env.serverWallet.deployContract({ - abi: EventExampleAbi, - bytecode: getByteCode('EventExample', env.evm), - }), +const getEventExampleAddr = memoizedDeploy(env, () => + env.serverWallet.deployContract({ + abi: EventExampleAbi, + bytecode: getByteCode('EventExample', env.evm), + }) ) -const getReturnDataTesterAddr = memoizedDeploy( - env, - () => - env.serverWallet.deployContract({ - abi: ReturnDataTesterAbi, - bytecode: getByteCode('ReturnDataTester', env.evm), - }), +const getReturnDataTesterAddr = memoizedDeploy(env, () => + env.serverWallet.deployContract({ + abi: ReturnDataTesterAbi, + bytecode: getByteCode('ReturnDataTester', env.evm), + }) ) Deno.test('eth_call with insufficient funds', opts, async () => { @@ -54,18 +48,14 @@ Deno.test('eth_call with insufficient funds', opts, async () => { } catch (_) { const lastJsonRpcError = jsonRpcErrors.pop() expect(lastJsonRpcError?.code).toBe(-32000) - expect(lastJsonRpcError?.message).toContain( - 'insufficient funds', - ) + expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } }) Deno.test('eth_call transfer with insufficient funds', opts, async () => { const value = parseEther('10') - const balance = await env.emptyWallet.getBalance( - env.emptyWallet.account, - ) + const balance = await env.emptyWallet.getBalance(env.emptyWallet.account) if (balance >= value) { throw new Error('Balance should be less than 10') } @@ -78,9 +68,7 @@ Deno.test('eth_call transfer with insufficient funds', opts, async () => { } catch (_) { const lastJsonRpcError = jsonRpcErrors.pop() expect(lastJsonRpcError?.code).toBe(-32000) - expect(lastJsonRpcError?.message).toContain( - 'insufficient funds', - ) + expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } }) @@ -98,9 +86,7 @@ Deno.test('eth_estimate with insufficient funds', opts, async () => { } catch (_err) { const lastJsonRpcError = jsonRpcErrors.pop() expect(lastJsonRpcError?.code).toBe(-32000) - expect(lastJsonRpcError?.message).toContain( - 'insufficient funds', - ) + expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } }) @@ -121,12 +107,10 @@ Deno.test( } catch (_err) { const lastJsonRpcError = jsonRpcErrors.pop() expect(lastJsonRpcError?.code).toBe(-32000) - expect(lastJsonRpcError?.message).toContain( - 'insufficient funds', - ) + expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } - }, + } ) Deno.test('eth_estimate with revert', opts, async () => { @@ -147,7 +131,7 @@ Deno.test('eth_estimate with revert', opts, async () => { 'execution reverted: revert: msg.value does not match value', ]).toContain(lastJsonRpcError?.message) expect(lastJsonRpcError?.data).toBe( - '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e6d73672e76616c756520646f6573206e6f74206d617463682076616c75650000', + '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e6d73672e76616c756520646f6573206e6f74206d617463682076616c75650000' ) } }) @@ -164,7 +148,7 @@ Deno.test( opts, async () => { const balance = await env.serverWallet.getBalance( - env.emptyWallet.account, + env.emptyWallet.account ) expect(balance).toBe(0n) try { @@ -178,18 +162,14 @@ Deno.test( } catch (_err) { const lastJsonRpcError = jsonRpcErrors.pop() expect(lastJsonRpcError?.code).toBe(-32000) - expect(lastJsonRpcError?.message).toContain( - 'insufficient funds', - ) + expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } - }, + } ) Deno.test('eth_estimate with no gas specified', opts, async () => { - const balance = await env.serverWallet.getBalance( - env.emptyWallet.account, - ) + const balance = await env.serverWallet.getBalance(env.emptyWallet.account) expect(balance).toBe(0n) const data = encodeFunctionData({ @@ -219,9 +199,7 @@ Deno.test('logs', opts, async () => { }) const hash = await env.serverWallet.writeContract(request) - const receipt = await env.serverWallet.waitForTransactionReceipt( - hash, - ) + const receipt = await env.serverWallet.waitForTransactionReceipt(hash) const logs = await env.serverWallet.getLogs({ address, blockHash: receipt.blockHash, @@ -229,8 +207,7 @@ Deno.test('logs', opts, async () => { expect(logs).toHaveLength(1) expect(logs[0]).toMatchObject({ address, - data: - '0x00000000000000000000000000000000000000000000000000000000000030390000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20776f726c64000000000000000000000000000000000000000000', + data: '0x00000000000000000000000000000000000000000000000000000000000030390000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20776f726c64000000000000000000000000000000000000000000', transactionHash: hash, }) @@ -239,7 +216,7 @@ Deno.test('logs', opts, async () => { abi: EventExampleAbi, data: logs[0].data, topics: logs[0].topics, - }), + }) ).toEqual({ eventName: 'ExampleEvent', args: { @@ -253,7 +230,7 @@ Deno.test('logs', opts, async () => { // execute the tx that create a child contract and record the return data size -> // when we read the recoreded data size it should be 0 // traces should look the same as geth -> TODO: -Deno.test('returndata works after create', opts, async () => { +Deno.test('returndata_works', opts, async () => { const address = await getReturnDataTesterAddr() const { request } = await env.serverWallet.simulateContract({ address, @@ -262,9 +239,7 @@ Deno.test('returndata works after create', opts, async () => { }) const hash = await env.serverWallet.writeContract(request) - const receipt = await env.serverWallet.waitForTransactionReceipt( - hash, - ) + const receipt = await env.serverWallet.waitForTransactionReceipt(hash) expect(receipt.status).toEqual('success') const dataSize = await env.emptyWallet.readContract({ @@ -277,27 +252,31 @@ Deno.test('returndata works after create', opts, async () => { expect(dataSize).toBe(0n) }) -// eth_call deployment -> should return the runtime code -// deploy the contract -Deno.test('eth_call (deployment) returns runtime bytecode', opts, async () => { - const callData = - '0x6080604052348015600e575f5ffd5b50606f80601a5f395ff3fe6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033' +Deno.test('eth_call returndata works', opts, async () => { + const address = await getReturnDataTesterAddr() + const result = await env.serverWallet.call({ + to: address, + data: encodeFunctionData({ + abi: ReturnDataTesterAbi, + functionName: 'createChildContract', + args: [], + }), + }) - // Use another wallet's raw request to send a direct eth_call while keeping - // the `from` set to the server wallet's address (serverWallet.request blocks raw RPCs). - const from = env.serverWallet.account.address + // TODO assert + console.log(result) +}) - // Type definitions for wallet.request don't include raw eth_call — cast to any to send the raw JSON-RPC. - const result = await (env.emptyWallet as any).request({ - method: 'eth_call', - params: [{ data: callData, from }, 'latest'], +// eth_call deployment -> should return the runtime code +// deploy the contract +Deno.test('eth_call deployment should return the bytecode', opts, async () => { + const result = await env.serverWallet.call({ + data: getByteCode('Errors', env.evm), }) - // Basic assertions: result is a hex string and non-empty - expect(typeof result).toBe('string') - expect((result as string).slice(0, 2)).toBe('0x') - expect((result as string).length).toBeGreaterThan(2) - expect(result).toBe( - '0x6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063dffeadd014602a575b5f5ffd5b60306032565b005b5f620186a0f3fea26469706673582212200544d013174d2b813d5d067b0c93aa13be2d4b08db36a2c4337a1d825449ab3e64736f6c634300081e0033', - ) + if (env.evm) { + expect(result.length).toBeGreaterThan(0) + } else { + expect(result).toBe('0x') + } }) From 177128aabd13e6b6284a93decb3328e75262840c Mon Sep 17 00:00:00 2001 From: Marian Radu Date: Mon, 20 Oct 2025 15:05:59 +0300 Subject: [PATCH 4/9] Fix returndata assertions. --- src/others.test.ts | 52 ++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/others.test.ts b/src/others.test.ts index 94db84c..89c8874 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -227,21 +227,28 @@ Deno.test('logs', opts, async () => { }) }) -// execute the tx that create a child contract and record the return data size -> -// when we read the recoreded data size it should be 0 -// traces should look the same as geth -> TODO: Deno.test('returndata_works', opts, async () => { + if (!env.evm) { + console.warn( + "Skip this test on PVM, as it doesn't support instantiating a child contract whose code is not yet on-chain." + ) + return + } + + // 1. deploy ReturnDataTester contract and get its address const address = await getReturnDataTesterAddr() + + // 2. call createChildContract to create a child contract const { request } = await env.serverWallet.simulateContract({ address, abi: ReturnDataTesterAbi, functionName: 'createChildContract', }) - const hash = await env.serverWallet.writeContract(request) const receipt = await env.serverWallet.waitForTransactionReceipt(hash) expect(receipt.status).toEqual('success') + // 3. call getCapturedReturnDataSize to get the recorded return data size const dataSize = await env.emptyWallet.readContract({ address: address, abi: ReturnDataTesterAbi, @@ -252,31 +259,26 @@ Deno.test('returndata_works', opts, async () => { expect(dataSize).toBe(0n) }) -Deno.test('eth_call returndata works', opts, async () => { - const address = await getReturnDataTesterAddr() - const result = await env.serverWallet.call({ - to: address, - data: encodeFunctionData({ - abi: ReturnDataTesterAbi, - functionName: 'createChildContract', - args: [], - }), - }) - - // TODO assert - console.log(result) -}) - -// eth_call deployment -> should return the runtime code -// deploy the contract -Deno.test('eth_call deployment should return the bytecode', opts, async () => { +Deno.test('eth_call_deployment_returns_bytecode', opts, async () => { const result = await env.serverWallet.call({ data: getByteCode('Errors', env.evm), }) + expect(typeof result).toBe('object') if (env.evm) { - expect(result.length).toBeGreaterThan(0) + expect(result).not.toBeNull() + expect('data' in result).toBe(true) + expect(typeof result.data).toBe('string') + const data = result['data'] + if (typeof data !== 'string') { + throw new Error(`expected result.data to be string, got ${typeof data}`) + } + + // hex string; '0xDDDD...' + expect(data.startsWith('0x')).toBe(true) + expect(data.length).toBeGreaterThan(2) } else { - expect(result).toBe('0x') + //TODO: Is fix required for PVM ? + expect(result).toEqual({}) } -}) +}) \ No newline at end of file From d69f59c533c5ef09837bc888a7ca883db4b67026 Mon Sep 17 00:00:00 2001 From: Marian Radu Date: Mon, 20 Oct 2025 15:11:06 +0300 Subject: [PATCH 5/9] chore: format code (deno fmt) --- src/others.test.ts | 57 +++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/src/others.test.ts b/src/others.test.ts index 89c8874..171d8a5 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -14,25 +14,31 @@ import { ReturnDataTesterAbi } from '../abi/ReturnDataTester.ts' // Initialize test environment const env = await getEnv() -const getErrorTesterAddr = memoizedDeploy(env, () => - env.serverWallet.deployContract({ - abi: ErrorsAbi, - bytecode: getByteCode('Errors', env.evm), - }) +const getErrorTesterAddr = memoizedDeploy( + env, + () => + env.serverWallet.deployContract({ + abi: ErrorsAbi, + bytecode: getByteCode('Errors', env.evm), + }), ) -const getEventExampleAddr = memoizedDeploy(env, () => - env.serverWallet.deployContract({ - abi: EventExampleAbi, - bytecode: getByteCode('EventExample', env.evm), - }) +const getEventExampleAddr = memoizedDeploy( + env, + () => + env.serverWallet.deployContract({ + abi: EventExampleAbi, + bytecode: getByteCode('EventExample', env.evm), + }), ) -const getReturnDataTesterAddr = memoizedDeploy(env, () => - env.serverWallet.deployContract({ - abi: ReturnDataTesterAbi, - bytecode: getByteCode('ReturnDataTester', env.evm), - }) +const getReturnDataTesterAddr = memoizedDeploy( + env, + () => + env.serverWallet.deployContract({ + abi: ReturnDataTesterAbi, + bytecode: getByteCode('ReturnDataTester', env.evm), + }), ) Deno.test('eth_call with insufficient funds', opts, async () => { @@ -110,7 +116,7 @@ Deno.test( expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } - } + }, ) Deno.test('eth_estimate with revert', opts, async () => { @@ -131,7 +137,7 @@ Deno.test('eth_estimate with revert', opts, async () => { 'execution reverted: revert: msg.value does not match value', ]).toContain(lastJsonRpcError?.message) expect(lastJsonRpcError?.data).toBe( - '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e6d73672e76616c756520646f6573206e6f74206d617463682076616c75650000' + '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e6d73672e76616c756520646f6573206e6f74206d617463682076616c75650000', ) } }) @@ -148,7 +154,7 @@ Deno.test( opts, async () => { const balance = await env.serverWallet.getBalance( - env.emptyWallet.account + env.emptyWallet.account, ) expect(balance).toBe(0n) try { @@ -165,7 +171,7 @@ Deno.test( expect(lastJsonRpcError?.message).toContain('insufficient funds') expect(lastJsonRpcError?.data).toBeUndefined() } - } + }, ) Deno.test('eth_estimate with no gas specified', opts, async () => { @@ -207,7 +213,8 @@ Deno.test('logs', opts, async () => { expect(logs).toHaveLength(1) expect(logs[0]).toMatchObject({ address, - data: '0x00000000000000000000000000000000000000000000000000000000000030390000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20776f726c64000000000000000000000000000000000000000000', + data: + '0x00000000000000000000000000000000000000000000000000000000000030390000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20776f726c64000000000000000000000000000000000000000000', transactionHash: hash, }) @@ -216,7 +223,7 @@ Deno.test('logs', opts, async () => { abi: EventExampleAbi, data: logs[0].data, topics: logs[0].topics, - }) + }), ).toEqual({ eventName: 'ExampleEvent', args: { @@ -230,7 +237,7 @@ Deno.test('logs', opts, async () => { Deno.test('returndata_works', opts, async () => { if (!env.evm) { console.warn( - "Skip this test on PVM, as it doesn't support instantiating a child contract whose code is not yet on-chain." + "Skip this test on PVM, as it doesn't support instantiating a child contract whose code is not yet on-chain.", ) return } @@ -271,7 +278,9 @@ Deno.test('eth_call_deployment_returns_bytecode', opts, async () => { expect(typeof result.data).toBe('string') const data = result['data'] if (typeof data !== 'string') { - throw new Error(`expected result.data to be string, got ${typeof data}`) + throw new Error( + `expected result.data to be string, got ${typeof data}`, + ) } // hex string; '0xDDDD...' @@ -281,4 +290,4 @@ Deno.test('eth_call_deployment_returns_bytecode', opts, async () => { //TODO: Is fix required for PVM ? expect(result).toEqual({}) } -}) \ No newline at end of file +}) From e8a4463faddd57e411731fb7112f60bb5ff89d03 Mon Sep 17 00:00:00 2001 From: Marian Radu Date: Mon, 20 Oct 2025 23:02:00 +0300 Subject: [PATCH 6/9] Enable test:returndata_works for pvm. --- abi/ReturnDataTester.json | 52 +-------------------------------- abi/ReturnDataTester.ts | 52 +-------------------------------- contracts/ReturnDataTester.sol | 7 ++--- evm/ReturnDataTester.bin | Bin 971 -> 2213 bytes pvm/ReturnDataTester.polkavm | Bin 5240 -> 3022 bytes src/others.test.ts | 14 ++++----- 6 files changed, 9 insertions(+), 116 deletions(-) diff --git a/abi/ReturnDataTester.json b/abi/ReturnDataTester.json index e3ae580..3b6e538 100644 --- a/abi/ReturnDataTester.json +++ b/abi/ReturnDataTester.json @@ -1,48 +1,11 @@ [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "callStuff", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "createChildContract", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "doStuff", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, { "inputs": [], "name": "getCapturedReturnDataSize", @@ -56,19 +19,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "otherField", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "returndatasize", diff --git a/abi/ReturnDataTester.ts b/abi/ReturnDataTester.ts index 4d46c3d..6fcb1b7 100644 --- a/abi/ReturnDataTester.ts +++ b/abi/ReturnDataTester.ts @@ -1,48 +1,11 @@ export const ReturnDataTesterAbi = [ - { - 'inputs': [], - 'stateMutability': 'nonpayable', - 'type': 'constructor', - }, - { - 'inputs': [], - 'name': 'callStuff', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], - 'stateMutability': 'nonpayable', - 'type': 'function', - }, { 'inputs': [], 'name': 'createChildContract', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], + 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function', }, - { - 'inputs': [], - 'name': 'doStuff', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], - 'stateMutability': 'pure', - 'type': 'function', - }, { 'inputs': [], 'name': 'getCapturedReturnDataSize', @@ -56,19 +19,6 @@ export const ReturnDataTesterAbi = [ 'stateMutability': 'view', 'type': 'function', }, - { - 'inputs': [], - 'name': 'otherField', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], - 'stateMutability': 'view', - 'type': 'function', - }, { 'inputs': [], 'name': 'returndatasize', diff --git a/contracts/ReturnDataTester.sol b/contracts/ReturnDataTester.sol index c30e735..461cccd 100644 --- a/contracts/ReturnDataTester.sol +++ b/contracts/ReturnDataTester.sol @@ -1,16 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; - -// Child contract with dummy state passed through constructor -contract Child { -} +import "./contracts/Errors.sol"; // Parent contract that creates a child and captures return data contract ReturnDataTester { uint public returndatasize; function createChildContract() external { - new Child(); + new Errors(); uint size; assembly { size := returndatasize() diff --git a/evm/ReturnDataTester.bin b/evm/ReturnDataTester.bin index dde0fc983b5a6a135b036b6b48464c080a9b530e..e34722341c972ea45e2e63f6b4b1eb83e6c63efe 100644 GIT binary patch literal 2213 zcmb7E3uqiw6rIo8%@U|KVK+4-mLWv^U}H#|NUbUH7p0(1HtSAhYTvtVwoM@4-K3%c zcV;%JrV^bbrHGisS}|&CwA5k?YSk*(3JS#vZ7imUqBi&;wos&rcV>1bo79AK*@d(3 z-Fxmk_s29=6JDo<*mVk}S5z4SeHw7ZbUmG(VGHgUsanbIQfMWcEY@Ou-#z$IkZn}7 z*sit5&ji_KL`R3tZwfM|s1_HypFI;*Sxp^#biia2Hq-`0b6RCvSt_b>D%-~1cPu&< zSkQ>>T=bdji04WF(n9#uy-GEu8>_A7%Cy>)HL9DB$#N8=6l#TQFU+tkFSypIS(J^ z1%tp{M7VF_@s=R)c?b`T3MB|PApC52=wE~}gqQcXA4S-&AXQY=Vr0*6cMK`6JA4BXU!38IsG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dm=3hyLxEm&D2}`5+uKdMyln>*hCCq&IMTZ?PWl@wx zK^9RaDkOze!}MGR7J&t1z=A~)LO;8ajWCr|*x7i!oV@2mS`f7YnH1Na6Q&UV^omG4`6-PE|Iv-IM&vDqM&vCOjmTRt!^&H!wMMz4LR~sJtEo~> zct2XPzg)2&tl0NgY;nb20*^^>NCOE|Eviq3d65KnV7uU?(oNVV!rp(m1~o>5L7?08 zWgllj65@Zvq3h)I6%LGvqii=-V%m-L1P(^Xvy1=Zaxd6Rh zLg}sueZT$?hYA{;1@cUVW*+}%7)9uR=fnFnU8`v}p$JC#=51K9+HzTZce%~jp2mlL zIGRM{wE*w{V_{M4AXgbA`GNh{Xe@!GO*1q)$L86Kx41IhpsUD7DucG2b#mJ0!*Izeyj<{h^svcT< z-Ka^AeYz&yY(iGim{BCqz95Zt;duB|RleEO)X{P}6qGZb-}&3wvhfYi#*OmKc6s}6 zZ<_IJl%K~(uiPR(pUHSy@2Lj39l_pp6WN`Sa3X@4hAOEg420C9dtE$Jf4hT zcj9Uq7i5oY3VITrSimzi?va0Lgw*-^wD9!tz_ZgzED#8crxn}-fnbLbMD-gxkIe3z z`DxlS)l389lfvsym~b^WzdkkXnd(5hbf9@EnD*GGf|)=llTJqw?Kzu4Y^vd{ZWvVO(}eZgk3l4r9#i9j|ydHg)dw zG&eUoopSS$U^<=l$S&|`vVWxp56@tb+UBO_W<=_lNHfi@j#JadYy<+X%(&p3@+1N- zIm5tPF&cWgGX2vT7Y1vRHv%p4v2 { }) Deno.test('returndata_works', opts, async () => { - if (!env.evm) { - console.warn( - "Skip this test on PVM, as it doesn't support instantiating a child contract whose code is not yet on-chain.", - ) - return - } - // 1. deploy ReturnDataTester contract and get its address const address = await getReturnDataTesterAddr() - // 2. call createChildContract to create a child contract + // 2. Make child contract code available + await getErrorTesterAddr() + + // 3. call createChildContract to create a child contract const { request } = await env.serverWallet.simulateContract({ address, abi: ReturnDataTesterAbi, @@ -255,7 +251,7 @@ Deno.test('returndata_works', opts, async () => { const receipt = await env.serverWallet.waitForTransactionReceipt(hash) expect(receipt.status).toEqual('success') - // 3. call getCapturedReturnDataSize to get the recorded return data size + // 4. call getCapturedReturnDataSize to get the recorded return data size const dataSize = await env.emptyWallet.readContract({ address: address, abi: ReturnDataTesterAbi, From 4b173b0b9882e75b1bcf6784e79519a739343d7a Mon Sep 17 00:00:00 2001 From: Marian Radu Date: Tue, 21 Oct 2025 09:39:11 +0300 Subject: [PATCH 7/9] Adjust eth_call_deployment_returns_bytecode assertion for pvm. --- src/others.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/others.test.ts b/src/others.test.ts index 2302da3..3c63318 100644 --- a/src/others.test.ts +++ b/src/others.test.ts @@ -283,7 +283,7 @@ Deno.test('eth_call_deployment_returns_bytecode', opts, async () => { expect(data.startsWith('0x')).toBe(true) expect(data.length).toBeGreaterThan(2) } else { - //TODO: Is fix required for PVM ? - expect(result).toEqual({}) + // PVM does not return runtime bytecode for contract deployment calls + expect(result.data).toBeUndefined() } }) From eb6813bfe8e0b6589d2dbac38e965b046dc1fbab Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 21 Oct 2025 16:55:22 +0200 Subject: [PATCH 8/9] rm gen files --- README.md | 3 +-- abi/Child.json | 1 - abi/Child.ts | 1 - abi/ReturnDataTester.json | 35 ----------------------------------- abi/ReturnDataTester.ts | 35 ----------------------------------- evm/Child.bin | Bin 88 -> 0 bytes evm/ReturnDataTester.bin | Bin 2213 -> 0 bytes pvm/Child.polkavm | Bin 824 -> 0 bytes pvm/ReturnDataTester.polkavm | Bin 3022 -> 0 bytes 9 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 abi/Child.json delete mode 100644 abi/Child.ts delete mode 100644 abi/ReturnDataTester.json delete mode 100644 abi/ReturnDataTester.ts delete mode 100644 evm/Child.bin delete mode 100644 evm/ReturnDataTester.bin delete mode 100644 pvm/Child.polkavm delete mode 100644 pvm/ReturnDataTester.polkavm diff --git a/README.md b/README.md index 808d270..a5a20c7 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,7 @@ Tests are configured via environment variables: - `START_ETH_RPC=1` - Automatically start revive eth-rpc server - `ETH_RPC_PATH` - Path to the eth-rpc binary (default: to ~/polkadot-sdk/target/debug/eth-rpc) -- `USE_REVIVE=evm|pvm` - Whether to run tests against revive with evm or pvm bytecode, default to `evm` if not specified +- `USE_REVIVE=evm|pvm` - Whether to run tests against revive with evm or pvm bytecode, default to `evm` if not specified - `START_REVIVE_DEV_NODE=1` - Start Revive dev node - `REVIVE_DEV_NODE_PATH` - Path to the Revive dev node binary (default: to ~/polkadot-sdk/target/debug/revive-dev-node) - diff --git a/abi/Child.json b/abi/Child.json deleted file mode 100644 index fe51488..0000000 --- a/abi/Child.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/abi/Child.ts b/abi/Child.ts deleted file mode 100644 index cb39487..0000000 --- a/abi/Child.ts +++ /dev/null @@ -1 +0,0 @@ -export const ChildAbi = [] as const diff --git a/abi/ReturnDataTester.json b/abi/ReturnDataTester.json deleted file mode 100644 index 3b6e538..0000000 --- a/abi/ReturnDataTester.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - { - "inputs": [], - "name": "createChildContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getCapturedReturnDataSize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "returndatasize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/abi/ReturnDataTester.ts b/abi/ReturnDataTester.ts deleted file mode 100644 index 6fcb1b7..0000000 --- a/abi/ReturnDataTester.ts +++ /dev/null @@ -1,35 +0,0 @@ -export const ReturnDataTesterAbi = [ - { - 'inputs': [], - 'name': 'createChildContract', - 'outputs': [], - 'stateMutability': 'nonpayable', - 'type': 'function', - }, - { - 'inputs': [], - 'name': 'getCapturedReturnDataSize', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], - 'stateMutability': 'view', - 'type': 'function', - }, - { - 'inputs': [], - 'name': 'returndatasize', - 'outputs': [ - { - 'internalType': 'uint256', - 'name': '', - 'type': 'uint256', - }, - ], - 'stateMutability': 'view', - 'type': 'function', - }, -] as const diff --git a/evm/Child.bin b/evm/Child.bin deleted file mode 100644 index 44a91d442937ef81731c51e23e52e21336ee4665..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 88 zcmYdjNN@-;X%J1|3y+Wg8y%2f*N`9;ZyEpjUjj%5DE4nrN@hV?afFhP!n12BAKt8g q`G#@J>gcQfSER~+-DBBM)bh%HZBlc&9JgIcaehv+GXsYlgE0Wmy(Y#0 diff --git a/evm/ReturnDataTester.bin b/evm/ReturnDataTester.bin deleted file mode 100644 index e34722341c972ea45e2e63f6b4b1eb83e6c63efe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2213 zcmb7E3uqiw6rIo8%@U|KVK+4-mLWv^U}H#|NUbUH7p0(1HtSAhYTvtVwoM@4-K3%c zcV;%JrV^bbrHGisS}|&CwA5k?YSk*(3JS#vZ7imUqBi&;wos&rcV>1bo79AK*@d(3 z-Fxmk_s29=6JDo<*mVk}S5z4SeHw7ZbUmG(VGHgUsanbIQfMWcEY@Ou-#z$IkZn}7 z*sit5&ji_KL`R3tZwfM|s1_HypFI;*Sxp^#biia2Hq-`0b6RCvSt_b>D%-~1cPu&< zSkQ>>T=bdji04WF(n9#uy-GEu8>_A7%Cy>)HL9DB$#N8=6l#TQFU+tkFSypIS(J^ z1%tp{M7VF_@s=R)c?b`T3MB|PApC52=wE~}gqQcXA4S-&AXQY=Vr0*6cMK`6JA4BXU!38IsGr&hpU&xlqf>bwbju66qrCRljbW#Nl6Ec{I%3_2`)#X=VA zZG5e333H5F(30GOjH2K%wz_stfp}wvvB$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+K{Xe}54@aQ)8%s%PK&$$BTPdyY#=%Km%`8h}oQxH5sNHM$!q!ZHYtWZd>;IzOK zFR!dMgZ9@uSpzgj1!0xEm0AVV1Z);{%|f~c`OzRhS_Uu&xCnr{9G!x@%ZLR!B}UPX zb$u^OA@Ad9%o*WBlxN|`jlW8GjwT0^^PuwEl010@^tut4IBH*qSq-C&ED&K^H0CQS zy(9Bg4k6FFl$UgTJx-`&Neix?=sKvlYS&jG3Rrfn>Y;0p>Z^byz#^1h41@qg?#a{& z55%CfI8E?iD+@L<8exj&$Y_D8EC9d0Up#!fe6!k*5iMOUbZAL;jSSL0xxX>~5XK1- zxxNCuk{~;Ox58&x9p$r_)v0_ILeuyR#2Ddk@=45se3Gyr<`a|!$WAfT)NsC~SsxGo z-~as$+s}o!Z`Y^y>U;n9*75Lm{Q!Ka=?(gU@$qnj&WZ2j$7i1oH;sq$Z=4SIfSq=( z$$fG<-&A-uoR7QnI5a#h6IuRIuGtrgH^t-U!aDH4a#Jp+oh9Hcmus%q#pZA(+!GJW zp4XbglMd0nZ`8a!{aSavX2+&nF4rB8hx1?^A8ro&z6Jw0@XY?E^YJ*6N5bR7 Date: Tue, 21 Oct 2025 17:06:43 +0200 Subject: [PATCH 9/9] increase timeout --- src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 50de3dc..6957f93 100644 --- a/src/util.ts +++ b/src/util.ts @@ -340,7 +340,7 @@ export function waitForHealth(url: string) { resolve() } catch (_err) { const elapsed = Date.now() - start - if (elapsed > 30_000) { + if (elapsed > 60_000) { clearInterval(interval) reject(new Error('hit timeout')) }