Skip to content

Fix ClearFlag CLI flag mapping#313

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-clear-flag-bug
Draft

Fix ClearFlag CLI flag mapping#313
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-clear-flag-bug

Conversation

Copilot AI commented May 24, 2026

Copy link
Copy Markdown

High Level Overview of Change

xrpl account clear-flag was wiring the requested flag into set_flag, so the CLI did the opposite of the user intent. This corrects the transaction construction and adds a regression check for the emitted AccountSet fields.

Context of Change

The bug was in the ClearFlag CLI path: a clear request could serialize as a flag set, including asfDisableMaster, which can lock an account out of master-key authorization.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Before / After

  • SetFlag path stays unchanged.
  • ClearFlag now populates clear_flag and leaves set_flag unset.
// before
AccountSet::new(..., None, ..., None, Some(flag_enum), ...);

// after
AccountSet::new(..., Some(flag_enum), ..., None, None, ...);
  • Added a CLI regression test that decodes the signed transaction blob and verifies:
    • ClearFlag is present
    • SetFlag is absent

Test Plan

  • cargo test --features "std cli integration" --test cli_integration test_account_clear_flag -- --nocapture
  • cargo test --features "std cli integration" --test cli_integration test_account_set_flag -- --nocapture

Copilot AI changed the title [WIP] Fix ClearFlag CLI to correctly clear account flags Fix ClearFlag CLI flag mapping May 24, 2026
Copilot AI requested a review from e-desouza May 24, 2026 01:49
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.

ClearFlag CLI actually sets the flag — funds-safety bug

2 participants