Skip to content

fix(api): gracefully handle unsupported ScAddress variants (#89) - #155

Merged
valoryyaa-byte merged 2 commits into
RWA-ToolKit:mainfrom
wendyamoni-creator:fix/issue-89-address-decode-fallback
Jul 28, 2026
Merged

fix(api): gracefully handle unsupported ScAddress variants (#89)#155
valoryyaa-byte merged 2 commits into
RWA-ToolKit:mainfrom
wendyamoni-creator:fix/issue-89-address-decode-fallback

Conversation

@wendyamoni-creator

@wendyamoni-creator wendyamoni-creator commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #89.

address_to_string in api/src/indexer/mod.rs only handled two ScAddress variants — Account(Ed25519) and Contract. Any other variant (e.g. muxed accounts) returned Err(IndexError::Decode(...)), which propagated via ? in scval_to_json and could abort the entire 10-second refresh cycle.

Change

Replace the error arm with a graceful fallback:

  • Logs a tracing::warn! so the anomaly is visible without being fatal.
  • Returns Ok("unknown:<debug repr>") so the decode succeeds and the indexer cycle continues normally.

No call-site changes needed — the function signature is unchanged.

Files changed

…it#89)

address_to_string previously returned an Err for any address variant
other than Ed25519 Account or Contract, which would propagate via ?
through scval_to_json and abort the entire refresh cycle.

Replace the error arm with a warn! log + an 'unknown:<debug>' placeholder
string so the decode succeeds and the indexer cycle continues normally.

Fixes RWA-ToolKit#89
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@wendyamoni-creator Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@valoryyaa-byte
valoryyaa-byte merged commit 8f3bcf9 into RWA-ToolKit:main Jul 28, 2026
1 check failed
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.

api: address decode only supports ed25519 accounts and contracts — muxed/other address types error out

2 participants