Skip to content

Comments

Return error when fetching ledger entry for trustline using native asset.#2406

Open
fnando wants to merge 4 commits intomainfrom
2394
Open

Return error when fetching ledger entry for trustline using native asset.#2406
fnando wants to merge 4 commits intomainfrom
2394

Conversation

@fnando
Copy link
Member

@fnando fnando commented Feb 20, 2026

What

Return error when fetching ledger entry for trustline using native asset.

Why

So it behaves like it should with native asset. Close #2394.

Known limitations

N/A

Copilot AI review requested due to automatic review settings February 20, 2026 01:39
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Feb 20, 2026
@fnando fnando self-assigned this Feb 20, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Feb 20, 2026
@fnando fnando added bug Something isn't working cli Related to Soroban CLI labels Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #2394 by returning an error when users attempt to fetch a trustline ledger entry using the native asset (XLM). Previously, the CLI would silently accept "XLM" or "native" as the asset parameter and return an empty result, which was confusing since trustlines cannot hold the native asset - native balances are stored in the account entry itself.

Changes:

  • Added a new NativeAsset error variant that provides a helpful error message directing users to use stellar ledger entry fetch account instead
  • Modified the asset parsing logic to check for "XLM" or "native" (case-insensitive) and return the new error instead of creating a TrustLineAsset::Native
  • Added comprehensive test coverage for both "xlm" and "native" keywords with various capitalizations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/soroban-cli/src/commands/ledger/entry/fetch/trustline.rs Added NativeAsset error variant and modified asset parsing to reject native assets with a helpful error message
cmd/crates/soroban-test/tests/it/integration/ledger/entry.rs Added two test functions covering all case variations of "xlm" and "native" to ensure proper error handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Related to Soroban CLI

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

stellar ledger entry fetch trustline --asset xlm shouldn't be supported

2 participants