Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions PR_NOTES/fix-admin-handle-void-admin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Fix admin() void handling in fetchTokenInfo

Summary:
- Avoid decoding `admin` ScVal when it is `scvVoid()`; return "N/A" instead.
- Prevents dashboard/admin UI from erroring when a token has no on-chain admin (addresses Issue #129).

Changed files:
- frontend/lib/stellar.ts β€” detect and handle `scvVoid()` for `admin()` calls.

Test results (run in this environment):
- Frontend unit tests: 99 passed, 0 failed.
- Rust contract tests: not run here (no `cargo` available). Please run `cargo test` in `contracts/token` and `contracts/vesting` in CI or locally.

Changelog:
- Fix: handle void `admin` ScVal in `fetchTokenInfo` to avoid decode errors and enable admin UI for tokens without an admin.

Branch: `fix/admin-handle-void-admin`

Notes:
- PR created/updated to include test summary and recommended follow-up (run Rust tests in CI).
8 changes: 7 additions & 1 deletion frontend/lib/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,13 @@ async function _fetchTokenInfo(
decimals,
totalSupply,
circulatingSupply,
admin: adminVal ? decodeAddress(adminVal) : "N/A",
admin:
adminVal &&
typeof (adminVal as StellarSdk.xdr.ScVal).switch === "function" &&
(adminVal as StellarSdk.xdr.ScVal).switch() !==
StellarSdk.xdr.ScValType.scvVoid()
? decodeAddress(adminVal as StellarSdk.xdr.ScVal)
: "N/A",
contractId,
maxSupply,
contractUri,
Expand Down
Loading