Skip to content

feat(frontend): block writes on network mismatch in metadata + admin forms#906

Merged
Ejirowebfi merged 1 commit into
mainfrom
fix/network-guard-metadata-admin
Jul 1, 2026
Merged

feat(frontend): block writes on network mismatch in metadata + admin forms#906
Ejirowebfi merged 1 commit into
mainfrom
fix/network-guard-metadata-admin

Conversation

@Ejirowebfi

Copy link
Copy Markdown
Collaborator

Follow-up to the network-mismatch safety work. useNetworkGuard was wired into create/mint/burn; this extends it to the remaining on-chain write forms so all writes are hard-blocked (submit disabled + reason) when Freighter's network differs from the app's — not just warned by the global NetworkMismatchBanner.

Changes

  • MetadataForm (set_metadata via /metadata) — guard submit
  • SetMetadataForm (set_metadata via TokenDetail) — guard submit
  • AdminPanel (update_fees + other admin ops) — guard submit
  • Tests: add mismatch to the useNetwork mock in MetadataForm.test; add a useNetwork mock to AdminPanel.test (AdminPanel now consumes NetworkContext via the guard). AdminPanel.integration.test doesn't render the component, so it's unaffected.

Verification

typecheck ✓ · lint ✓ · format ✓ · 452 tests ✓ · build ✓

…forms

Extend useNetworkGuard (already on create/mint/burn) to the remaining
write forms so all on-chain writes are hard-blocked when Freighter's
network differs from the app's, not just warned by the banner:
- MetadataForm (set_metadata via /metadata)
- SetMetadataForm (set_metadata via TokenDetail)
- AdminPanel (update_fees and other admin ops)

Update MetadataForm/AdminPanel tests to supply mismatch in the useNetwork
mock (AdminPanel now consumes NetworkContext via the guard).
@Ejirowebfi Ejirowebfi merged commit f6e88f3 into main Jul 1, 2026
9 checks passed
@Ejirowebfi Ejirowebfi deleted the fix/network-guard-metadata-admin branch July 1, 2026 16:34
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.

1 participant