-
Notifications
You must be signed in to change notification settings - Fork 250
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
Initial primitives refactor #65
Conversation
extern crate zcash_proofs; | ||
extern crate zip32; | ||
|
||
mod hashreader; | ||
|
||
#[macro_use] | ||
extern crate lazy_static; |
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.
Are we using anything from lazy_static
now in the librustzcash
crate?
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.
We call lazy_static::initialize(&JUBJUB)
in librustzcash_init_zksnark_params()
. If there's a better place to do this, e.g. as an explicit initialization function in zcash_primitives
, then we could remove this dependency.
@@ -48,6 +49,41 @@ pub struct TransactionData { | |||
pub binding_sig: Option<Signature>, | |||
} | |||
|
|||
impl std::fmt::Debug for TransactionData { | |||
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { | |||
write!( |
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.
Alternatively could be written in the form:
write!(
f,
"TransactionData(
overwintered: {overwintered:?},
version: {version:?})",
overwintered=self.overwintered,
version=self.version,
)
but because each field is used only once in the format, I don't think this needs to be changed from how it currently is.
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.
Ah, I hadn't stumbled on this form yet. I'll keep it in mind for future changes.
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.
utACK
See commit messages for the individual changes.