tokenbridge/monitor/utils/contract.js

12 lines
286 B
JavaScript
Raw Normal View History

2019-05-08 16:12:02 +03:00
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
}