Skip to content

fix(#167): locate XChainOwnedClaimID by type, not by index#317

Open
LeJamon wants to merge 1 commit into
XRPLF:mainfrom
LeJamon:fix/issue-167
Open

fix(#167): locate XChainOwnedClaimID by type, not by index#317
LeJamon wants to merge 1 commit into
XRPLF:mainfrom
LeJamon:fix/issue-167

Conversation

@LeJamon

@LeJamon LeJamon commented May 30, 2026

Copy link
Copy Markdown

Closes #167.

get_xchain_claim_id returned the claim id from affected_nodes[0] after filtering by type. AffectedNodes ordering is not guaranteed by the server, and the first matching created node is not guaranteed to be the one carrying the field.

Replaces the positional lookup with a find_map that returns the first created XChainOwnedClaimID entry actually carrying an xchain_claim_id, regardless of position.

Testing

  • cargo test --lib — added test_get_xchain_claim_id_not_first_node; existing tests still pass
  • cargo fmt --check; no_std feature set green

AffectedNodes ordering is not guaranteed by the server. Replace the
positional affected_nodes[0] lookup with a find_map that returns the
created XChainOwnedClaimID entry carrying an xchain_claim_id, regardless
of its position in the metadata.
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.

get_xchain_claim_id implicitly trusts affected_nodes[0]

1 participant