c865198290
* Extracted parseValidatorEvent to commons * Extracted processValidatorsEvents to commons * Extracted validatorList to commons. * refactorings * Fixed imports, lint * UI using getValidatorList * Monitor using getValidatorList from commons * Lint * UI using properly getPastEvents * Default options * Final changes * Corrected invocation of getPastEvents * Correct usage of options in getPastEvents * Changed expected message from infura * Change usage of fromBlock and toBlock * Default parameters
12 lines
286 B
JavaScript
12 lines
286 B
JavaScript
const { toBN } = require('web3').utils
|
|
|
|
const getBlockNumberCall = web3 => web3.eth.getBlockNumber()
|
|
|
|
async function getBlockNumber(web3Home, web3Foreign) {
|
|
return (await Promise.all([web3Home, web3Foreign].map(getBlockNumberCall))).map(toBN)
|
|
}
|
|
|
|
module.exports = {
|
|
getBlockNumber
|
|
}
|