Skip to content

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

@leighmcculloch

Description

@leighmcculloch

What problem does your feature solve?

The stellar ledger entry fetch trustline --asset flag accepts "XLM" (mapped to TrustLineAsset::Native), but trustlines do not hold the native asset — the native balance is held on the account entry itself. Passing --asset xlm silently returns an empty result instead of telling the user the input is invalid:

$ stellar ledger entry fetch trustline --asset xlm --account GB6RQWLXTCVLJZX6LACXVD4WFZHX4YGIPPBSH2YQQMZIMEKA4BM7QLOU
{"entries":[],"latestLedger":61271020}

let asset = if asset.eq_ignore_ascii_case("XLM") {
TrustLineAsset::Native

What would you like to see?

Return an error when "XLM" or "native" is passed as an --asset value, since trustlines cannot hold the native asset. For example:

error: native asset (XLM) does not have a trustline, use `stellar ledger entry fetch account` instead

What alternatives are there?

Leave the behavior as-is, silently returning an empty result.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions