Skip to content

Commit

Permalink
Merge pull request #31 from ArslanKibria98/develop
Browse files Browse the repository at this point in the history
Salt modification for chain process
  • Loading branch information
zikriya committed Jan 9, 2024
2 parents 1f35b38 + a9cc16a commit 0efc42f
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/services/signature.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,43 @@ export const isRecoverAddressValid = (
export const getDataForSalt = (
isForValidation: boolean,
txData: any,
generatorHash: string
generatorHash: string,
decodedData: any
): string => {
try {
if (isForValidation) {
return txData.transactionHash.toLocaleLowerCase();
return (
txData.transactionHash.toLocaleLowerCase() +
getDecodedLogsDataIntoString(decodedData)
);
} else {
return txData.transactionHash.toLocaleLowerCase() + generatorHash;
return (
txData.transactionHash.toLocaleLowerCase() +
getDecodedLogsDataIntoString(decodedData) +
generatorHash
);
}
} catch (e) {
console.log(e);
}
return "";
};

const getDecodedLogsDataIntoString = (decodedData: any): string => {
try {
return (
decodedData?.sourceToken +
decodedData?.targetToken +
decodedData?.sourceChainId +
decodedData?.targetChainId +
decodedData?.sourceAmount +
decodedData?.sourceAddress +
decodedData?.targetAddress +
decodedData?.settledAmount +
decodedData?.withdrawalData
);
} catch (e) {
console.log(e);
}
return "";
};

0 comments on commit 0efc42f

Please sign in to comment.