Skip to content

Commit

Permalink
pcli: add view address --transparent option, remove --compat
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Dec 12, 2024
1 parent eb90327 commit 411f842
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/bin/pcli/src/command/view/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ pub struct AddressCmd {
/// Output in base64 format, instead of the default bech32.
#[clap(long)]
base64: bool,
/// Use compat (bech32, not bech32m) address encoding, for compatibility with some IBC chains.
/// Use transparent (bech32, 32-byte) address encoding, for compatibility with some IBC chains.
#[clap(long)]
compat: bool,
transparent: bool,
/// Print the current FVK
#[clap(long)]
fvk: bool,
Expand Down Expand Up @@ -49,8 +49,13 @@ impl AddressCmd {
"{}",
base64::engine::general_purpose::STANDARD.encode(address.to_vec()),
);
} else if self.compat {
println!("{}", address.compat_encoding());
} else if self.transparent {
if index != 0 {
return Err(anyhow::anyhow!(
"warning: index must be 0 to use transparent address encoding"
));
}
println!("{}", fvk.incoming().transparent_address());
} else {
if self.fvk {
eprintln!("🔥 CAUTION: POSSESSION OF THE FOLLOWING FULL VIEWING KEY WILL");
Expand Down

0 comments on commit 411f842

Please sign in to comment.