Skip to content

Commit

Permalink
Merge branch 'issue/3155' into bundle-improvement-ens
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Nov 12, 2019
2 parents 1a52348 + b5e0d2e commit d7e7ede
Show file tree
Hide file tree
Showing 63 changed files with 575 additions and 595 deletions.
88 changes: 80 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"postinstall": "lerna bootstrap; npm run build:all",
"build:web3": "lerna exec --scope web3 -- CJS=true ESM=true rollup -c",
"build:web3:minified": "npm run build:all; lerna exec --scope web3 -- MIN=true rollup -c",
"build:all": "npm run build:all:cjs; npm run build:all:esm; npm run build:all:minified",
"build:all": "npm run build:all:cjs; npm run build:all:esm;",
"build:all:cjs": "lerna exec -- ISTANBUL=true CJS=true rollup -c",
"build:all:esm": "lerna exec -- ESM=true rollup -c",
"build:all:minified": "lerna exec -- MIN=true rollup -c",
Expand Down Expand Up @@ -85,9 +85,11 @@
],
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-export-default-from": "^7.5.2",
"@babel/plugin-proposal-export-namespace-from": "^7.5.2",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/register": "^7.6.2",
"@babel/register": "^7.7.0",
"@babel/runtime": "^7.6.3",
"@istanbuljs/nyc-config-babel": "^2.1.1",
"@types/bn.js": "^4.11.5",
Expand Down Expand Up @@ -118,8 +120,8 @@
"karma-spec-reporter": "0.0.32",
"lerna": "^2.11.0",
"mocha": "^6.2.1",
"nyc": "^14.1.1",
"npm-auth-to-token": "^1.0.0",
"nyc": "^14.1.1",
"puppeteer": "^1.20.0",
"rollup": "^1.25.2",
"rollup-plugin-auto-external": "^2.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/web3-bzz/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

"use strict";

var _ = require('underscore');
var swarm = require("swarm-js");
import _ from 'underscore';
import swarm from "swarm-js";


var Bzz = function Bzz(provider) {
Expand Down Expand Up @@ -84,5 +84,5 @@ Bzz.prototype.setProvider = function(provider) {
};


module.exports = Bzz;
export default Bzz;

52 changes: 28 additions & 24 deletions packages/web3-core-helpers/src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,31 @@
* @date 2017
*/

"use strict";

module.exports = {
ErrorResponse: function (result) {
var message = !!result && !!result.error && !!result.error.message ? result.error.message : JSON.stringify(result);
return new Error('Returned error: ' + message);
},
InvalidNumberOfParams: function (got, expected, method) {
return new Error('Invalid number of parameters for "'+ method +'". Got '+ got +' expected '+ expected +'!');
},
InvalidConnection: function (host){
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +'.');
},
InvalidProvider: function () {
return new Error('Provider not set or invalid');
},
InvalidResponse: function (result){
var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response: ' + JSON.stringify(result);
return new Error(message);
},
ConnectionTimeout: function (ms){
return new Error('CONNECTION TIMEOUT: timeout of ' + ms + ' ms achived');
}
};
'use strict';

export function ErrorResponse(result) {
var message = !!result && !!result.error && !!result.error.message ? result.error.message : JSON.stringify(result);
return new Error('Returned error: ' + message);
}

export function InvalidNumberOfParams(got, expected, method) {
return new Error('Invalid number of parameters for "' + method + '". Got ' + got + ' expected ' + expected + '!');
}


export function InvalidConnection(host) {
return new Error('CONNECTION ERROR: Couldn\'t connect to node ' + host + '.');
}

export function InvalidProvider() {
return new Error('Provider not set or invalid');
}

export function InvalidResponse(result) {
var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response: ' + JSON.stringify(result);
return new Error(message);
}

export function ConnectionTimeout(ms) {
return new Error('CONNECTION TIMEOUT: timeout of ' + ms + ' ms achived');
}
Loading

0 comments on commit d7e7ede

Please sign in to comment.