-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45a6674
commit 2b4196f
Showing
9 changed files
with
141 additions
and
88 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { getMegapoolForNode } from '../_helpers/megapool'; | ||
import assert from 'assert'; | ||
import { RocketDepositPool } from '../_utils/artifacts'; | ||
import { assertBN } from '../_helpers/bn'; | ||
|
||
const milliToWei = 1000000000000000n; | ||
|
||
export async function exitQueue(node, validatorIndex) { | ||
const megapool = await getMegapoolForNode(node); | ||
const rocketDepositPool = await RocketDepositPool.deployed(); | ||
|
||
const validatorInfoBefore = await megapool.getValidatorInfo(validatorIndex); | ||
|
||
// Dequeue the validator | ||
await megapool.dequeue(validatorIndex); | ||
|
||
// Check the validator status | ||
const validatorInfoAfter = await megapool.getValidatorInfo(validatorIndex); | ||
assert.equal(validatorInfoAfter.active, false); | ||
assert.equal(validatorInfoAfter.inQueue, false); | ||
|
||
// Check an ETH credit was applied | ||
const credit = await rocketDepositPool.getNodeCreditBalance(node.address); | ||
assertBN.equal(credit, validatorInfoBefore.lastRequestedBond * milliToWei); | ||
} |