mirror of https://github.com/status-im/web3.js.git
merged latest develop
This commit is contained in:
commit
d51e9a2f30
8
LICENSE
8
LICENSE
|
@ -1,14 +1,14 @@
|
|||
This file is part of ethereum.js.
|
||||
This file is part of web3.js.
|
||||
|
||||
ethereum.js is free software: you can redistribute it and/or modify
|
||||
web3.js is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ethereum.js is distributed in the hope that it will be useful,
|
||||
web3.js is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
|
|
@ -108,7 +108,7 @@ eth -j
|
|||
[travis-url]: https://travis-ci.org/ethereum/web3.js
|
||||
[dep-image]: https://david-dm.org/ethereum/web3.js.svg
|
||||
[dep-url]: https://david-dm.org/ethereum/web3.js
|
||||
[dep-dev-image]: https://david-dm.org/ethereum/web.js/dev-status.svg
|
||||
[dep-dev-image]: https://david-dm.org/ethereum/web3.js/dev-status.svg
|
||||
[dep-dev-url]: https://david-dm.org/ethereum/web3.js#info=devDependencies
|
||||
[coveralls-image]: https://coveralls.io/repos/ethereum/web3.js/badge.svg?branch=master
|
||||
[coveralls-url]: https://coveralls.io/r/ethereum/web3.js?branch=master
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "web3",
|
||||
"namespace": "ethereum",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.0",
|
||||
"description": "Ethereum Compatible JavaScript API",
|
||||
"main": [
|
||||
"./dist/web3.js",
|
||||
|
|
|
@ -1394,7 +1394,7 @@ module.exports = {
|
|||
|
||||
},{"bignumber.js":"bignumber.js"}],8:[function(require,module,exports){
|
||||
module.exports={
|
||||
"version": "0.5.0"
|
||||
"version": "0.6.0"
|
||||
}
|
||||
|
||||
},{}],9:[function(require,module,exports){
|
||||
|
@ -2735,10 +2735,6 @@ var outputBlockFormatter = function(block) {
|
|||
* @returns {Object} log
|
||||
*/
|
||||
var outputLogFormatter = function(log) {
|
||||
if (log === null) { // 'pending' && 'latest' filters are nulls
|
||||
return null;
|
||||
}
|
||||
|
||||
if(log.blockNumber !== null)
|
||||
log.blockNumber = utils.toDecimal(log.blockNumber);
|
||||
if(log.transactionIndex !== null)
|
||||
|
@ -3922,7 +3918,7 @@ RequestManager.prototype.sendBatch = function (data, callback) {
|
|||
RequestManager.prototype.setProvider = function (p) {
|
||||
this.provider = p;
|
||||
|
||||
if(this.provider && !this.isPolling) {
|
||||
if (this.provider && !this.isPolling) {
|
||||
this.poll();
|
||||
this.isPolling = true;
|
||||
}
|
||||
|
@ -3963,9 +3959,7 @@ RequestManager.prototype.stopPolling = function (pollId) {
|
|||
*/
|
||||
RequestManager.prototype.reset = function () {
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls = {};
|
||||
|
||||
|
@ -3985,7 +3979,7 @@ RequestManager.prototype.poll = function () {
|
|||
/*jshint maxcomplexity: 6 */
|
||||
this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);
|
||||
|
||||
if (this.polls === {}) {
|
||||
if (Object.keys(this.polls).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3997,10 +3991,8 @@ RequestManager.prototype.poll = function () {
|
|||
var pollsData = [];
|
||||
var pollsKeys = [];
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
|
||||
if (pollsData.length === 0) {
|
||||
|
@ -4023,13 +4015,13 @@ RequestManager.prototype.poll = function () {
|
|||
results.map(function (result, index) {
|
||||
var key = pollsKeys[index];
|
||||
// make sure the filter is still installed after arrival of the request
|
||||
if(self.polls[key]) {
|
||||
if (self.polls[key]) {
|
||||
result.callback = self.polls[key].callback;
|
||||
return result;
|
||||
} else
|
||||
return false;
|
||||
}).filter(function (result) {
|
||||
return (!result) ? false : true;
|
||||
return !!result;
|
||||
}).filter(function (result) {
|
||||
var valid = Jsonrpc.getInstance().isValidResponse(result);
|
||||
if (!valid) {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1394,7 +1394,7 @@ module.exports = {
|
|||
|
||||
},{"bignumber.js":"bignumber.js"}],8:[function(require,module,exports){
|
||||
module.exports={
|
||||
"version": "0.5.0"
|
||||
"version": "0.6.0"
|
||||
}
|
||||
|
||||
},{}],9:[function(require,module,exports){
|
||||
|
@ -2735,10 +2735,6 @@ var outputBlockFormatter = function(block) {
|
|||
* @returns {Object} log
|
||||
*/
|
||||
var outputLogFormatter = function(log) {
|
||||
if (log === null) { // 'pending' && 'latest' filters are nulls
|
||||
return null;
|
||||
}
|
||||
|
||||
if(log.blockNumber !== null)
|
||||
log.blockNumber = utils.toDecimal(log.blockNumber);
|
||||
if(log.transactionIndex !== null)
|
||||
|
@ -3922,7 +3918,7 @@ RequestManager.prototype.sendBatch = function (data, callback) {
|
|||
RequestManager.prototype.setProvider = function (p) {
|
||||
this.provider = p;
|
||||
|
||||
if(this.provider && !this.isPolling) {
|
||||
if (this.provider && !this.isPolling) {
|
||||
this.poll();
|
||||
this.isPolling = true;
|
||||
}
|
||||
|
@ -3963,9 +3959,7 @@ RequestManager.prototype.stopPolling = function (pollId) {
|
|||
*/
|
||||
RequestManager.prototype.reset = function () {
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls = {};
|
||||
|
||||
|
@ -3985,7 +3979,7 @@ RequestManager.prototype.poll = function () {
|
|||
/*jshint maxcomplexity: 6 */
|
||||
this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);
|
||||
|
||||
if (this.polls === {}) {
|
||||
if (Object.keys(this.polls).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3997,10 +3991,8 @@ RequestManager.prototype.poll = function () {
|
|||
var pollsData = [];
|
||||
var pollsKeys = [];
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
|
||||
if (pollsData.length === 0) {
|
||||
|
@ -4023,13 +4015,13 @@ RequestManager.prototype.poll = function () {
|
|||
results.map(function (result, index) {
|
||||
var key = pollsKeys[index];
|
||||
// make sure the filter is still installed after arrival of the request
|
||||
if(self.polls[key]) {
|
||||
if (self.polls[key]) {
|
||||
result.callback = self.polls[key].callback;
|
||||
return result;
|
||||
} else
|
||||
return false;
|
||||
}).filter(function (result) {
|
||||
return (!result) ? false : true;
|
||||
return !!result;
|
||||
}).filter(function (result) {
|
||||
var valid = Jsonrpc.getInstance().isValidResponse(result);
|
||||
if (!valid) {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -25,6 +25,7 @@
|
|||
|
||||
var address;
|
||||
var contract;
|
||||
var inc;
|
||||
|
||||
var update = function (err, x) {
|
||||
document.getElementById('result').textContent = JSON.stringify(x, null, 2);
|
||||
|
@ -55,8 +56,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
contract.Incremented({odd: true}).watch(update);
|
||||
|
||||
inc = contract.Incremented({odd: true});
|
||||
inc.watch(update);
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"version": "0.5.0"
|
||||
"version": "0.6.0"
|
||||
}
|
||||
|
|
|
@ -138,10 +138,6 @@ var outputBlockFormatter = function(block) {
|
|||
* @returns {Object} log
|
||||
*/
|
||||
var outputLogFormatter = function(log) {
|
||||
if (log === null) { // 'pending' && 'latest' filters are nulls
|
||||
return null;
|
||||
}
|
||||
|
||||
if(log.blockNumber !== null)
|
||||
log.blockNumber = utils.toDecimal(log.blockNumber);
|
||||
if(log.transactionIndex !== null)
|
||||
|
|
|
@ -141,7 +141,7 @@ RequestManager.prototype.sendBatch = function (data, callback) {
|
|||
RequestManager.prototype.setProvider = function (p) {
|
||||
this.provider = p;
|
||||
|
||||
if(this.provider && !this.isPolling) {
|
||||
if (this.provider && !this.isPolling) {
|
||||
this.poll();
|
||||
this.isPolling = true;
|
||||
}
|
||||
|
@ -182,9 +182,7 @@ RequestManager.prototype.stopPolling = function (pollId) {
|
|||
*/
|
||||
RequestManager.prototype.reset = function () {
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls[key].uninstall();
|
||||
}
|
||||
this.polls = {};
|
||||
|
||||
|
@ -204,7 +202,7 @@ RequestManager.prototype.poll = function () {
|
|||
/*jshint maxcomplexity: 6 */
|
||||
this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);
|
||||
|
||||
if (this.polls === {}) {
|
||||
if (Object.keys(this.polls).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -216,10 +214,8 @@ RequestManager.prototype.poll = function () {
|
|||
var pollsData = [];
|
||||
var pollsKeys = [];
|
||||
for (var key in this.polls) {
|
||||
if (this.polls.hasOwnProperty(key)) {
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
pollsData.push(this.polls[key].data);
|
||||
pollsKeys.push(key);
|
||||
}
|
||||
|
||||
if (pollsData.length === 0) {
|
||||
|
@ -242,13 +238,13 @@ RequestManager.prototype.poll = function () {
|
|||
results.map(function (result, index) {
|
||||
var key = pollsKeys[index];
|
||||
// make sure the filter is still installed after arrival of the request
|
||||
if(self.polls[key]) {
|
||||
if (self.polls[key]) {
|
||||
result.callback = self.polls[key].callback;
|
||||
return result;
|
||||
} else
|
||||
return false;
|
||||
}).filter(function (result) {
|
||||
return (!result) ? false : true;
|
||||
return !!result;
|
||||
}).filter(function (result) {
|
||||
var valid = Jsonrpc.getInstance().isValidResponse(result);
|
||||
if (!valid) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* jshint ignore:start */
|
||||
Package.describe({
|
||||
name: 'ethereum:web3',
|
||||
version: '0.5.0',
|
||||
version: '0.6.0',
|
||||
summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC',
|
||||
git: 'https://github.com/ethereum/ethereum.js',
|
||||
// By default, Meteor will default to using README.md for documentation.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "web3",
|
||||
"namespace": "ethereum",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.0",
|
||||
"description": "Ethereum JavaScript API, middleware to talk to a ethereum node over RPC",
|
||||
"main": "./index.js",
|
||||
"directories": {
|
||||
|
@ -17,11 +17,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"bower": ">=1.3.0",
|
||||
"browserify": ">=6.0",
|
||||
"browserify": ">=10.0",
|
||||
"chai": "^2.1.1",
|
||||
"coveralls": "^2.11.2",
|
||||
"del": ">=0.1.1",
|
||||
"exorcist": "^0.1.6",
|
||||
"exorcist": "^0.4.0",
|
||||
"gulp": ">=3.4.0",
|
||||
"gulp-jshint": ">=1.5.0",
|
||||
"gulp-rename": ">=1.2.0",
|
||||
|
|
Loading…
Reference in New Issue