Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ names, environment variables, exit codes, error codes, and the shape of

### Changed

- Transaction kinds use their usual names: CoinJoin, Lightning and MWEB.
- Transaction kinds are written as on sochain.com, such as CoinJoin,
Lightning close, MWEB peg-in and fee-bumped.

## [0.1.1] - 2026-10-12

Expand Down
10 changes: 8 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,14 @@ fn show_chart(out: &mut dyn Write, n: Network, r: Chart, last: usize) -> Result<
Ok(())
}

/// A transaction kind as words, with names in their usual casing:
/// A transaction kind as words, written as sochain.com writes it:
/// `coinjoin` is `CoinJoin`, `lightning_close` is `Lightning close`.
fn kind_name(kind: &str) -> String {
match kind {
"mweb_peg_in" => return "MWEB peg-in".into(),
"fee_bumped" => return "fee-bumped".into(),
_ => {}
}
kind.split('_')
.map(|w| match w {
"coinjoin" => "CoinJoin",
Expand Down Expand Up @@ -1549,7 +1554,8 @@ mod tests {
fn names_transaction_kinds() {
assert_eq!(kind_name("coinjoin"), "CoinJoin");
assert_eq!(kind_name("lightning_close"), "Lightning close");
assert_eq!(kind_name("mweb_peg_in"), "MWEB peg in");
assert_eq!(kind_name("mweb_peg_in"), "MWEB peg-in");
assert_eq!(kind_name("fee_bumped"), "fee-bumped");
assert_eq!(kind_name("batch_payout"), "batch payout");
assert_eq!(kind_name("payment"), "payment");
}
Expand Down
Loading