fix: always set new web3 providers despite one being previously set

feat: separate eth wallet names
This commit is contained in:
Sérgio Salgado 2022-06-21 08:30:52 +01:00
parent c94d767f0b
commit 4af07a3609
4 changed files with 12 additions and 10 deletions

View file

@ -11,7 +11,6 @@ const pify = require('pify')
const BN = require('../../../bn')
const ABI = require('../../tokens')
const NAME = 'geth'
exports.SUPPORTED_MODULES = ['wallet']
const paymentPrefixPath = "m/44'/60'/0'/0'"
@ -19,7 +18,6 @@ const defaultPrefixPath = "m/44'/60'/1'/0'"
let lastUsedNonces = {}
module.exports = {
NAME,
balance,
sendCoins,
newAddress,
@ -35,9 +33,7 @@ module.exports = {
}
function connect (url) {
if (!web3.isConnected()) {
web3.setProvider(new web3.providers.HttpProvider(url))
}
return web3.setProvider(new web3.providers.HttpProvider(url))
}
const hex = bigNum => '0x' + bigNum.integerValue(BN.ROUND_DOWN).toString(16)