Skip to content
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

Merged
merged 8 commits into from
Mar 7, 2019
Merged

Initial primitives refactor #65

merged 8 commits into from
Mar 7, 2019

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Feb 26, 2019

See commit messages for the individual changes.

@str4d str4d changed the title General refactor Initial primitives refactor Feb 26, 2019
@str4d str4d requested a review from ebfull March 6, 2019 19:05
extern crate zcash_proofs;
extern crate zip32;

mod hashreader;

#[macro_use]
extern crate lazy_static;
Copy link
Collaborator

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?

Copy link
Contributor Author

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!(
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK

@str4d str4d merged commit e4187f0 into zcash:master Mar 7, 2019
@str4d str4d deleted the general-refactor branch March 7, 2019 20:01
@str4d str4d added this to the v0.1.0 milestone Aug 22, 2019
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.

3 participants