Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Jan 2, 2024
1 parent ecff3f6 commit 0c4df9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/engine/paima-funnel/src/funnels/carp/funnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,16 @@ export class CarpFunnel extends BaseFunnel implements ChainFunnel {
const prevEpoch = this.cache.getState().epoch;

if (!prevEpoch || epoch !== prevEpoch) {
data.internalEvents?.push({
data.internalEvents.push({
type: InternalEventType.CardanoBestEpoch,
epoch: epoch,
});
}

this.cache.updateEpoch(epoch);
// The execution of the event that we just pushed should set the
// `cardano_last_epoch` table to `epoch`. This cache entry mirrors the
// value of that table, so we need to update it here too.
this.cache.updateEpoch(epoch);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ export async function internalGetAllOwnedErc6551Accounts(
return results.map(row => row.account_created);
}

/**
* If the most recent delegation is the current epoch, we need to return the
* list of recent delegations so the app can know what delegation the user had
* beforehand since delegations only matters once they cross an epoch boundary
*
* If the most recent delegation isn't from the current epoch, we know it's the
* one that is active now
*/
export async function internalGetCardanoAddressDelegation(
readonlyDBConn: Pool,
address: string
Expand Down

0 comments on commit 0c4df9c

Please sign in to comment.