Skip to content

Commit

Permalink
update orchard for zebra-consensus (#8529)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage authored May 18, 2024
1 parent 1484d3d commit e0da45b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6067,7 +6067,7 @@ dependencies = [
"metrics 0.22.3",
"num-integer",
"once_cell",
"orchard 0.6.0",
"orchard 0.7.1",
"proptest",
"proptest-derive",
"rand 0.8.5",
Expand Down
2 changes: 1 addition & 1 deletion zebra-consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tower = { version = "0.4.13", features = ["timeout", "util", "buffer"] }
tracing = "0.1.39"
tracing-futures = "0.2.5"

orchard = "0.6.0"
orchard = "0.7.0"

zcash_proofs = { version = "0.13.0-rc.1", features = ["multicore" ] }
wagyu-zcash-parameters = "0.2.0"
Expand Down
13 changes: 7 additions & 6 deletions zebra-consensus/src/primitives/halo2/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tower::ServiceExt;

use halo2::pasta::{group::ff::PrimeField, pallas};
use orchard::{
builder::Builder,
builder::{Builder, BundleType},
bundle::Flags,
circuit::ProvingKey,
keys::{FullViewingKey, Scope, SpendingKey},
Expand All @@ -32,8 +32,6 @@ fn generate_test_vectors() {
let sk = SpendingKey::from_bytes([7; 32]).unwrap();
let recipient = FullViewingKey::from(&sk).address_at(0u32, Scope::External);

let enable_spends = true;
let enable_outputs = true;
let flags =
zebra_chain::orchard::Flags::ENABLE_SPENDS | zebra_chain::orchard::Flags::ENABLE_OUTPUTS;

Expand All @@ -43,17 +41,20 @@ fn generate_test_vectors() {
let shielded_data: Vec<zebra_chain::orchard::ShieldedData> = (1..=4)
.map(|num_recipients| {
let mut builder = Builder::new(
Flags::from_parts(enable_spends, enable_outputs),
BundleType::Transactional {
flags: Flags::from_byte(flags.bits()).unwrap(),
bundle_required: true,
},
Anchor::from_bytes(anchor_bytes).unwrap(),
);

for _ in 0..num_recipients {
builder
.add_recipient(None, recipient, NoteValue::from_raw(note_value), None)
.add_output(None, recipient, NoteValue::from_raw(note_value), None)
.unwrap();
}

let bundle: Bundle<_, i64> = builder.build(rng).unwrap();
let bundle: Bundle<_, i64> = builder.build(rng).unwrap().unwrap().0;

let bundle = bundle
.create_proof(&proving_key, rng)
Expand Down

0 comments on commit e0da45b

Please sign in to comment.