Skip to content

Commit

Permalink
common: post rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Jun 13, 2023
1 parent 175d4eb commit f9a47ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ describe('Allocation Manager', () => {
// @ts-ignore: Mocking the Action type for this test
const actions = [queuedAllocateAction, unallocateAction, reallocateAction] as Action[]

test('resolveActionDelta() correctly calculates token balances for array of actions', async () => {
const mapper = (x: Action) => allocationManager.resolveActionDelta(x)
const balances = await Promise.all(actions.map(mapper))
test('stakeUsageSummary() correctly calculates token balances for array of actions', async () => {
const balances = await Promise.all(
actions.map((action: Action) => allocationManager.stakeUsageSummary(action)),
)

const allocate = balances[0]
const unallocate = balances[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,9 @@ export class AllocationManager {
logger.debug(`Validating action batch`, { size: batch.length })

// Validate stake feasibility
const indexerFreeStake = await this.contracts.staking.getIndexerCapacity(this.indexer)
const indexerFreeStake = await this.network.contracts.staking.getIndexerCapacity(
this.network.specification.indexerOptions.address,
)
const actionsBatchStakeusageSummaries = await pMap(batch, async (action: Action) =>
this.stakeUsageSummary(action),
)
Expand Down

0 comments on commit f9a47ab

Please sign in to comment.