Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Jan 16, 2025
1 parent d65b415 commit 6a38f01
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/modes/interOrderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,20 @@ export async function dryrun({
return Promise.reject(result);
}
}
if (gasLimit.isZero()) {
spanAttributes["stage"] = 2;
spanAttributes["isNodeError"] = true;
spanAttributes["error"] =
"Failed to estimated gas, rpc returned 0 for gasEstimate call without rejection";
spanAttributes["rawtx"] = JSON.stringify(
{
...rawtx,
from: signer.account.address,
},
withBigintSerializer,
);
return Promise.reject(result);
}
rawtx.gas = gasLimit.toBigInt();

// if reached here, it means there was a success and found opp
Expand Down
14 changes: 14 additions & 0 deletions src/modes/intraOrderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,20 @@ export async function dryrun({
return Promise.reject(result);
}
}
if (gasLimit.isZero()) {
spanAttributes["stage"] = 2;
spanAttributes["isNodeError"] = true;
spanAttributes["error"] =
"Failed to estimated gas, rpc returned 0 for gasEstimate call without rejection";
spanAttributes["rawtx"] = JSON.stringify(
{
...rawtx,
from: signer.account.address,
},
withBigintSerializer,
);
return Promise.reject(result);
}
rawtx.gas = gasLimit.toBigInt();

// if reached here, it means there was a success and found opp
Expand Down
15 changes: 15 additions & 0 deletions src/modes/routeProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@ export async function dryrun({
return Promise.reject(result);
}
}
if (gasLimit.isZero()) {
spanAttributes["stage"] = 2;
spanAttributes["isNodeError"] = true;
spanAttributes["error"] =
"Failed to estimated gas, rpc returned 0 for gasEstimate call without rejection";
spanAttributes["rawtx"] = JSON.stringify(
{
...rawtx,
from: signer.account.address,
},
withBigintSerializer,
);
result.reason = RouteProcessorDryrunHaltReason.NoOpportunity;
return Promise.reject(result);
}
rawtx.gas = gasLimit.toBigInt();

// if reached here, it means there was a success and found opp
Expand Down

0 comments on commit 6a38f01

Please sign in to comment.