Skip to content

fix: non-null assert payout in worldremit payout validation tests - #881

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
0xzino:fix/worldremit-payout-ts
Jul 31, 2026
Merged

fix: non-null assert payout in worldremit payout validation tests#881
ralyodio merged 1 commit into
profullstack:masterfrom
0xzino:fix/worldremit-payout-ts

Conversation

@0xzino

@0xzino 0xzino commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Bug

pnpm -r build fails on @profullstack/sh1pt-payment-worldremit with 4× TS2722 (Cannot invoke an object which is possibly undefined) at src/index.test.ts lines 12, 16, 17, 21.

payout() is optional in the PaymentProvider interface, so adapter.payout(...) in the tests is typed as possibly-undefined. WorldRemit is a payouts adapter that always implements payout().

Fix

Use non-null assertion (adapter.payout!) in the payout validation tests.

Verification

  • pnpm --filter @profullstack/sh1pt-payment-worldremit build → passes
  • npx vitest run packages/payments/worldremit → 5/5 pass
  • pnpm -r build → 681 packages done, 0 errors

payout() is optional in PaymentProvider, so calling adapter.payout()
directly triggers TS2722 (Cannot invoke an object which is possibly
'undefined') and breaks the package build. WorldRemit is a payouts
adapter that always implements payout(), so add the non-null assertion.

Build was failing: pnpm -r build → worldremit Failed (4x TS2722)
@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

1 similar comment
@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@ralyodio
ralyodio merged commit f5f14fa into profullstack:master Jul 31, 2026
4 checks passed
@0xzino

0xzino commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging! This fix was submitted under the ugig.net bounty "I will pay for every bug fix found and PR submitted" (https://ugig.net/bounties — bounty c3137a9d-de39-4c1e-b48a-3df804c32bdf). Claim submission ID 8a22db62 (pending review). Payment: $1 SOL per fix PR.

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 this pull request may close these issues.

2 participants