Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 207 forks source link

feat(sync-tools): add method to wait until offer has exited #10462

Closed Jorge-Lopes closed 1 week ago

Jorge-Lopes commented 1 week ago

closes: https://github.com/Agoric/BytePitchPartnerEng/issues/38

Description

This PR aims to extend the available sync-tools by providing a method that allows the developer to verify that an offer was successfully exited via the execution of a tryExitOffer call.

The method waitUntilOfferExited will poll the user's wallet liveOffers and check if the respective offerId is no longer present.

Security Considerations

No new assumptions or dependencies were introduced.

Scaling Considerations

No requirements for increased resources.

Documentation Considerations

This additional tool does not impact backward compatibility.

Although it may be useful to inform the developer that intends to use this method to prevent a false positive, it should first verify that the offerID is indeed present in the user's wallet liveOffers before calling tryExitOffer.

Testing Considerations

I have confirmed that this method works as expected when used locally at the a3p-integration acceptance tests. The test used is not included in the PR, since it would be out of scope.

Upgrade Considerations

No impact is expected for live production systems.

cloudflare-workers-and-pages[bot] commented 1 week ago

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f4de7c
Status: ✅  Deploy successful!
Preview URL: https://02b4082f.agoric-sdk.pages.dev
Branch Preview URL: https://jorge-sync-tools-tryexitoffe.agoric-sdk.pages.dev

View logs