|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
const Web3 = require('web3') |
|
|
|
|
const { privateToAddress, toChecksumAddress } = require('ethereumjs-util') |
|
|
|
|
const { BN, privateToAddress, toChecksumAddress, isValidPrivate, stripHexPrefix } = require('ethereumjs-util') |
|
|
|
|
const crypto = require('crypto') |
|
|
|
|
|
|
|
|
|
class VMProvider { |
|
|
|
|
|
|
|
|
@ -43,7 +44,7 @@ class VMProvider { |
|
|
|
|
this.accounts[toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
createVMAccount (passwordPromptCb, cb) { |
|
|
|
|
createVMAccount (newAccount) { |
|
|
|
|
const { privateKey, balance } = newAccount |
|
|
|
|
this._addAccount(privateKey, balance) |
|
|
|
|
const privKey = Buffer.from(privateKey, 'hex') |
|
|
|
|