mirror of https://github.com/status-im/web3.js.git
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:
commit
9812b01979
|
@ -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
|
@ -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
|
@ -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({
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue