Skip to content

Commit

Permalink
Merge pull request #373 from zikriya/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zikriya authored Feb 15, 2024
2 parents ff75997 + 702fe32 commit 239bcd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function (router: any) {
let destinationNetwork = null;
let transactionStatusForSupport = "";
let resopnseMessage = stringHelper.strSuccess;
let onChianStatus = "";
let onChainStatus = "";
sourceNetwork = await db.Networks.findOne({
chainId: req?.query?.chainId,
});
Expand All @@ -50,7 +50,7 @@ module.exports = function (router: any) {
sourceNetwork.rpcUrl
);
if (receipt && receipt?.status != null && receipt?.status == true) {
onChianStatus = stringHelper.strSuccess;
onChainStatus = stringHelper.strSuccess.toLowerCase();
let decodedDtata: any = await swapTransactionHelper.getDecodedData(
receipt.logs,
sourceNetwork.rpcUrl
Expand All @@ -74,15 +74,17 @@ module.exports = function (router: any) {
);
resopnseMessage = response?.message;
transactionStatusForSupport = response?.status;
onChianStatus = response?.onChianStatus;
onChainStatus = response?.onChainStatus;
}
await swapTransactionHelper.sendSlackNotifcationForRegenerate(
req.params.txId,
onChianStatus,
onChainStatus,
transactionStatusForSupport
);
return res.http200({
message: resopnseMessage,
onChainStatus: onChainStatus,
systemStatus: transactionStatusForSupport,
});
})
);
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/multiSwapHelpers/swapTransactionHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ module.exports = {
},

async hanldeTransactionFailedForRegenerate(receipt: any) {
let response = { message: "", status: "", onChianStatus: "pending" };
let response = { message: "", status: "", onChainStatus: "pending" };
if (receipt == null) {
response.message = await commonFunctions.getValueFromStringsPhrase(
stringHelper.transactionFailedMessageOne
);
} else if (receipt?.status == false) {
response.onChianStatus = "failed";
response.onChainStatus = "failed";
response.message = await commonFunctions.getValueFromStringsPhrase(
stringHelper.swapFailedMessage
);
Expand Down Expand Up @@ -281,10 +281,10 @@ module.exports = {

async sendSlackNotifcationForRegenerate(
swapHash: string,
onChianStatus: string,
onChainStatus: string,
transactionStatusForSupport: string
) {
let text = `swapHash: ${swapHash}\nonChianStatus: ${onChianStatus}\nsystemPreviousStatus: ${transactionStatusForSupport}\nsystemCurrentStatus: ${transactionStatusForSupport}\n========================`;
let text = `swapHash: ${swapHash}\nonChainStatus: ${onChainStatus}\nsystemPreviousStatus: ${transactionStatusForSupport}\nsystemCurrentStatus: ${transactionStatusForSupport}\n========================`;
await postMultiswapAlertIntoChannel({
text: text,
});
Expand Down

0 comments on commit 239bcd8

Please sign in to comment.