Skip to content

Commit

Permalink
Broaden Authorizations from `SpendDescriptionV5::into_spend_descrip…
Browse files Browse the repository at this point in the history
…tion`

This enables the method to be used with bundles that have spend auth
signatures and proofs, but not yet binding signatures.
  • Loading branch information
str4d committed Oct 12, 2024
1 parent 0de2402 commit dd0a91a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this library adheres to Rust's notion of

## [Unreleased]

### Changed
- `sapling_crypto::bundle::SpendDescriptionV5::into_spend_description` now
supports any `Authorization` for which the `SpendDescription` itself is fully
authorized.

## [0.3.0] - 2024-10-02

### Changed
Expand Down
7 changes: 5 additions & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,15 @@ impl SpendDescriptionV5 {
Self { cv, nullifier, rk }
}

pub fn into_spend_description(
pub fn into_spend_description<A>(
self,
anchor: bls12_381::Scalar,
zkproof: GrothProofBytes,
spend_auth_sig: redjubjub::Signature<SpendAuth>,
) -> SpendDescription<Authorized> {
) -> SpendDescription<A>
where
A: Authorization<SpendProof = GrothProofBytes, AuthSig = redjubjub::Signature<SpendAuth>>,
{
SpendDescription {
cv: self.cv,
anchor,
Expand Down

0 comments on commit dd0a91a

Please sign in to comment.