-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: tools for sync operations (#10171)
refs: https://github.com/Agoric/BytePitchPartnerEng/issues/10 refs: Agoric/agoric-3-proposals#181 ## Description Currently the way to make sure a transaction sent to agoric chain has been executed is to use a method from `@agoric/synthetic-chain` called `waitForBlock` which stops the execution flow of a given ava test until N number of blocks are produced. This is not as deterministic as we'd like it to be but so far it worked fine. However, it could still end up in a race condition in some extreme cases. In this PR we introduce a set of tools to sync operations carried out in a test. Currently this PR supports operations like; * Making sure a core-eval resulted successfully deploying a contract * Making sure a core-eval successfully sent zoe invitations to committee members for governance * Making sure an account is successfully funded with vbank assets like IST, BLD etc. * Making sure an offer resulted successfully See Agoric/agoric-3-proposals#181 for further discussion. ### Security Considerations This is merely a testing tool, so no security considerations. ### Scaling Considerations This is merely a testing tool, so no scaling considerations. ### Documentation Considerations If this ends up getting in to `@agoric/synthetic-chain` then we might need more extensive explanation of what we do. But for now, I don't think any documentation is needed. ### Testing Considerations Have confirmed that this works fine with existing a3p tests locally but to keep the scope tighter I will update those tests one this PR lands. The coverage of the unit tests in `sync-tools.test.js` seems fine but I'm open to suggestions, of course.
- Loading branch information
Showing
4 changed files
with
619 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.