Skip to content

Commit 1ef2a60

Browse files
committed
address comments
Signed-off-by: georgi-l95 <[email protected]>
1 parent f6361cd commit 1ef2a60

File tree

3 files changed

+35
-913
lines changed

3 files changed

+35
-913
lines changed

packages/relay/src/lib/eth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,10 @@ export class EthImpl implements Eth {
326326
async estimateGas(transaction: any, _blockParam: string | null, requestId?: string) {
327327
const requestIdPrefix = formatRequestIdMessage(requestId);
328328
this.logger.trace(`${requestIdPrefix} estimateGas(transaction=${JSON.stringify(transaction)}, _blockParam=${_blockParam})`);
329+
//this checks whether this is a transfer transaction and not a contract function execution
329330
if (!transaction || !transaction.data || transaction.data === '0x') {
330331
const toAccount = await this.mirrorNodeClient.getAccount(transaction.to);
332+
// when account exists return default base gas, otherwise return the minimum amount of gas to create an account entity
331333
return toAccount ? EthImpl.gasTxBaseCost : EthImpl.gasTxHollowAccountCreation;
332334
} else {
333335
return EthImpl.defaultGas;

0 commit comments

Comments
 (0)