Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various API cleanups #111

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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()
Expand Down
Loading