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
1 change: 1 addition & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ fn show_transaction(out: &mut dyn Write, n: Network, tx: Transaction) -> Result<
for i in &tx.inputs {
let who = match (i.address.as_deref(), i.mweb.as_deref(), &i.previous_output) {
(Some(a), _, _) => a,
(None, Some("pegin"), _) => "MWEB peg-in",
(None, Some(_), _) => "MWEB pool",
(None, None, None) => "newly mined coins",
// Pay-to-public-key, bare multisig and other scripts without one.
Expand Down
3 changes: 2 additions & 1 deletion src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ pub struct TxInput {
/// Null for a coinbase input, which spends no earlier output.
#[serde(default)]
pub previous_output: Option<serde_json::Value>,
/// Litecoin: `pool` or `pegin` when the input comes from the MWEB side.
/// Litecoin: `pool` when the input spends the MWEB pool, `pegin` when it
/// spends a peg-in.
#[serde(default)]
pub mweb: Option<String>,
}
Expand Down
8 changes: 7 additions & 1 deletion tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,11 @@ fn inputs_without_an_address_are_told_apart() {
json!({ "hash": TXID, "index": 1 }),
Some("pool")
),
input(
Value::Null,
json!({ "hash": TXID, "index": 2 }),
Some("pegin")
),
]);
let m = mock(vec![ok(tx)]);
sochain(&m, &config())
Expand All @@ -944,7 +949,8 @@ fn inputs_without_an_address_are_told_apart() {
.success()
.stdout(predicate::str::contains(" newly mined coins 1 LTC"))
.stdout(predicate::str::contains(" (no address) 1 LTC"))
.stdout(predicate::str::contains(" MWEB pool 1 LTC"));
.stdout(predicate::str::contains(" MWEB pool 1 LTC"))
.stdout(predicate::str::contains(" MWEB peg-in 1 LTC"));
}

#[test]
Expand Down
Loading