Merge branch 'blockFilterProposal' of https://github.com/ethereum/ethereum.js into develop

Conflicts:
	dist/web3-light.js.map
	dist/web3-light.min.js
	dist/web3.js.map
	dist/web3.min.js
This commit is contained in:
Marek Kotewicz 2015-05-11 15:28:22 +02:00
commit 9812b01979
9 changed files with 74 additions and 18 deletions

15
dist/web3-light.js vendored
View File

@ -3580,7 +3580,20 @@ var Method = require('./method');
/// @returns an array of objects describing web3.eth.filter api methods
var eth = function () {
var newFilterCall = function (args) {
return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter';
var type = args[0];
switch(type) {
case 'latest':
args.pop();
this.params = 0;
return 'eth_newBlockFilter';
case 'pending':
args.pop();
this.params = 0;
return 'eth_newPendingTransactionFilter';
default:
return 'eth_newFilter';
}
};
var newFilter = new Method({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

15
dist/web3.js vendored
View File

@ -3580,7 +3580,20 @@ var Method = require('./method');
/// @returns an array of objects describing web3.eth.filter api methods
var eth = function () {
var newFilterCall = function (args) {
return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter';
var type = args[0];
switch(type) {
case 'latest':
args.pop();
this.params = 0;
return 'eth_newBlockFilter';
case 'pending':
args.pop();
this.params = 0;
return 'eth_newPendingTransactionFilter';
default:
return 'eth_newFilter';
}
};
var newFilter = new Method({

4
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,20 @@ var Method = require('./method');
/// @returns an array of objects describing web3.eth.filter api methods
var eth = function () {
var newFilterCall = function (args) {
return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter';
var type = args[0];
switch(type) {
case 'latest':
args.pop();
this.params = 0;
return 'eth_newBlockFilter';
case 'pending':
args.pop();
this.params = 0;
return 'eth_newPendingTransactionFilter';
default:
return 'eth_newFilter';
}
};
var newFilter = new Method({

View File

@ -6,15 +6,26 @@ var utils = require('../lib/utils/utils');
var tests = [{
protocol: 'eth',
args: ['pending'],
args: ['latest'],
firstResult: 1,
firstPayload: {
method: "eth_newBlockFilter",
params: [
"pending"
]
params: []
},
secondResult: [null],
secondResult: ['0x1234'],
secondPayload: {
method: "eth_getFilterChanges"
}
},
{
protocol: 'eth',
args: ['pending'],
firstResult: 1,
firstPayload: {
method: "eth_newPendingTransactionFilter",
params: []
},
secondResult: ['0x1234'],
secondPayload: {
method: "eth_getFilterChanges"
}

View File

@ -37,11 +37,17 @@ var tests = [{
formattedResult: '0xf',
call: 'eth_newFilter'
},{
args: ['pending'],
formattedArgs: ['pending'],
args: ['latest'],
formattedArgs: [],
result: '0xf',
formattedResult: '0xf',
call: 'eth_newBlockFilter'
},{
args: ['pending'],
formattedArgs: [],
result: '0xf',
formattedResult: '0xf',
call: 'eth_newPendingTransactionFilter'
}];
describe('web3.eth', function () {