UNPKG

parsec-node

Version:

https://parseclabs.readthedocs.io/en/latest/

43 lines (40 loc) 907 B
/** * Copyright (c) 2018-present, Parsec Labs (parseclabs.org) * * This source code is licensed under the Mozilla Public License Version 2.0 * found in the LICENSE file in the root directory of this source tree. */ const range = require('./range'); module.exports = async bridge => { const epochLength = await bridge.methods.epochLength().call(); const slots = await Promise.all( range(0, epochLength).map(slotId => bridge.methods.slots(slotId).call()) ); return slots.map( ( { owner, stake, signer, tendermint, activationEpoch, newOwner, newStake, newSigner, newTendermint, }, i ) => ({ id: i, owner, stake, signerAddr: signer, tenderKey: tendermint, activationEpoch, newOwner, newStake, newSigner, newTendermint, }) ); };