From 8503ac88841c83ced98f3f99440b6884f3439fb2 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Thu, 23 Feb 2017 18:26:02 +0100 Subject: [PATCH] moved to BN.js --- bower.json | 3 +-- gulpfile.js | 6 +++--- package-init.js | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index fd2e3cf..78a1f97 100644 --- a/bower.json +++ b/bower.json @@ -8,8 +8,7 @@ "./dist/web3.min.js" ], "dependencies": { - "bignumber.js": ">=2.0.0", - "crypto-js": "~3.1.4" + "bn.js": ">=4.11.6" }, "repository": { "type": "git", diff --git a/gulpfile.js b/gulpfile.js index 10863c3..4230637 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -61,8 +61,8 @@ gulp.task('clean', ['lint'], function(cb) { gulp.task('light', ['clean'], function () { return browserify(browserifyOptions) .require('./' + src + '.js', {expose: 'web3'}) - .ignore('bignumber.js') - .require('./lib/utils/browser-bn.js', {expose: 'bignumber.js'}) // fake bignumber.js + .ignore('bn.js') + .require('./lib/utils/browser-bn.js', {expose: 'bn.js'}) // fake bn.js .add('./' + src + '.js') .bundle() .pipe(exorcist(path.join( DEST, lightDst + '.js.map'))) @@ -76,7 +76,7 @@ gulp.task('light', ['clean'], function () { gulp.task('standalone', ['clean'], function () { return browserify(browserifyOptions) .require('./' + src + '.js', {expose: 'web3'}) - .require('bignumber.js') // expose it to dapp users + .require('bn.js') // expose it to dapp users .add('./' + src + '.js') .ignore('crypto') .bundle() diff --git a/package-init.js b/package-init.js index 92e6a4a..e31cdbf 100644 --- a/package-init.js +++ b/package-init.js @@ -4,14 +4,14 @@ // Browser environment if(typeof window !== 'undefined') { Web3 = (typeof window.Web3 !== 'undefined') ? window.Web3 : require('web3'); - BigNumber = (typeof window.BigNumber !== 'undefined') ? window.BigNumber : require('bignumber.js'); + BigNumber = (typeof window.BigNumber !== 'undefined') ? window.BigNumber : require('bn.js'); } // Node environment if(typeof global !== 'undefined') { Web3 = (typeof global.Web3 !== 'undefined') ? global.Web3 : require('web3'); - BigNumber = (typeof global.BigNumber !== 'undefined') ? global.BigNumber : require('bignumber.js'); + BigNumber = (typeof global.BigNumber !== 'undefined') ? global.BigNumber : require('bn.js'); } -/* jshint ignore:end */ \ No newline at end of file +/* jshint ignore:end */