Skip to content

Commit

Permalink
Correct texts
Browse files Browse the repository at this point in the history
Co-authored-by: mfw78 <53399572+mfw78@users.noreply.github.com>
  • Loading branch information
anxolin and mfw78 authored Aug 16, 2023
1 parent d0033f9 commit 949e145
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions actions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ const logWithLimit =
// sendSlack(message);
// }

// // Used to debug the Tender log Limit issues
// // Used to debug the Tenderly log Limit issues
// consoleOriginal[level](
// prefix + "TEST for bigLogText of " + bigLogText.length + " bytes"
// );
}
};

// Override the log function since some internal libraries might print somnething and breaks Tendrly
// Override the log function since some internal libraries might print something and breaks Tenderly

console.warn = logWithLimit("warn");
console.error = logWithLimit("error");
Expand Down
16 changes: 8 additions & 8 deletions actions/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const checkForSettlement: ActionFn = async (
};

/**
* Asyncronous version of checkForSettlement. It will process all the settlements, and will throw an error at the end if there was at least one error
* Asynchronous version of checkForSettlement. It will process all the settlements, and will throw an error at the end if there was at least one error
*/
const _checkForSettlement: ActionFn = async (
context: Context,
Expand Down Expand Up @@ -316,7 +316,7 @@ function getOrderUid(network: string, orderToSubmit: Order, owner: string) {
*/
export const printUnfilledOrders = (orders: Map<BytesLike, OrderStatus>) => {
const unfilledOrders = Array.from(orders.entries())
.filter(([_orderUid, status]) => status === OrderStatus.SUBMITTED)
.filter(([_orderUid, status]) => status === OrderStatus.SUBMITTED) // as SUBMITTED != FILLED
.map(([orderUid, _status]) => orderUid)
.join(", ");

Expand Down Expand Up @@ -375,14 +375,14 @@ async function placeOrder(
if (error.response) {
const { status, data } = error.response;

const { shouldThow } = handleOrderBookError(status, data);
const { shouldThrow } = handleOrderBookError(status, data);

// The request was made and the server responded with a status code
// that falls out of the range of 2xx
const log = console[shouldThow ? "error" : "warn"];
const log = console[shouldThrow ? "error" : "warn"];
log(`${errorMessage}. Result: ${status}`, data);

if (!shouldThow) {
if (!shouldThrow) {
log("All good! continuing with warnings...");
return;
}
Expand Down Expand Up @@ -468,11 +468,11 @@ class ChainContext {
return new ChainContext(provider, apiUrl(network));
}
}
function handleOrderBookError(status: any, data: any): { shouldThow: boolean } {
function handleOrderBookError(status: any, data: any): { shouldThrow: boolean } {
if (status === 400 && data?.errorType === "DuplicatedOrder") {
// The order is in the OrderBook, all good :)
return { shouldThow: false };
return { shouldThrow: false };
}

return { shouldThow: true };
return { shouldThrow: true };
}

0 comments on commit 949e145

Please sign in to comment.