Permalink
Browse files

deps - web3 is now exported as a constructor

  • Loading branch information...
kumavis
kumavis committed Nov 2, 2015
1 parent 2c8d998 commit eb25aa53b00d9907a354632926ae53ec4d45a8e4
Showing with 9 additions and 6 deletions.
  1. +5 −5 app/hooked-web3-provider.es6
  2. +4 −1 package.json
@@ -1,6 +1,6 @@
var factory = function(web3) {
var factory = function(Web3) {
class HookedWeb3Provider extends web3.providers.HttpProvider {
class HookedWeb3Provider extends Web3.providers.HttpProvider {
constructor({host, transaction_signer}) {
super(host);
this.transaction_signer = transaction_signer;
@@ -103,7 +103,7 @@ var factory = function(web3) {
done(err);
} else {
var new_nonce = result.result;
done(null, web3.toDecimal(new_nonce));
done(null, Web3.prototype.toDecimal(new_nonce));
}
});
}
@@ -124,7 +124,7 @@ var factory = function(web3) {
var final_nonce = Math.max(nonce, this.global_nonces[sender] || 0);
// Update the transaction parameters.
tx_params.nonce = web3.toHex(final_nonce);
tx_params.nonce = Web3.prototype.toHex(final_nonce);
// Update caches.
session_nonces[sender] = final_nonce + 1;
@@ -152,5 +152,5 @@ var factory = function(web3) {
if (typeof module !== 'undefined') {
module.exports = factory(require("web3"));
} else {
window.HookedWeb3Provider = factory(web3);
window.HookedWeb3Provider = factory(Web3);
}
View
@@ -14,5 +14,8 @@
"ethereumjs-accounts": "git+https://github.com/tcoulter/ethereumjs-accounts.git",
"bignumber.js": "*"
},
"license": "MIT License. Copyright Consensys LLC, and authors. All rights reserved."
"license": "MIT License. Copyright Consensys LLC, and authors. All rights reserved.",
"dependencies": {
"web3": "0.15.1"
}
}

0 comments on commit eb25aa5

Please sign in to comment.