From 477430e6314c86bea558a8886a788bcbfceccc62 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 3 Jun 2016 19:00:10 +0100 Subject: [PATCH] Move BN define to the proper place in udapp --- src/universal-dapp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index cec7149ac0..994142261f 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -4,6 +4,7 @@ var ethJSUtil = require('ethereumjs-util'); var EthJSTX = require('ethereumjs-tx'); var ethJSABI = require('ethereumjs-abi'); var EthJSBlock = require('ethereumjs-block'); +var BN = ethJSUtil.BN; function UniversalDApp (contracts, options) { this.options = options || {}; @@ -22,7 +23,6 @@ function UniversalDApp (contracts, options) { this.accounts = {}; - this.BN = ethJSUtil.BN; this.vm = new EthJSVM(null, null, { activatePrecompiles: true }); this.addAccount('3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'); @@ -76,7 +76,7 @@ UniversalDApp.prototype.getBalance = function (address, cb) { if (err) { cb('Account not found'); } else { - cb(null, new ethJSUtil.BN(res).toString(10)); + cb(null, new BN(res).toString(10)); } }); } @@ -637,7 +637,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) { gasPrice: 1, gasLimit: 3000000000, // plenty to: to, - value: new this.BN(value, 10), + value: new BN(value, 10), data: new Buffer(data.slice(2), 'hex') }); tx.sign(account.privateKey);