Skip to content

Commit 2a4459b

Browse files
committed
Log operator balance
Signed-off-by: Luis Mastrangelo <[email protected]>
1 parent 37a1aca commit 2a4459b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/relay/src/lib/relay.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,14 @@ export class Relay {
331331
}
332332

333333
async ensureOperatorHasBalance() {
334-
if (!ConfigService.get('READ_ONLY')) {
335-
const operator = this.clientMain.operatorAccountId!.toString();
336-
const balance = await this.ethImpl.getBalance(operator, 'latest', {} as RequestDetails);
337-
if (BigInt(balance) === BigInt(0)) {
338-
throw new Error(`Operator account \`${operator}\` has no balance`);
339-
}
334+
if (ConfigService.get('READ_ONLY')) return;
335+
336+
const operator = this.clientMain.operatorAccountId!.toString();
337+
const balance = BigInt(await this.ethImpl.getBalance(operator, 'latest', {} as RequestDetails));
338+
if (balance === BigInt(0)) {
339+
throw new Error(`Operator account \`${operator}\` has no balance`);
340+
} else {
341+
this.logger.info(`Operator account \`${operator}\` has balance: ${balance}`);
340342
}
341343
}
342344
}

0 commit comments

Comments
 (0)