mirror of https://github.com/status-im/web3.js.git
Merge pull request #186 from ethereum/eventFilterFix
fixed event from and toBlock
This commit is contained in:
commit
539ef7bdcf
|
@ -2118,7 +2118,7 @@ SolidityEvent.prototype.encode = function (indexed, options) {
|
|||
['fromBlock', 'toBlock'].filter(function (f) {
|
||||
return options[f] !== undefined;
|
||||
}).forEach(function (f) {
|
||||
result[f] = utils.toHex(options[f]);
|
||||
result[f] = formatters.inputBlockNumberFormatter(options[f]);
|
||||
});
|
||||
|
||||
result.topics = [];
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2118,7 +2118,7 @@ SolidityEvent.prototype.encode = function (indexed, options) {
|
|||
['fromBlock', 'toBlock'].filter(function (f) {
|
||||
return options[f] !== undefined;
|
||||
}).forEach(function (f) {
|
||||
result[f] = utils.toHex(options[f]);
|
||||
result[f] = formatters.inputBlockNumberFormatter(options[f]);
|
||||
});
|
||||
|
||||
result.topics = [];
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -45,7 +45,7 @@
|
|||
var contract;
|
||||
|
||||
var update = function (err, x) {
|
||||
document.getElementById('result').innerText = JSON.stringify(x, null, 2);
|
||||
document.getElementById('result').textContent = JSON.stringify(x, null, 2);
|
||||
};
|
||||
|
||||
var createContract = function () {
|
||||
|
|
|
@ -96,7 +96,7 @@ SolidityEvent.prototype.encode = function (indexed, options) {
|
|||
['fromBlock', 'toBlock'].filter(function (f) {
|
||||
return options[f] !== undefined;
|
||||
}).forEach(function (f) {
|
||||
result[f] = utils.toHex(options[f]);
|
||||
result[f] = formatters.inputBlockNumberFormatter(options[f]);
|
||||
});
|
||||
|
||||
result.topics = [];
|
||||
|
|
|
@ -119,6 +119,32 @@ var tests = [{
|
|||
]
|
||||
}
|
||||
}, {
|
||||
abi: {
|
||||
name: 'event1',
|
||||
inputs: [{
|
||||
type: 'int',
|
||||
name: 'a',
|
||||
indexed: true
|
||||
}]
|
||||
},
|
||||
indexed: {
|
||||
a: 1
|
||||
},
|
||||
options: {
|
||||
fromBlock: 'latest',
|
||||
toBlock: 'pending'
|
||||
},
|
||||
expected: {
|
||||
address: address,
|
||||
fromBlock: 'latest',
|
||||
toBlock: 'pending',
|
||||
topics: [
|
||||
signature,
|
||||
'0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
abi: {
|
||||
name: 'event1',
|
||||
inputs: [{
|
||||
|
|
|
@ -21,6 +21,21 @@ var tests = [{
|
|||
result: '0xf',
|
||||
formattedResult: '0xf',
|
||||
call: 'eth_newFilter'
|
||||
},{
|
||||
args: [{
|
||||
fromBlock: 'latest',
|
||||
toBlock: 'latest',
|
||||
address: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'
|
||||
}],
|
||||
formattedArgs: [{
|
||||
fromBlock: 'latest',
|
||||
toBlock: 'latest',
|
||||
address: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855',
|
||||
topics: []
|
||||
}],
|
||||
result: '0xf',
|
||||
formattedResult: '0xf',
|
||||
call: 'eth_newFilter'
|
||||
},{
|
||||
args: ['pending'],
|
||||
formattedArgs: ['pending'],
|
||||
|
|
Loading…
Reference in New Issue