Add check for amount to be returned
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m33s

This commit is contained in:
IshaVenikar 2024-10-29 14:34:08 +05:30
parent c6162cd036
commit 5b7f638caf
2 changed files with 9 additions and 5 deletions

View File

@ -324,7 +324,9 @@ export class Registry {
paymentAddress: auctionWinner, paymentAddress: auctionWinner,
}); });
const newRecords = records.filter(record => record.names !== null); const newRecords = records.filter(record => {
return record.names !== null && record.names.length > 0;
});
for (const record of newRecords) { for (const record of newRecords) {
if (record.id) { if (record.id) {

View File

@ -1391,10 +1391,12 @@ export class Service {
amountToBeReturned = totalAuctionPrice; amountToBeReturned = totalAuctionPrice;
} }
await this.laconicRegistry.sendTokensToAccount( if (amountToBeReturned !== 0) {
project.paymentAddress, await this.laconicRegistry.sendTokensToAccount(
amountToBeReturned.toString() project.paymentAddress,
); amountToBeReturned.toString()
);
}
} }
async getDeployers(): Promise<Deployer[]> { async getDeployers(): Promise<Deployer[]> {