Skip to content

Commit

Permalink
refactor: fetch severity enum from tenderly storage
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchainguyy committed Nov 10, 2023
1 parent 0ea149d commit 401742f
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ const {
utils: { toUtf8Bytes },
} = ethers;
const PAGER_DUTY_ALERT_URL = 'https://events.pagerduty.com/v2/enqueue';
const Severity = {
INFO: 'info',
CRITICAL: 'critical',
WARNING: 'warning',
};

const handleFailedTxFn = async (context, event) => {
if (!event || !context || !context.metadata) {
Expand Down Expand Up @@ -116,6 +111,8 @@ const handleFailedTxFn = async (context, event) => {
console.log('No Error match found');
}

const Severity = await context.storage.getJson('Severity');

if (warningOptions.length !== 0) {
await sendWarning(event, context, chainName, ...warningOptions, Severity.INFO);
}
Expand Down

0 comments on commit 401742f

Please sign in to comment.