Skip to content

Commit

Permalink
Merge branch 'master' into james/scripting-on-spoke-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris authored Sep 15, 2023
2 parents e2cd0b3 + e37ed76 commit b06a01c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dataworker/PoolRebalanceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ export function updateRunningBalanceForEarlyDeposit(
deposit: typechain.FundsDepositedEvent,
updateAmount: BigNumber
): void {
// deposit.args is a pure array; there are no mapping to be dereferenced.
const originChainId = Number(deposit.args[1].toString());
const originToken = deposit.args[6];

const l1TokenCounterpart = hubPoolClient.getL1TokenCounterpartAtBlock(
Number(deposit.args.originChainId.toString()),
deposit.args.originToken,
originChainId,
originToken,
// TODO: this must be handled s.t. it doesn't depend on when this is run.
// For now, tokens do not change their mappings often, so this will work, but
// to keep the system resilient, this must be updated.
hubPoolClient.latestBlockNumber
);
updateRunningBalance(
runningBalances,
Number(deposit.args.originChainId.toString()),
l1TokenCounterpart,
updateAmount
);

updateRunningBalance(runningBalances, originChainId, l1TokenCounterpart, updateAmount);
}

export function addLastRunningBalance(
Expand Down

0 comments on commit b06a01c

Please sign in to comment.