docs2 icon indicating copy to clipboard operation
docs2 copied to clipboard

`fetchEvents` contract events are returned as sorted by alphabet order

Open Pfed-prog opened this issue 10 months ago • 0 comments

image example of output

const res = await fetchEvents({ publicKey: appId });

console.log(res[1].events);

contract events ordered by me as a developer:

events = {
  'updated-merkle-root': Field,
  'updated-fee': UInt64,
  'updated-total-supply': UInt64,
  'updated-inited-amount': Field,
  'inited-max-supply': Field,
  'inited-nft': Field,
  'minted-nft': Field,
  'transferred-nft': Field,
};

When sorted by alphabet:

events = {
  'inited-max-supply': Field,
  'inited-nft': Field,
  'minted-nft': Field,
  'transferred-nft': Field,
  'updated-fee': UInt64,
  'updated-inited-amount': Field,
  'updated-merkle-root': Field,
  'updated-total-supply': UInt64,
};

In the output the 6 event is 'updated-merkle-root', 5 is 'updated-inited-amount' and 'inited-nft'.

https://docs.minaprotocol.com/zkapps/o1js/fetch-events-and-actions Does not mention such events behaviour

Pfed-prog avatar Apr 07 '24 11:04 Pfed-prog