Skip to content

Commit

Permalink
fix: return commented validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko committed Apr 18, 2024
1 parent 6f1cd71 commit c903dac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/middlewares/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ export default class Middleware {
if(!triggerPath || !triggerValue || !txHash) {
throw new Error("Not from blockchain");
}
// NOTE(yoojin): Validation will changed. Temp comment out.
// const result = await this.ain.getValue(triggerPath);
const result = await this.ain.getValue(triggerPath);

// If request is first reque st, set cache
// If request is first request, set cache
if (this.cache.get(txHash) && this.cache.get(txHash) !== "error") {
res.send("Duplicated");
return;
}
this.cache.set(txHash, "in_progress", 500);
// NOTE(yoojin): Validation will changed. Temp comment out.
// _.isEqual(result, triggerValue) ? next(): res.send("Not from blockchain");
next();
_.isEqual(result, triggerValue) ? next(): res.send("Not from blockchain");
} catch (e) {
console.log("Filtering Error ", e)
res.send(e);
Expand Down

0 comments on commit c903dac

Please sign in to comment.