Skip to content

Commit c902143

Browse files
committed
Update contract.service.ts
1 parent 18c6eb3 commit c902143

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

backend/src/modules/smartcontract/services/contract.service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ export class ContractService {
215215

216216
const balance = await this.getWalletBalance(walletAddress);
217217

218+
console.log(`Wallet: ${walletAddress}, Balance: `, balance)
219+
218220
if (balance < this.faucetAmount) {
219221
const amountToSend = this.faucetAmount - balance;
220222

@@ -242,12 +244,14 @@ export class ContractService {
242244
}
243245

244246
return `Success: Topped up ${amountToSend} FDS to ${walletAddress}.`;
247+
} else {
248+
throw new GeneralException(
249+
ErrorTypeEnum.INTERNAL_SERVER_ERROR,
250+
`already has a balance of ${this.faucetAmount} FDS or more.`,
251+
);
245252
}
246253

247-
throw new GeneralException(
248-
ErrorTypeEnum.INTERNAL_SERVER_ERROR,
249-
`already has a balance of ${this.faucetAmount} FDS or more.`,
250-
);
254+
251255
}
252256

253257
async shareDevice(

0 commit comments

Comments
 (0)