tokenbridge/monitor/utils/contract.js
Przemyslaw Rzad c865198290
Common Validator utils (#181)
* 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
2019-08-08 15:27:09 +02:00

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
}