Skip to content

Commit

Permalink
chore: clean up logs
Browse files Browse the repository at this point in the history
  • Loading branch information
xlassix committed Sep 25, 2024
1 parent 3aa79f2 commit db92fe1
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions orchestrator/src/indexer/rooch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,22 @@ export default class RoochIndexer {

log.debug(JSON.stringify({ execution_info: receipt.execution_info }));

if ((data.notify?.value?.vec?.at(0)?.length ?? 0) > 66) {
const tx = new Transaction();
tx.callFunction({
target: decodeNotifyValue(data.notify?.value?.vec?.at(0) ?? ""),
});
try {
if ((data.notify?.value?.vec?.at(0)?.length ?? 0) > 66) {
const tx = new Transaction();
tx.callFunction({
target: decodeNotifyValue(data.notify?.value?.vec?.at(0) ?? ""),
});

const receipt = await client.signAndExecuteTransaction({
transaction: tx,
signer: this.keyPair,
});
const receipt = await client.signAndExecuteTransaction({
transaction: tx,
signer: this.keyPair,
});

// log.debug(receipt.execution_info);
log.debug(JSON.stringify(receipt));
}
} catch (err) {
log.error(err);
}
return receipt;
}
Expand Down Expand Up @@ -160,19 +164,21 @@ export default class RoochIndexer {
});
}

log.debug({ responseData: request.data });
log.debug(JSON.stringify({ responseData: request.data }));
try {
const result = await run(data.pick, JSON.stringify(request.data), { input: "string" });
log.debug({ result });
log.debug(JSON.stringify({ result }));
return { status: request.status, message: result };
} catch {
return { status: 409, message: "`Pick` value provided could not be resolved on the returned response" };
}
// return { status: request.status, message: result };
} catch (error: any) {
log.debug({
error: error.message,
});
log.debug(
JSON.stringify({
error: error.message,
}),
);

if (axios.isAxiosError(error)) {
// Handle Axios-specific errors
Expand Down Expand Up @@ -235,7 +241,7 @@ export default class RoochIndexer {
},
});
} catch (err) {
log.error(err);
log.error(JSON.stringify({ err }));
await prismaClient.events.create({
data: {
eventHandleId: event.event_id.event_handle_id,
Expand Down

0 comments on commit db92fe1

Please sign in to comment.