Merge pull request #111 from nuttycom/api_cleanup

Various API cleanups
This commit is contained in:
Kris Nuttycombe 2023-12-14 13:14:29 -07:00 committed by GitHub
commit b0a8838f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -93,10 +93,8 @@ impl SpendDescriptionInfo {
fn build<Pr: SpendProver>(
self,
anchor: Option<bls12_381::Scalar>,
anchor: bls12_381::Scalar,
) -> Result<SpendDescription<InProgress<Unproven, Unsigned>>, 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::<SP>(self.anchor))
.map(|a| {
a.build::<SP>(
self.anchor
.expect("Sapling anchor must be set if Sapling spends are present."),
)
})
.collect::<Result<Vec<_>, _>>()?;
let shielded_outputs = output_infos
.into_iter()