Skip to content

Commit

Permalink
feat(namada): validator AsyncGenerator to start from Consensus subset…
Browse files Browse the repository at this point in the history
… first
  • Loading branch information
mradkov committed Sep 3, 2024
1 parent d972feb commit 4559114
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/namada/NamadaPoS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ export async function * fetchValidatorsIter (
connection: NamadaConnection,
options?: { parallel?: boolean }
) {
const namadaAddresses = await fetchValidatorAddresses(connection)

const namadaValidatorsListConsensus = await fetchValidatorsConsensus(connection);
const namadaValidatorsAddresses = await fetchValidatorAddresses(connection)

const validatorsSet = new Set();

for (const validator of namadaValidatorsListConsensus) {
validatorsSet.add(validator.address);
}

for (const address of namadaValidatorsAddresses) {
validatorsSet.add(address);
}

const namadaAddresses = Array.from(validatorsSet);
const tendermintMetadata = (await Staking.getValidators(connection)).reduce((vs, v)=>
Object.assign(vs, {[v.publicKey]: v}), {}) as Record<string, {
address: string
Expand Down

0 comments on commit 4559114

Please sign in to comment.