2

I use Parity:

Parity-Ethereum//v2.2.7-stable-b00a21f-20190115/x86_64-linux-gnu/rustc1.31.1

I tried code to see new entries for block range.

l = w3.eth.filter({'fromBlock': 2500000, 'toBlock': 'latest'})
l = l.get_new_entries()
print(l)

But the result was only for latest block:

[{
  'address': '0x3b7c7C457D3aAe04a4631E4888AeEEDd08B24e41',
  'blockHash': HexBytes('0x22faa2d5102d8685b1d5dadc5a52680c8f3e461bf7615e06002f4740c17c0be2'),
  'blockNumber': 2904310,
  'data': '0x00000000000000000000000000000000000000000000000000000000bf23c7f4',
  'logIndex': 0,
  'removed': False,
  'topics': [HexBytes('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'), HexBytes('0x00000000000000000000000000360d2b7d240ec0643b6d819ba81a09e40e5bcd'), HexBytes('0x00000000000000000000000081bfb6a2db736c5ec06ddf4654478cf78b3e0be7')],
  'transactionHash': HexBytes('0x878e023cbd496692705f75146fa8f693a9590ff782cfccbab493e057a51d6286'),
  'transactionIndex': 0,
  'transactionLogIndex': '0x0',
  'type': 'mined'
}, {
  'address': '0x81BfB6A2Db736c5EC06DdF4654478CF78B3E0bE7',
  'blockHash': HexBytes('0x22faa2d5102d8685b1d5dadc5a52680c8f3e461bf7615e06002f4740c17c0be2'),
  'blockNumber': 2904310,
  'data': '0x00000000000000000000000000000000000000000000000000000000000151ce',
  'logIndex': 1,
  'removed': False,
  'topics': [HexBytes('0xcea04943b36b38f541b87028ed4da18dded81fd7741867c8320734d24b5b0ece')],
  'transactionHash': HexBytes('0x878e023cbd496692705f75146fa8f693a9590ff782cfccbab493e057a51d6286'),
  'transactionIndex': 0,
  'transactionLogIndex': '0x1',
  'type': 'mined'
}]

Why?

1
  • Maybe this helps, I had the same issue with web3js when using getPastLogs, solved it by passing the 'fromBlock' as a string instead of a number (i.e, '2500000')
    – Jaime
    Mar 29, 2019 at 20:17

1 Answer 1

0

Have you tried using get_all_entries instead of get_new_entries? The former returns all entries matching the filter, but the later only returns entries since the last poll. Check out this post and the documentation for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.