-
Notifications
You must be signed in to change notification settings - Fork 23
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
Poc microcrate account #972
Changes from all commits
f05a221
ef4103f
1c05522
02fd025
4851d24
a15ea15
3b86bee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ members = [ | |
"zingo-testvectors", | ||
"zingo-netutils", | ||
"zingo-memo", | ||
"zingo-account", | ||
] | ||
resolver = "2" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "zingo-account" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
zcash_keys.workspace = true | ||
zcash_client_backend.workspace = true | ||
zip32.workspace = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! A micro crate to provide a wrapper around the zcash_client_backend account trait. | ||
//! By constraining the wrapper to be independent of internal zingolib functionality | ||
//! we expose a shareable component, and refine the definition of zingolib. | ||
|
||
/// The a view-only abstraction that provides a management interface for | ||
/// TODO: Explain more about our Account abstraction. | ||
pub struct ZingoAccount( | ||
pub zip32::AccountId, | ||
pub zcash_keys::keys::UnifiedFullViewingKey, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think we should make fields pub unless there is a really good reason? is there one? |
||
); | ||
|
||
impl zcash_client_backend::data_api::Account<zip32::AccountId> for ZingoAccount { | ||
fn id(&self) -> zip32::AccountId { | ||
self.0 | ||
} | ||
|
||
fn source(&self) -> zcash_client_backend::data_api::AccountSource { | ||
unimplemented!() | ||
} | ||
|
||
fn ufvk(&self) -> Option<&zcash_keys::keys::UnifiedFullViewingKey> { | ||
Some(&self.1) | ||
} | ||
|
||
fn uivk(&self) -> zcash_keys::keys::UnifiedIncomingViewingKey { | ||
unimplemented!() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The a view-only" is a typo? also comment seems to just ...end. I am ok to chalk that up to the TODO if you want