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 implementation of Serialize trait for Account #257

Merged
merged 16 commits into from
May 8, 2024
Merged

Conversation

LogvinovLeon
Copy link
Collaborator

@LogvinovLeon LogvinovLeon commented May 6, 2024

In order to verify recursive proofs - we need to present our structure arguments as a field array.
This PR introduces the Serialize trait & implements it on AccountWithinBlock, Account, U128 and Bytes32 with tests.

Noir has it planned, but it's not implemented yet: noir-lang/noir#3379


pub fn extend_back<LEN>(&mut self, other: [T; LEN]) {
for i in 0..LEN {
self.push_back(other[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Beauty <3 love how our Fragment is growing up

}
}

global ACCOUNT_WITHIN_BLOCK_SERIALIZED_LEN = ACCOUNT_SERIALIZED_LEN + BYTES32_LENGTH;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it mean adding globals to use in generics now works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. But arithmetic on generics still does not

@LogvinovLeon LogvinovLeon merged commit 5b7e44b into main May 8, 2024
6 checks passed
@LogvinovLeon LogvinovLeon deleted the leo/serde branch May 8, 2024 11:33
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