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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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