mirror of https://github.com/zcash/halo2.git
Fix bug in `Builder` initialization of `Circuit` struct
`rcv` was being used correctly outside the circuit to derive `cv_net` but then `Circuit` was just storing 0. The `round_trip` test passed because it uses `rcv = 0` everywhere.
This commit is contained in:
parent
a33d1bd90f
commit
9117273c08
|
@ -130,7 +130,7 @@ impl ActionInfo {
|
||||||
/// [orchardsend]: https://zips.z.cash/protocol/nu5.pdf#orchardsend
|
/// [orchardsend]: https://zips.z.cash/protocol/nu5.pdf#orchardsend
|
||||||
fn build(self, mut rng: impl RngCore) -> (Action<SigningMetadata>, Circuit) {
|
fn build(self, mut rng: impl RngCore) -> (Action<SigningMetadata>, Circuit) {
|
||||||
let v_net = self.value_sum().expect("already checked this");
|
let v_net = self.value_sum().expect("already checked this");
|
||||||
let cv_net = ValueCommitment::derive(v_net, self.rcv);
|
let cv_net = ValueCommitment::derive(v_net, self.rcv.clone());
|
||||||
|
|
||||||
let nf_old = self.spend.note.nullifier(&self.spend.fvk);
|
let nf_old = self.spend.note.nullifier(&self.spend.fvk);
|
||||||
let sender_address = self.spend.fvk.default_address();
|
let sender_address = self.spend.fvk.default_address();
|
||||||
|
@ -196,7 +196,7 @@ impl ActionInfo {
|
||||||
v_new: Some(note.value()),
|
v_new: Some(note.value()),
|
||||||
psi_new: Some(note.rseed().psi(¬e.rho())),
|
psi_new: Some(note.rseed().psi(¬e.rho())),
|
||||||
rcm_new: Some(note.rseed().rcm(¬e.rho())),
|
rcm_new: Some(note.rseed().rcm(¬e.rho())),
|
||||||
rcv: Some(ValueCommitTrapdoor::zero()),
|
rcv: Some(self.rcv),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue