Rename types and cch fields #1211
Merged
quake merged 6 commits intonervosnetwork:developfrom Mar 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates naming conventions across the CCH order status types and channel state_flags string representations to be consistent across Rust types, JSON-RPC types/docs, and e2e/tests.
Changes:
- Renamed
CchOrderStatusvariants (OutgoingSucceeded→OutgoingSuccess,Succeeded→Success) and updated state machine/actions/tests accordingly. - Standardized RPC
state_flagsoutput/expectations toSCREAMING_SNAKE_CASE(e.g.,COOPERATIVE,WAITING_COMMITMENT_CONFIRMATION). - Updated JSON-RPC docs/schema helpers and Bruno e2e tests to match the new naming.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/bruno/e2e/open-use-close-a-channel/21-list-channel-with-closed-status-NODE1.bru | Update expected state_flags string for ShuttingDown state. |
| tests/bruno/e2e/open-use-close-a-channel/23-list-channel-with-closed-status-NODE1.bru | Update expected state_flags string for Closed state. |
| crates/fiber-types/src/sample/cch.rs | Update CCH status samples to renamed variants. |
| crates/fiber-types/src/cch.rs | Rename CchOrderStatus variants and adjust mappings/finality check. |
| crates/fiber-lib/src/store/.schema.json | Update stored schema hash entry for CchOrderStatus. |
| crates/fiber-lib/src/rpc/README.md | Update RPC docs for renamed CCH status values. |
| crates/fiber-lib/src/fiber/tests/rpc.rs | Align test expectations/comments with SCREAMING_SNAKE_CASE flags. |
| crates/fiber-lib/src/cch/tests/state_machine_tests.rs | Update expected statuses and rename some tests for new status names. |
| crates/fiber-lib/src/cch/tests/scheduler_tests.rs | Update final-status test cases to Success. |
| crates/fiber-lib/src/cch/tests/event_tests.rs | Update status mapping expectations to renamed variants. |
| crates/fiber-lib/src/cch/tests/dispatcher_tests.rs | Update dispatcher tests to renamed variants. |
| crates/fiber-lib/src/cch/tests/actor_tests.rs | Update flow docs and assertions to renamed variants. |
| crates/fiber-lib/src/cch/order/state_machine.rs | Update allowed transitions for renamed variants. |
| crates/fiber-lib/src/cch/actions/settle_incoming_invoice.rs | Update dispatch predicate to renamed outgoing status. |
| crates/fiber-lib/src/cch/actions/mod.rs | Update action selection logic to renamed variants. |
| crates/fiber-json-types/src/serde_utils.rs | Change RPC flags serialization/deserialization to SCREAMING_SNAKE_CASE and pipe-separated format. |
| crates/fiber-json-types/src/convert.rs | Update conversion mapping to renamed JSON CCH status variants. |
| crates/fiber-json-types/src/cch.rs | Rename JSON-RPC CchOrderStatus variants. |
Comments suppressed due to low confidence (1)
crates/fiber-json-types/src/serde_utils.rs:492
define_rpc_flagsdeserialization now only accepts SCREAMING_SNAKE_CASE names separated by|. This is a breaking change from the previous behavior (PascalCase + comma-separated) and will reject any existing client input using the old format. Consider accepting both separators (,and|) and optionally mapping legacy PascalCase to the new SCREAMING_SNAKE_CASE during parsing to preserve backward compatibility.
fn from_string(s: &str) -> Option<Self> {
let mut flags: $ty = 0;
for name in s.split('|') {
let name = name.trim();
match name {
$(stringify!($flag_name) => flags |= Self::$flag_name,)*
_ => return None,
}
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
doitian
reviewed
Mar 18, 2026
quake
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maintain consistent naming styles.