diff --git a/src/builder.rs b/src/builder.rs index be084af..ff209fe 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -93,10 +93,8 @@ impl SpendDescriptionInfo { fn build( self, - anchor: Option, + anchor: bls12_381::Scalar, ) -> Result>, Error> { - let anchor = anchor.expect("Sapling anchor must be set if Sapling spends are present."); - // Construct the value commitment. let cv = ValueCommitment::derive(self.note.value(), self.rcv.clone()); @@ -471,7 +469,12 @@ impl SaplingBuilder { // Create the unauthorized Spend and Output descriptions. let shielded_spends = spend_infos .into_iter() - .map(|a| a.build::(self.anchor)) + .map(|a| { + a.build::( + self.anchor + .expect("Sapling anchor must be set if Sapling spends are present."), + ) + }) .collect::, _>>()?; let shielded_outputs = output_infos .into_iter()