Test the full app and backend user flow on a fork and on Base Sepolia - #39
Merged
Merged
Conversation
The steps live in one shared definition so the fork and live runs cannot drift apart.
The backend records them with recordSettledPurchase. The steps check the event, the history entry and the spent reference, that no tokens moved, and that the contract refuses the cases it should.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a consumer test that runs the whole user flow the way the app and backend would, from signup to an eSIM identifier onchain. The same steps run on a local Base Sepolia fork and on the live network with Pimlico.
Steps covered
postCreateAccountfrom its own recordsdeployAndBindESIMWalletwith no fund accessbuyDataBundleWithTransfer; exact amount moved, no pull accessrecordSettledPurchasewithExternalWallet; no tokens moverecordSettledPurchasewithFiatandUSD; no tokens moveEach step logs its user operation and transaction hashes. On live, the hashes are Basescan links.
Layout
tests/consumer/flows/userFlow.ts: the steps, written oncetests/consumer/userFlow.fork.test.ts: fork setup; the backend is a new private key made admintests/consumer/userFlow.live.test.ts: live setup; the real admin key, Pimlico, and 3 confirmations after each writeRunning
npm run test:consumer:fork -- --reporter=verbose npm run test:consumer:live -- --reporter=verbose # needs .envA live run spends 2 USDCt and 1 USDC from the admin, plus gas for 5 admin transactions.
Results