Skip to content

Commit 393e7dc

Browse files
chore: remove unnecessary & expensive entity check
1 parent 6b60597 commit 393e7dc

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/mappings/mappingHandlers.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,10 @@ async function saveNativeBalanceEvent(id: string, address: string, amount: BigIn
463463
}
464464

465465
async function saveNativeFeesEvent(event: CosmosEvent) {
466-
let balanceChangeEvent = await NativeBalanceChange.get(`${event.tx.hash}-fee`)
467-
if (typeof(balanceChangeEvent) === "undefined") {
468-
const transaction = await Transaction.get(event.tx.hash);
469-
const fees = transaction.fees[0], signer = transaction.signerAddress;
470-
const amount = fees.amount, denom = fees.denom;
471-
await saveNativeBalanceEvent(`${event.tx.hash}-fee`, signer, BigInt(0) - BigInt(amount), denom, event);
472-
}
466+
const transaction = await Transaction.get(event.tx.hash);
467+
const fees = transaction.fees[0], signer = transaction.signerAddress;
468+
const amount = fees.amount, denom = fees.denom;
469+
await saveNativeBalanceEvent(`${event.tx.hash}-fee`, signer, BigInt(0) - BigInt(amount), denom, event);
473470
}
474471

475472
export async function handleIBCTransfer(event: CosmosEvent): Promise<void> {

0 commit comments

Comments
 (0)