Skip to content

fix: multisig admin path, whitelist validation, lazy locale loading, and server refresh on language switch - #942

Merged
AbelOsaretin merged 4 commits into
Heliobond:mainfrom
PrimeFactor-Dev:fix/stellar-wave-issues
Oct 24, 2026
Merged

AbelOsaretin merged 4 commits into
Heliobond:mainfrom
PrimeFactor-Dev:fix/stellar-wave-issues

Conversation

@PrimeFactor-Dev

Copy link
Copy Markdown
Contributor

Closes #689, Closes #691, Closes #889, Closes #890

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Performance improvement

Summary

Four admin-console and i18n bugs are fixed in one PR. The multisig admin path called non-existent contract methods and never passed approvals (#689); whitelist actions sent placeholder addresses and couldn't add creators (#691); all five locale catalogs were statically bundled into every client chunk (#889); and switching language only patched client state without refreshing server-rendered output (#890).

Changes

#689 — Multisig admin path

  • isMultisigDeployment now reads get_multisig_admin (threshold > 0) instead of the non-existent is_multisig
  • fund_project_with_approvals replaces fund_project_approved; update_impact_score_approved and fund_project_with_approvals now pass an approvals vector
  • set_whitelist_approved branch removed (no multisig variant exists in the contract)
  • Fund and score forms are disabled on multisig deployments with an explanatory message until the multi-signer flow ships
  • Toast approval count reflects actual signatures collected (was hard-coded to 1)

#691 — Creator whitelist

  • Fixture addresses replaced with valid Stellar public keys (were truncated strings like GA7QY...solar)
  • isValidCreatorAddress validates via StrKey.isValidEd25519PublicKey
  • "Add creator" form with address input, inline validation errors, and whitelister-role gating

#889 — Lazy locale catalogs

  • Static imports of all five message catalogs replaced with dynamic import() on locale switch
  • Only initialMessages ships in the first-load client bundle

#890 — Server refresh on language switch

  • router.refresh() called after setting the locale cookie so server-rendered text, <html lang/dir>, and metadata update without a full page reload

Testing

  • src/i18n/LocaleProvider.test.tsx — 4 tests: initial render, RTL direction on Arabic switch, router.refresh() call, lazy catalog loading
  • src/wallet/admin.test.ts — 8 tests: arg building for both multisig and non-multisig paths (fund + scores)
  • src/screens/admin/utils.test.ts — 19 tests: address validation (valid keys, invalid formats, whitespace trimming)

All 31 tests pass.

Tradeoffs

  • Multisig fund/score forms are disabled rather than implementing the full multi-signer XDR flow (step 3 of the issue's proposed solution). This prevents sending transactions that are guaranteed to fail while keeping the PR scope minimal.
  • Whitelist list is still partially fixture-driven; live on-chain list building from WhitelistSet events is out of scope.

Out of scope

  • Multi-signer XDR export/import flow for multisig deployments
  • Building the whitelist from on-chain WhitelistSet events
  • window.confirm replacement for revoke confirmation

- Replace static imports of all five message catalogs with dynamic import()
  so only the active locale ships in the client bundle (Heliobond#889)
- Call router.refresh() after setting the locale cookie so server-rendered
  output and <html lang/dir> update without a full page reload (Heliobond#890)
- Add tests covering locale switching, RTL direction, and lazy loading
…iobond#689)

- Replace is_multisig with get_multisig_admin for multisig detection
- Use fund_project_with_approvals instead of fund_project_approved
- Pass approvals vector to *_with_approvals and *_approved methods
- Remove set_whitelist_approved branch (no multisig variant exists)
- Disable fund/score forms on multisig deployments until multi-signer flow ships
- Fix toast approval count to reflect actual signatures collected
- Add unit tests for multisig argument building
…ond#691)

- Replace fixture addresses with valid Stellar public keys
- Add isValidCreatorAddress using StrKey.isValidEd25519PublicKey
- Add 'Add creator' form with address validation and inline errors
- Gate whitelist actions by whitelister role
- Add tests for address validation
@vercel

vercel Bot commented Oct 24, 2026

Copy link
Copy Markdown

@PrimeFactor-Dev is attempting to deploy a commit to the David Dada's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thanks for the PR! A maintainer will take a look shortly. ✨

@github-actions

Copy link
Copy Markdown

Thanks for the PR! A maintainer will take a look shortly. ✨

@AbelOsaretin
AbelOsaretin merged commit 79368ac into Heliobond:main Oct 24, 2026
7 of 12 checks passed
dadadave80 added a commit that referenced this pull request Oct 26, 2026
Typecheck: duplicate useTranslations import, unused CATALOGS and catalog
imports, possibly-null regex match, rich-text age placeholder, stale
submitSetWhitelist argument. Lint: static StrKey import instead of require.
Format: run Prettier over the 20 files merged unformatted.

Tests: give the shared render helper a no-op router so LocaleProvider mounts
(226 failures), add the CLDR many category to fr/es/pt plurals, keep the
dollar sign in the withdraw cap message, and update expectations to the
translated error codes. Use the existing pendingDepositAge key for the
pending-deposit age and refresh the unused-keys baseline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment