4

I see that the results of past events which I get via

MyContract.MyEvent({}, { fromBlock: 0, toBlock: 'latest' }).get((error, results) => {
    console.log(JSON.stringify(results));
});

are sorted by block number. Can I rely on this ordering or is it possibly random? Chain re-organizations or forks are exceptions that I do not care about for now.

Is the behavior for .watch and filter.watch the same?

1 Answer 1

5
+50

I'm one of parity client developers and I can assure you that the ordering is defined (both in parity an geth) and you can safely rely on it. I see that it is not mentioned in the docs, so they need to be updated.

Is the behavior for .watch and filter.watch the same?

Unfortunately I can't answer this question.

PS. If you are curious how event filters work, the implementation is available here

1
  • Can anybody confirm this for .watch or filter.watch for geth?
    – SCBuergel
    Mar 27, 2017 at 18:31

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.