Skip to content

Minimal API changes for Issuance in Client#43

Merged
alexeykoren merged 5 commits intozsa1from
copy-trait-for-keys
Feb 9, 2023
Merged

Minimal API changes for Issuance in Client#43
alexeykoren merged 5 commits intozsa1from
copy-trait-for-keys

Conversation

@alexeykoren
Copy link

  • Added a Copy trait to be able to work with IssuanceAuthorizingKey and SigningKey in a same manner as with others
  • from_bytes made public for Client

@alexeykoren alexeykoren requested a review from PaulLaux February 6, 2023 10:34
Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with comments.

src/keys.rs Outdated
}

pub(crate) fn from_bytes(bytes: &[u8]) -> Option<Self> {
/// Creates a spend validating key from its serialized form
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Constructs an Orchard issuance validating key from uniformly-random bytes.
///
/// Returns `None` if the bytes do not correspond to a valid key .

Is better adjusted to the existing style.

tests/zsa.rs Outdated
.is_ok());

let issue_bundle = sign_issue_bundle(unauthorized, rng, keys.isk().clone());
let issue_bundle = sign_issue_bundle(unauthorized, rng, *keys.isk());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go with

let issue_bundle = sign_issue_bundle(unauthorized, rng, keys.isk());
...
fn sign_issue_bundle(
    unauthorized: IssueBundle<Unauthorized>,
    mut rng: OsRng,
    isk: &IssuanceAuthorizingKey,
) -> IssueBundle<Signed> {
    let sighash = unauthorized.commitment().into();
    let proven = unauthorized.prepare(sighash);
    proven.sign(&mut rng, isk).unwrap()
}

@QED-it QED-it deleted a comment from what-the-diff bot Feb 9, 2023
@alexeykoren alexeykoren merged commit 4e47677 into zsa1 Feb 9, 2023
@alexeykoren alexeykoren deleted the copy-trait-for-keys branch February 10, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants