AvaProtocol / xcm-demo

Javascript usage of OAK’s XCM automation with parachains including Moonbeam, Astar and Mangata.
https://docs.oak.tech/docs/xcm/integration-overview/
4 stars 5 forks source link

Check the existence of a recent registered task on Turing #41

Closed chrisli30 closed 1 year ago

chrisli30 commented 1 year ago

Currently we are missing a step in our XCM demos to look through Turing’s storage for the task.

For example, currently the procedure is as below.

  1. Schedule Xcmp Task
  2. Wait for it to happen

A better way is to,

  1. Schedule Xcmp Task
  2. Check Turing storage for the task; if there’s none, the previous schedule function could have failed due to fees so we should throw an error right here.
  3. Then, wait for it to happen.
chrisli30 commented 1 year ago

For example, if proxy.ProxyExecuted failed the task will fail to insert into queue.

chrisli30 commented 1 year ago

We found a better solution, to subscribe to TaskScheduled event for the confirmation.