Skip to content

Commit 5e5885b

Browse files
authored
Merge pull request #107 from zcash/small-fixes
Small fixes
2 parents 0fa1e9c + 997cc34 commit 5e5885b

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/commands/create_multisig_address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Command {
5353
let (multisig_script, addr) = multisig_script(threshold, pub_keys)?;
5454
let addr = addr.encode(&Network::from(network));
5555
println!("Created multisig address: {addr}");
56-
println!("Script: {multisig_script:?}");
56+
println!("Redeem script: {}", hex::encode(multisig_script.0));
5757

5858
Ok(())
5959
}

src/commands/inspect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async fn inspect_possible_hash(bytes: [u8; 32], context: Option<Context>, lookup
167167
}
168168

169169
if let Some((tx, mined_height)) = mainnet.lookup_txid(candidate).await {
170-
transaction::inspect(tx, context, mined_height);
170+
transaction::inspect(tx, context, mined_height.map(|h| ("mainnet", h)));
171171
return true;
172172
}
173173
}
@@ -182,7 +182,7 @@ async fn inspect_possible_hash(bytes: [u8; 32], context: Option<Context>, lookup
182182
}
183183

184184
if let Some((tx, mined_height)) = testnet.lookup_txid(candidate).await {
185-
transaction::inspect(tx, context, mined_height);
185+
transaction::inspect(tx, context, mined_height.map(|h| ("testnet", h)));
186186
return true;
187187
}
188188
}

src/commands/inspect/transaction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ impl Authorization for PrecomputedAuth {
157157
pub(crate) fn inspect(
158158
tx: Transaction,
159159
context: Option<Context>,
160-
mined_height: Option<BlockHeight>,
160+
mined_height: Option<(&'static str, BlockHeight)>,
161161
) {
162162
eprintln!("Zcash transaction");
163163
eprintln!(" - ID: {}", tx.txid());
164-
if let Some(height) = mined_height {
165-
eprintln!(" - Mined in block {height}");
164+
if let Some((chain, height)) = mined_height {
165+
eprintln!(" - Mined in {chain} block {height}");
166166
}
167167
eprintln!(" - Version: {:?}", tx.version());
168168
match tx.version() {

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! It is only intended to show the overall light client workflow using this crate.
55
66
use std::env;
7+
use std::io;
78
use std::num::NonZeroU32;
89
use std::sync::atomic::{AtomicUsize, Ordering};
910

@@ -88,7 +89,11 @@ fn main() -> Result<(), anyhow::Error> {
8889

8990
let stdout_logger = if tui_logger.is_none() {
9091
let filter = tracing_subscriber::EnvFilter::from(level_filter);
91-
Some(tracing_subscriber::fmt::layer().with_filter(filter))
92+
Some(
93+
tracing_subscriber::fmt::layer()
94+
.with_writer(io::stderr)
95+
.with_filter(filter),
96+
)
9297
} else {
9398
None
9499
};

0 commit comments

Comments
 (0)