fixed #28 and other small node.js issues

This commit is contained in:
Marek Kotewicz 2015-01-16 15:49:36 +01:00
parent 2c36d5ff45
commit 0172939490
10 changed files with 39 additions and 60 deletions

39
dist/ethereum.js vendored
View File

@ -24,10 +24,10 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ
// TODO: is these line is supposed to be here? // TODO: is these line is supposed to be here?
if ("build" !== 'build') {/* if ("build" !== 'build') {/*
var web3 = require('./web3'); // jshint ignore:line var BigNumber = require('bignumber.js'); // jshint ignore:line
*/} */}
var BigNumber = require('bignumber.js'); var web3 = require('./web3'); // jshint ignore:line
// TODO: make these be actually accurate instead of falling back onto JS's doubles. // TODO: make these be actually accurate instead of falling back onto JS's doubles.
var hexToDec = function (hex) { var hexToDec = function (hex) {
@ -308,7 +308,7 @@ module.exports = {
}; };
},{"bignumber.js":undefined}],2:[function(require,module,exports){ },{"./web3":8}],2:[function(require,module,exports){
/* /*
This file is part of ethereum.js. This file is part of ethereum.js.
@ -448,11 +448,7 @@ module.exports = AutoProvider;
* @date 2014 * @date 2014
*/ */
// TODO: is these line is supposed to be here?
if ("build" !== 'build') {/*
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
*/}
var abi = require('./abi'); var abi = require('./abi');
/// method signature length in bytes /// method signature length in bytes
@ -520,7 +516,7 @@ var contract = function (address, desc) {
module.exports = contract; module.exports = contract;
},{"./abi":1}],4:[function(require,module,exports){ },{"./abi":1,"./web3":8}],4:[function(require,module,exports){
/* /*
This file is part of ethereum.js. This file is part of ethereum.js.
@ -546,10 +542,7 @@ module.exports = contract;
* @date 2014 * @date 2014
*/ */
// TODO: is these line is supposed to be here?
if ("build" !== 'build') {/*
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
*/}
/// should be used when we want to watch something /// should be used when we want to watch something
/// it's using inner polling mechanism and is notified about changes /// it's using inner polling mechanism and is notified about changes
@ -611,7 +604,7 @@ Filter.prototype.logs = function () {
module.exports = Filter; module.exports = Filter;
},{}],5:[function(require,module,exports){ },{"./web3":8}],5:[function(require,module,exports){
/* /*
This file is part of ethereum.js. This file is part of ethereum.js.
@ -766,9 +759,7 @@ module.exports = HttpRpcProvider;
*/ */
// TODO: is these line is supposed to be here? // TODO: is these line is supposed to be here?
if ("build" !== 'build') {/*
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
*/}
/** /**
* Provider manager object prototype * Provider manager object prototype
@ -863,7 +854,7 @@ ProviderManager.prototype.stopPolling = function (pollId) {
module.exports = ProviderManager; module.exports = ProviderManager;
},{}],7:[function(require,module,exports){ },{"./web3":8}],7:[function(require,module,exports){
/* /*
This file is part of ethereum.js. This file is part of ethereum.js.
@ -948,9 +939,6 @@ module.exports = QtProvider;
* @date 2014 * @date 2014
*/ */
var Filter = require('./filter');
var ProviderManager = require('./providermanager');
/// Recursively resolves all promises in given object and replaces the resolved values with promises /// Recursively resolves all promises in given object and replaces the resolved values with promises
/// @param any object/array/promise/anything else.. /// @param any object/array/promise/anything else..
/// @returns (resolves) object with replaced promises with their result /// @returns (resolves) object with replaced promises with their result
@ -1244,7 +1232,7 @@ var web3 = {
/// eth object prototype /// eth object prototype
eth: { eth: {
watch: function (params) { watch: function (params) {
return new Filter(params, ethWatch); return new web3.filter(params, ethWatch);
} }
}, },
@ -1254,7 +1242,7 @@ var web3 = {
/// shh object prototype /// shh object prototype
shh: { shh: {
watch: function (params) { watch: function (params) {
return new Filter(params, shhWatch); return new web3.filter(params, shhWatch);
} }
}, },
@ -1312,8 +1300,6 @@ var shhWatch = {
setupMethods(shhWatch, shhWatchMethods()); setupMethods(shhWatch, shhWatchMethods());
web3.provider = new ProviderManager();
web3.setProvider = function(provider) { web3.setProvider = function(provider) {
provider.onmessage = messageHandler; provider.onmessage = messageHandler;
web3.provider.set(provider); web3.provider.set(provider);
@ -1336,10 +1322,10 @@ function messageHandler(data) {
} }
} }
if (typeof(module) !== "undefined")
module.exports = web3; module.exports = web3;
},{"./filter":4,"./providermanager":6}],9:[function(require,module,exports){
},{}],9:[function(require,module,exports){
/* /*
This file is part of ethereum.js. This file is part of ethereum.js.
@ -1441,6 +1427,9 @@ if (typeof(module) !== "undefined")
},{}],"web3":[function(require,module,exports){ },{}],"web3":[function(require,module,exports){
var web3 = require('./lib/web3'); var web3 = require('./lib/web3');
var ProviderManager = require('./lib/providermanager');
web3.provider = new ProviderManager();
web3.filter = require('./lib/filter');
web3.providers.WebSocketProvider = require('./lib/websocket'); web3.providers.WebSocketProvider = require('./lib/websocket');
web3.providers.HttpRpcProvider = require('./lib/httprpc'); web3.providers.HttpRpcProvider = require('./lib/httprpc');
web3.providers.QtProvider = require('./lib/qt'); web3.providers.QtProvider = require('./lib/qt');
@ -1449,7 +1438,7 @@ web3.eth.contract = require('./lib/contract');
module.exports = web3; module.exports = web3;
},{"./lib/autoprovider":2,"./lib/contract":3,"./lib/httprpc":5,"./lib/qt":7,"./lib/web3":8,"./lib/websocket":9}]},{},["web3"]) },{"./lib/autoprovider":2,"./lib/contract":3,"./lib/filter":4,"./lib/httprpc":5,"./lib/providermanager":6,"./lib/qt":7,"./lib/web3":8,"./lib/websocket":9}]},{},["web3"])
//# sourceMappingURL=ethereum.js.map //# sourceMappingURL=ethereum.js.map

14
dist/ethereum.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@
<head> <head>
<script type="text/javascript" src="js/es6-promise/promise.min.js"></script> <script type="text/javascript" src="js/es6-promise/promise.min.js"></script>
<script type="text/javascript" src="../node_modules/bignumber.js/bignumber.min.js"></script>
<script type="text/javascript" src="../dist/ethereum.js"></script> <script type="text/javascript" src="../dist/ethereum.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -1,4 +1,7 @@
var web3 = require('./lib/web3'); var web3 = require('./lib/web3');
var ProviderManager = require('./lib/providermanager');
web3.provider = new ProviderManager();
web3.filter = require('./lib/filter');
web3.providers.WebSocketProvider = require('./lib/websocket'); web3.providers.WebSocketProvider = require('./lib/websocket');
web3.providers.HttpRpcProvider = require('./lib/httprpc'); web3.providers.HttpRpcProvider = require('./lib/httprpc');
web3.providers.QtProvider = require('./lib/qt'); web3.providers.QtProvider = require('./lib/qt');

View File

@ -23,10 +23,10 @@
// TODO: is these line is supposed to be here? // TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') { if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line var BigNumber = require('bignumber.js'); // jshint ignore:line
} }
var BigNumber = require('bignumber.js'); var web3 = require('./web3'); // jshint ignore:line
// TODO: make these be actually accurate instead of falling back onto JS's doubles. // TODO: make these be actually accurate instead of falling back onto JS's doubles.
var hexToDec = function (hex) { var hexToDec = function (hex) {

View File

@ -20,11 +20,7 @@
* @date 2014 * @date 2014
*/ */
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
}
var abi = require('./abi'); var abi = require('./abi');
/// method signature length in bytes /// method signature length in bytes

View File

@ -23,10 +23,7 @@
* @date 2014 * @date 2014
*/ */
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
}
/// should be used when we want to watch something /// should be used when we want to watch something
/// it's using inner polling mechanism and is notified about changes /// it's using inner polling mechanism and is notified about changes

View File

@ -24,9 +24,7 @@
*/ */
// TODO: is these line is supposed to be here? // TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line var web3 = require('./web3'); // jshint ignore:line
}
/** /**
* Provider manager object prototype * Provider manager object prototype

View File

@ -23,9 +23,6 @@
* @date 2014 * @date 2014
*/ */
var Filter = require('./filter');
var ProviderManager = require('./providermanager');
/// Recursively resolves all promises in given object and replaces the resolved values with promises /// Recursively resolves all promises in given object and replaces the resolved values with promises
/// @param any object/array/promise/anything else.. /// @param any object/array/promise/anything else..
/// @returns (resolves) object with replaced promises with their result /// @returns (resolves) object with replaced promises with their result
@ -319,7 +316,7 @@ var web3 = {
/// eth object prototype /// eth object prototype
eth: { eth: {
watch: function (params) { watch: function (params) {
return new Filter(params, ethWatch); return new web3.filter(params, ethWatch);
} }
}, },
@ -329,7 +326,7 @@ var web3 = {
/// shh object prototype /// shh object prototype
shh: { shh: {
watch: function (params) { watch: function (params) {
return new Filter(params, shhWatch); return new web3.filter(params, shhWatch);
} }
}, },
@ -387,8 +384,6 @@ var shhWatch = {
setupMethods(shhWatch, shhWatchMethods()); setupMethods(shhWatch, shhWatchMethods());
web3.provider = new ProviderManager();
web3.setProvider = function(provider) { web3.setProvider = function(provider) {
provider.onmessage = messageHandler; provider.onmessage = messageHandler;
web3.provider.set(provider); web3.provider.set(provider);
@ -411,5 +406,5 @@ function messageHandler(data) {
} }
} }
if (typeof(module) !== "undefined")
module.exports = web3; module.exports = web3;