Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Nov 6, 2024
1 parent 6058195 commit 02942a2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/modes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,25 @@ export async function findOpp({
);
}
if (
(allResults[0] as any)?.reason !== undefined &&
"value" in (allResults[0] as any).reason &&
(allResults[0] as any)?.reason?.value !== undefined &&
"noneNodeError" in (allResults[0] as any).reason.value
) {
result.noneNodeError = (allResults[0] as any).reason.value.noneNodeError;
} else if (
result.noneNodeError === undefined &&
(allResults[1] as any)?.reason !== undefined &&
"value" in (allResults[1] as any).reason &&
(allResults[1] as any)?.reason?.value !== undefined &&
"noneNodeError" in (allResults[1] as any).reason.value
) {
result.noneNodeError = (allResults[1] as any).reason.value.noneNodeError;
} else if (
result.noneNodeError === undefined &&
(allResults[2] as any)?.reason !== undefined &&
"value" in (allResults[2] as any).reason &&
(allResults[2] as any)?.reason?.value !== undefined &&
"noneNodeError" in (allResults[2] as any).reason.value
) {
result.noneNodeError = (allResults[2] as any).reason.value.noneNodeError;
Expand Down
5 changes: 4 additions & 1 deletion src/processOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,10 @@ export async function processPair(args: {
for (const attrKey in e.spanAttributes) {
spanAttributes["details." + attrKey] = e.spanAttributes[attrKey];
}
result.error = e?.noneNodeError;
if (e?.noneNodeError) {
spanAttributes["details.noneNoneError"] = true;
result.error = e.noneNodeError;
}
result.report = {
status: ProcessPairReportStatus.NoOpportunity,
tokenPair: pair,
Expand Down
5 changes: 4 additions & 1 deletion test/mode-interOrderbook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ describe("Test inter-orderbook dryrun", async function () {
assert.fail("expected to reject, but resolved");
} catch (error) {
const expected = {
value: undefined,
value: {
estimatedProfit: ethers.constants.Zero,
noneNodeError: `\nReason: ${ethers.errors.UNPREDICTABLE_GAS_LIMIT}`,
},
reason: undefined,
spanAttributes: {
maxInput: vaultBalance.toString(),
Expand Down
5 changes: 4 additions & 1 deletion test/mode-intraOrderbook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ describe("Test intra-orderbook dryrun", async function () {
assert.fail("expected to reject, but resolved");
} catch (error) {
const expected = {
value: undefined,
value: {
estimatedProfit: ethers.constants.Zero,
noneNodeError: `\nReason: ${ethers.errors.UNPREDICTABLE_GAS_LIMIT}`,
},
reason: undefined,
spanAttributes: {
blockNumber: oppBlockNumber,
Expand Down
5 changes: 4 additions & 1 deletion test/mode-routeProcessor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ describe("Test route processor dryrun", async function () {
from: signer.account.address,
};
const expected = {
value: undefined,
value: {
estimatedProfit: ethers.constants.Zero,
noneNodeError: `\nReason: ${ethers.errors.UNPREDICTABLE_GAS_LIMIT}`,
},
reason: RouteProcessorDryrunHaltReason.NoOpportunity,
spanAttributes: {
marketPrice: formatUnits(getCurrentPrice(vaultBalance)),
Expand Down

0 comments on commit 02942a2

Please sign in to comment.