Skip to content
Snippets Groups Projects

add balance to accounts

Open poka requested to merge account-balance into main
Compare and Show latest version
1 file
+ 1
7
Compare changes
  • Side-by-side
  • Inline
+ 1
7
@@ -557,7 +557,7 @@ export class DataHandler {
// Distribute UD to each member
for (const identity of memberIdentities) {
await this.handleUniversalDividend(ctx, await ctx.store.getOrFail(Event, event.id), identity, BigInt(amount));
await this.updateAccountBalance(ctx, identity.account!.id, amount); // we are sure that a non-removed identity has non-null account
}
this.data.universalDividend.push(new UniversalDividend({
@@ -755,10 +755,4 @@ export class DataHandler {
account.balance = (account.balance || 0n) + amount;
this.data.accounts.set(accountId, account);
}
async handleUniversalDividend(ctx: Ctx, event: Event, identity: Identity, amount: bigint): Promise<void> {
if (identity.account) {
await this.updateAccountBalance(ctx, identity.account.id, amount);
}
}
}
Loading