zcash / orchard

Implementation of the Zcash Orchard Protocol
https://zcash.github.io/orchard/
Other
54 stars 39 forks source link

Allow creating notes from serialized parts #346

Closed adityapk00 closed 2 years ago

adityapk00 commented 2 years ago

Allow creating an Orchard Note from serialized parts.

When lightclients parse Orchard actions, they need to serialize the notes into the wallet to be able to spend them at a later time. Right now, the Note's constructors are all pub(crate). This PR allows constructing a Note from its components.

It is possible I'm misunderstanding how Notes are managed, so if there's another way a lightwallet is supposed to store/load/serialize Orchard notes, please let me know.

AloeareV commented 2 years ago

I'm not aware of another way, hence #344.

codecov-commenter commented 2 years ago

Codecov Report

Merging #346 (a29a468) into main (3faab98) will decrease coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #346      +/-   ##
==========================================
- Coverage   88.90%   88.83%   -0.07%     
==========================================
  Files          37       38       +1     
  Lines        3858     3861       +3     
==========================================
  Hits         3430     3430              
- Misses        428      431       +3     
Impacted Files Coverage Δ
src/note.rs 88.40% <100.00%> (ø)
src/lib.rs 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

str4d commented 2 years ago

This is a strict subset of #344; we'll focus our API review there.