Skip to content

Commit

Permalink
debuging
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Nov 12, 2024
1 parent f7d886d commit 0ad4174
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/celotool/src/e2e-tests/governance_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ describe('governance tests', () => {
if (myceloAddress === groupAddress) {
return '0x' + generatePrivateKey(mnemonic, AccountType.VALIDATOR_GROUP, 0)
}
// Otherwise, the validator group key is encoded in its name (see 25_elect_validators.ts)
// Otherwise, the validator group key is encoded in its name (see 30_elect_validators.ts)
const name = await accounts.methods.getName(groupAddress).call()
const encryptedKeystore64 = name.split(' ')[1]
const encryptedKeystore = JSON.parse(Buffer.from(encryptedKeystore64, 'base64').toString())
Expand Down Expand Up @@ -515,7 +515,7 @@ describe('governance tests', () => {
assert.equal(validatorSetSize, groupMembership.length)
}
})

// TODO (soloseng) fix test such that it returns expected validators
it('should always return a validator set equal to the signing keys of the group members at the end of the last epoch', async function (this: any) {
this.timeout(0)
for (const blockNumber of blockNumbers) {
Expand All @@ -538,11 +538,13 @@ describe('governance tests', () => {
// Fetch the round robin order if it hasn't already been set for this epoch.
if (roundRobinOrder.length === 0 || blockNumber === lastEpochBlock + 1) {
const validatorSet = await getValidatorSetSignersAtBlock(blockNumber)
console.log(`### validatorSet: ${validatorSet}`)
roundRobinOrder = await Promise.all(
validatorSet.map(
async (_, i) => (await web3.eth.getBlock(lastEpochBlock + i + 1)).miner
)
)
console.log(`### roundRobinOrder: ${roundRobinOrder}`)
assert.sameMembers(roundRobinOrder, validatorSet)
}
const indexInEpoch = blockNumber - lastEpochBlock - 1
Expand Down

0 comments on commit 0ad4174

Please sign in to comment.