Repository navigation
[sdk]: skip live tests with a warning when the test wallet can't pay - #1420
Merged
Merged
Conversation
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.
This PR makes the sdk's live testnet tests skip, with a visible warning, when the shared CI test account can't pay, instead of failing as if the code were broken. It changes test code only.
Why: the
@hyperbridge/sdkworkflow'slivejob runssrc/tests/sequential/*against Polygon Amoy, BSC Chapel and Hyperbridge Gargantua from onePRIVATE_KEYaccount. On #1414 it failed inintentGatewayCancelwith viem'sInsufficientFundsError: the account held 1.62 POL and the cancel needed 1.83. Nothing in that PR was involved; the testnet account ran low.Change (
src/tests/sequential/funding.ts, used by every spending live test):requireFunded(ctx, account, requirements)reads each balance a test is about to spend (native gas and tokens, per chain) before its first transaction. If any is below that test's named minimum, the test skips. The cancel tests check this before placing an order, so a short wallet doesn't leave a testnet escrow behind unrefunded.skipIfUnfunded(ctx, account, native, step)wraps the spending steps. Gas prices and relayer fees drift, so a transaction can still be rejected withInsufficientFundsErroranywhere in itscausechain; when that happens, the test skips. Any other error still fails it.::warning title=Unfunded live test::<test>: <account> holds <balance> on <chain>, needs at least <min>. Fund it to run this test.annotation, plus the same text to stderr.intentsCoprocessor, the tests that read or retract the bid skip when the bid was never placed.The minimums per test are listed in
docs/ai/changelog/2026-10-16-live-tests-skip-when-the-wallet-is-unfunded.md. For the cancel test from its source, that's 5 POL plus 10 fee token and 0.1 USDC on Amoy.Validation
src/tests/liveTestFunding.test.ts(4 tests, run by the normal offlinetest) covers:InsufficientFundsErrorwrapped in aTransactionExecutionErrorskips;tscis clean on the package and prettier is clean. Biome reports only the 4 errors that already exist in these files on main.livejob on this PR is the real check.The CI account still needs topping up for the cancel test to run rather than skip. The annotation names the balance to fund.