mirror of https://github.com/zcash/orchard.git
disabled split notes (#22)
* disabled split notes and proof check for zsa transfer
This commit is contained in:
parent
9b434976ab
commit
985d0d243e
|
@ -379,11 +379,13 @@ impl Builder {
|
|||
.cloned()
|
||||
.unwrap();
|
||||
|
||||
// TODO: uncomment once the circuit is ready.
|
||||
// use the first spend to create split spend(s) or create a dummy if empty.
|
||||
let dummy_spend = spends.first().map_or_else(
|
||||
|| SpendInfo::dummy(note_type, &mut rng),
|
||||
|s| s.create_split_spend(),
|
||||
);
|
||||
// let dummy_spend = spends.first().map_or_else(
|
||||
// || SpendInfo::dummy(note_type, &mut rng),
|
||||
// |s| s.create_split_spend(),
|
||||
// );
|
||||
let dummy_spend = SpendInfo::dummy(note_type, &mut rng);
|
||||
|
||||
// Extend the spends and recipients with dummy values.
|
||||
spends.extend(iter::repeat_with(|| dummy_spend.clone()).take(num_actions - num_spends));
|
||||
|
|
|
@ -14,8 +14,10 @@ use orchard::{
|
|||
use rand::rngs::OsRng;
|
||||
use zcash_note_encryption::try_note_decryption;
|
||||
|
||||
pub fn verify_bundle(bundle: &Bundle<Authorized, i64>, _vk: &VerifyingKey) {
|
||||
// TODO uncomment when circuit can work with split flag - assert!(matches!(bundle.verify_proof(vk), Ok(())));
|
||||
pub fn verify_bundle(bundle: &Bundle<Authorized, i64>, vk: &VerifyingKey, verify_proof: bool) {
|
||||
if verify_proof {
|
||||
assert!(matches!(bundle.verify_proof(vk), Ok(())));
|
||||
}
|
||||
let sighash: [u8; 32] = bundle.commitment().into();
|
||||
let bvk = bundle.binding_validating_key();
|
||||
for action in bundle.actions() {
|
||||
|
@ -78,7 +80,7 @@ fn bundle_chain() {
|
|||
};
|
||||
|
||||
// Verify the shielding bundle.
|
||||
verify_bundle(&shielding_bundle, &vk);
|
||||
verify_bundle(&shielding_bundle, &vk, true);
|
||||
|
||||
// Create a shielded bundle spending the previous output.
|
||||
let shielded_bundle: Bundle<_, i64> = {
|
||||
|
@ -115,5 +117,5 @@ fn bundle_chain() {
|
|||
};
|
||||
|
||||
// Verify the shielded bundle.
|
||||
verify_bundle(&shielded_bundle, &vk);
|
||||
verify_bundle(&shielded_bundle, &vk, true);
|
||||
}
|
||||
|
|
|
@ -254,8 +254,8 @@ fn build_and_verify_bundle(
|
|||
build_and_sign_bundle(builder, rng, keys.pk(), keys.sk())
|
||||
};
|
||||
|
||||
// Verify the shielded bundle
|
||||
verify_bundle(&shielded_bundle, &keys.vk);
|
||||
// Verify the shielded bundle, currently without the proof.
|
||||
verify_bundle(&shielded_bundle, &keys.vk, false);
|
||||
assert_eq!(shielded_bundle.actions().len(), expected_num_actions);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue