Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate account fetching into SmartContracts #113

Closed
mitschabaude opened this issue Apr 15, 2022 · 0 comments · Fixed by #126
Closed

Integrate account fetching into SmartContracts #113

mitschabaude opened this issue Apr 15, 2022 · 0 comments · Fixed by #126
Assignees

Comments

@mitschabaude
Copy link
Member

mitschabaude commented Apr 15, 2022

  • Use the existing fetch methods magically within createTransaction and similar places to fetch account state from an API
  • Add a cache to store existing fetch results in
  • Refactor createTransaction, such that it either uses account state from the cache, or marks it as "to be fetched" (not fetch it directly!). For proof transactions, this enables us to first run it "test mode", then asynchronously fetch the missing data, then run it again (with all the data available) inside the synchronous prover. For non-proof transactions, there can be a simple async wrapper that does those three steps in sequence.
  • Expose a method to explicitly populate the cache with arbitrary data, for testing scenarios / optional fine-grained control over where the data comes from (e.g. from disk instead of from an API).

Small TODO which should be enabled by this:

  • Add nonce precondition to all signed parties - currently only done in createSigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant