Skip to content

Commit

Permalink
Merge pull request #21 from 0xPolygon/gas-estimate
Browse files Browse the repository at this point in the history
fix: slack message
  • Loading branch information
nitinmittal23 authored Jul 5, 2024
2 parents 50aa781 + ffd2c7a commit 8cc824f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 62 deletions.
5 changes: 2 additions & 3 deletions src/services/auto-claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ export default class AutoClaimService {
if (
this.slackNotify &&
failedTx[transaction.counter] &&
(failedTx[transaction.counter] - 1) % 10 === 0 &&
failedTx[transaction.counter] < 100
(failedTx[transaction.counter] - 1) % 25 === 0 &&
failedTx[transaction.counter] <= 51
) {
await this.slackNotify.notifyAdminForError({
network: this.network,
claimType: transaction.dataType as string,
bridgeTxHash: transaction.transactionHash as string,
sourceNetwork: transaction.sourceNetwork,
Expand Down
53 changes: 8 additions & 45 deletions src/services/slack-notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,21 @@ export default class SlackNotify {
async notifyAdminForError(params: INotifyParams) {
await axios.post(this.slackWebhookUrl, {
blocks: [
{
type: "header",
text: {
type: "plain_text",
text: "Claim " + params.claimType + " Details: " + params.sourceNetwork + "-" + params.depositIndex,
}
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*Network:* " + params.network,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*sourceNetwork:* " + params.sourceNetwork,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*bridgeTxHash:* " + params.bridgeTxHash,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*destinationNetwork:* " + params.destinationNetwork,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*depositIndex:* " + params.depositIndex,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: "*Error:* " + params.error,
},
text:
"```SourceNetwork: " + params.sourceNetwork + " \n" +
"BridgeTxHash: " + params.bridgeTxHash + "\n" +
"DestinationNetwork: " + params.destinationNetwork + "\n" +
"DepositIndex: " + params.depositIndex + "\n" +
"Error: " + params.error + "```"
}
},
{
type: "divider"
},
}
],
});
}
Expand Down
26 changes: 13 additions & 13 deletions src/services/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ export default class TransactionService {
}

async getProof(sourceNetwork: number, depositCount: number): Promise<IProof | null> {
Logger.info({
location: 'TransactionService',
function: 'getProof',
call: 'started',
data: {
depositCount
}
})
// Logger.info({
// location: 'TransactionService',
// function: 'getProof',
// call: 'started',
// data: {
// depositCount
// }
// })
let proof: IProof | null = null;
try {
let headers = {};
Expand Down Expand Up @@ -96,11 +96,11 @@ export default class TransactionService {
}
});
}
Logger.info({
location: 'TransactionService',
function: 'getProof',
call: 'completed'
})
// Logger.info({
// location: 'TransactionService',
// function: 'getProof',
// call: 'completed'
// })
return proof;
}
}
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export interface INotifyParams {
network: string
claimType: string
bridgeTxHash: string
sourceNetwork: number
Expand Down

0 comments on commit 8cc824f

Please sign in to comment.