From 666f4249b42c3e68ee7ad330eeaa712b8dbc2a0e Mon Sep 17 00:00:00 2001 From: Brice Dobry Date: Wed, 10 Sep 2025 12:56:06 -0400 Subject: [PATCH 1/4] fix: print correct address version in `stacks-inspect decode-tx` --- CHANGELOG.md | 4 ++++ stackslib/src/main.rs | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f065726d77..6585de572a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE expressive (#6337) - Removed affirmation maps logic throughout, upgrading chainstate DB schema to 11 and burnchain DB schema to 3 (#6314) +### Fixed + +- When running `stacks-inspect decode-tx`, print the correct version of the address (mainnet or testnet) based on the transaction passed in + ## [3.2.0.0.1] ### Added diff --git a/stackslib/src/main.rs b/stackslib/src/main.rs index d54be910d6..828edb0299 100644 --- a/stackslib/src/main.rs +++ b/stackslib/src/main.rs @@ -423,7 +423,12 @@ fn main() { .unwrap(); println!("Verified: {:#?}", tx.verify()); - println!("Address: {}", tx.auth.origin().address_mainnet()); + let address = if tx.is_mainnet() { + tx.auth.origin().address_mainnet() + } else { + tx.auth.origin().address_testnet() + }; + println!("Address: {}", address); println!("{:#?}", &tx); process::exit(0); From 1492574da41d1a4c0f32fc9b2dc84c741ecc777f Mon Sep 17 00:00:00 2001 From: Brice Date: Thu, 11 Sep 2025 14:13:10 -0400 Subject: [PATCH 2/4] refactor: improve address getter Co-authored-by: Federico De Felici --- stackslib/src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stackslib/src/main.rs b/stackslib/src/main.rs index 828edb0299..04db3badc3 100644 --- a/stackslib/src/main.rs +++ b/stackslib/src/main.rs @@ -423,11 +423,7 @@ fn main() { .unwrap(); println!("Verified: {:#?}", tx.verify()); - let address = if tx.is_mainnet() { - tx.auth.origin().address_mainnet() - } else { - tx.auth.origin().address_testnet() - }; + let address = tx.auth.origin().get_address(tx.is_mainnet()) println!("Address: {}", address); println!("{:#?}", &tx); From 5ce445bcc656c6abdfc328283018806b846402ef Mon Sep 17 00:00:00 2001 From: Brice Dobry Date: Thu, 11 Sep 2025 15:11:02 -0400 Subject: [PATCH 3/4] chore: formatting --- stackslib/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackslib/src/main.rs b/stackslib/src/main.rs index 04db3badc3..f31db5f62e 100644 --- a/stackslib/src/main.rs +++ b/stackslib/src/main.rs @@ -423,7 +423,7 @@ fn main() { .unwrap(); println!("Verified: {:#?}", tx.verify()); - let address = tx.auth.origin().get_address(tx.is_mainnet()) + let address = tx.auth.origin().get_address(tx.is_mainnet()); println!("Address: {}", address); println!("{:#?}", &tx); From 9bc5be8839e34802eb542f90de5efd1ceb9d3bd4 Mon Sep 17 00:00:00 2001 From: Brice Dobry Date: Tue, 16 Sep 2025 14:10:05 -0400 Subject: [PATCH 4/4] refactor: inline vars into format string --- stackslib/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stackslib/src/main.rs b/stackslib/src/main.rs index f31db5f62e..c6f667213e 100644 --- a/stackslib/src/main.rs +++ b/stackslib/src/main.rs @@ -424,9 +424,9 @@ fn main() { println!("Verified: {:#?}", tx.verify()); let address = tx.auth.origin().get_address(tx.is_mainnet()); - println!("Address: {}", address); + println!("Address: {address}"); - println!("{:#?}", &tx); + println!("{tx:#?}"); process::exit(0); }