Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
add continue on failure option to tx sim
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Jun 16, 2023
1 parent 2fce391 commit 0d25bec
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 234 deletions.
13 changes: 9 additions & 4 deletions src/chains/ethereum/ethereum/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type TransactionSimulationArgs<Estimate extends boolean> = {
overrides?: Ethereum.Call.Overrides;
trace?: TraceType;
estimateGas?: Estimate;
continueOnFailure?: boolean;
};

type Log = [address: Address, topics: DATA[], data: DATA];
Expand Down Expand Up @@ -186,7 +187,8 @@ async function simulateTransactions<Estimate extends boolean>(
blockNumber: QUANTITY | Ethereum.Tag,
overrides: Ethereum.Call.Overrides = {},
includeTrace: boolean,
includeGasEstimate: Estimate
includeGasEstimate: Estimate,
continueOnFailure: boolean
): Promise<InternalTransactionSimulationResult<Estimate>[]> {
const blocks = blockchain.blocks;
const parentBlock = await blocks.get(blockNumber);
Expand Down Expand Up @@ -327,7 +329,8 @@ async function simulateTransactions<Estimate extends boolean>(
parentBlock,
overrides,
includeTrace,
includeGasEstimate
includeGasEstimate,
continueOnFailure
);

return results;
Expand Down Expand Up @@ -3066,7 +3069,8 @@ export default class EthereumApi implements Api {
overrides,
transactions,
trace,
estimateGas
estimateGas,
continueOnFailure
}: TransactionSimulationArgs<Estimate>,
blockNumber: QUANTITY | Ethereum.Tag = Tag.latest
): Promise<TransactionSimulationResult<Estimate>[]> {
Expand All @@ -3080,7 +3084,8 @@ export default class EthereumApi implements Api {
overrides,
includeTrace,
//@ts-ignore
estimateGas === true
estimateGas === true,
continueOnFailure === true
);

return simulatedTransactionResults.map(
Expand Down
Loading

0 comments on commit 0d25bec

Please sign in to comment.