From a5cdf566755ab1294566f8d8f57e397efd24fb65 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 20 Jan 2025 13:41:14 +0300 Subject: [PATCH] fixes for state overrides --- tests/tenderly-simulation.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/tenderly-simulation.ts b/tests/tenderly-simulation.ts index 8c851c4bd..26e7ddb1f 100644 --- a/tests/tenderly-simulation.ts +++ b/tests/tenderly-simulation.ts @@ -234,22 +234,22 @@ export class TenderlySimulation implements TransactionSimulator { ) { const testNetRPC = new StaticJsonRpcProvider(this.rpcURL); - await Promise.all( - Object.keys(stateOverridesParams).map(address => { - const storage = stateOverridesParams[address].storage; - Object.keys(storage).map(async slot => { - const txHash = await testNetRPC!.send('tenderly_setStorageAt', [ - address, - slot, - storage[slot], - ]); - - const transaction = await testNetRPC!.waitForTransaction(txHash); - if (!transaction.status) { - console.log(`Transaction failed: ${txHash}`); - } - }); - }), - ); + // need to execute promises sequentially here + for await (const addr of Object.keys(stateOverridesParams)) { + const storage = stateOverridesParams[addr].storage; + + for await (const slot of Object.keys(storage)) { + const txHash = await testNetRPC!.send('tenderly_setStorageAt', [ + addr, + slot, + storage[slot], + ]); + + const transaction = await testNetRPC!.waitForTransaction(txHash); + if (!transaction.status) { + console.log(`Transaction failed: ${txHash}`); + } + } + } } }