Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #373

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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