From 5d9d86d10087060179201aba8bdc5fe42b02ddc5 Mon Sep 17 00:00:00 2001 From: g11tech Date: Tue, 20 Jun 2023 19:36:27 +0530 Subject: [PATCH] feat: add EL sim utility fn to send big raw blob txs (#5661) --- packages/beacon-node/test/utils/runEl.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/beacon-node/test/utils/runEl.ts b/packages/beacon-node/test/utils/runEl.ts index 48aebc305eda..9adf1a83c151 100644 --- a/packages/beacon-node/test/utils/runEl.ts +++ b/packages/beacon-node/test/utils/runEl.ts @@ -9,6 +9,7 @@ import {shell} from "../sim/shell.js"; /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable no-console */ +let txRpcId = 1; export enum ELStartMode { PreMerge = "pre-merge", @@ -219,10 +220,25 @@ export async function sendTransaction(url: string, transaction: Record { + fs.writeFileSync( + dataFilePath, + `{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["${transactionRawHex}"],"id":${txRpcId++}}` + ); + await shell(`curl -d @${dataFilePath} -H "Content-Type: application/json" -X POST ${url}; rm ${dataFilePath}`); +} + export async function getBalance(url: string, account: string): Promise { const response: string = await shell( `curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["${account}","latest"],"id":67}' ${url}`