Skip to content

Commit

Permalink
Merge pull request #63 from Electric-Coin-Company/pczt-inspect
Browse files Browse the repository at this point in the history
Add `pczt inspect` command
  • Loading branch information
nuttycom authored Dec 14, 2024
2 parents 344c30d + 4d92301 commit 410de82
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 32 deletions.
43 changes: 26 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ tui = [
]

[patch.crates-io]
orchard = { git = "https://github.com/zcash/orchard.git", rev = "5b6cc68b746c4dab37e43d09314da98d5ee99c21" }
pczt = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "29cff9683cdf2f0c522ff3224081dfb4fbc80248" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_client_sqlite = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
zip321 = { git = "https://github.com/zcash/librustzcash.git", rev = "702acff15593e6a3532436691205d633c28767fe" }
orchard = { git = "https://github.com/zcash/orchard.git", rev = "3d951b4201a63f3c07cba8b179dd9abde142cf33" }
pczt = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "231f81911628499a8877be57e66e60c09e55bdea" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_client_sqlite = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
zip321 = { git = "https://github.com/zcash/librustzcash.git", rev = "688dcaf077e3f989a7b7ddea5c391c5f9eb433af" }
8 changes: 4 additions & 4 deletions src/commands/keystone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ impl Enroll {
let ur = encoder
.next_part()
.map_err(|e| anyhow!("Failed to encode PCZT part: {e}"))?;
let code = QrCode::new(&ur.to_uppercase())?;
let code = QrCode::new(ur.to_uppercase())?;
let string = code
.render::<unicode::Dense1x2>()
.dark_color(unicode::Dense1x2::Dark)
.light_color(unicode::Dense1x2::Light)
.quiet_zone(false)
.dark_color(unicode::Dense1x2::Light)
.light_color(unicode::Dense1x2::Dark)
.quiet_zone(true)
.build();

stdout.write_all(format!("{string}\n").as_bytes()).await?;
Expand Down
3 changes: 3 additions & 0 deletions src/commands/pczt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use gumdrop::Options;

pub(crate) mod combine;
pub(crate) mod create;
pub(crate) mod inspect;
pub(crate) mod prove;
pub(crate) mod send;
pub(crate) mod sign;
Expand All @@ -13,6 +14,8 @@ pub(crate) mod qr;
pub(crate) enum Command {
#[options(help = "create a PCZT")]
Create(create::Command),
#[options(help = "inspect a PCZT")]
Inspect(inspect::Command),
#[options(help = "create proofs for a PCZT")]
Prove(prove::Command),
#[options(help = "apply signatures to a PCZT")]
Expand Down
Loading

0 comments on commit 410de82

Please sign in to comment.