-
Notifications
You must be signed in to change notification settings - Fork 52
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
Implement macro for Digest
creation from long hex string
#984
Conversation
|
||
// KERNEL V0 PROCEDURES | ||
// ================================================================================================ | ||
|
||
/// Hashes of all dynamically executed procedures from the kernel 0. | ||
pub const KERNEL0_PROCEDURES: [Digest; 32] = [ | ||
// account_vault_add_asset | ||
digest!(0xa9fe41a58d609bc6, 0xca49c09c352213a4, 0x30f55868815fc5, 0x84f2f2540b3d335e), | ||
digest_from_hex!("0xc69b608da541fea9a41322359cc049cac55f816858f530005e333d0b54f2f284"), |
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.
Should there be a test for these macros and its validations? Maybe comparing the old digest macro with the new one as well
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.
I thought about it, but in fact every test which internally uses the kernel procedures is checking the correctness of this macro, otherwise it will fail. That's why I wasn't sure whether do we need to create a dedicated tests for this macro.
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.
Looks good! Thank you! I left a few small comments/questions inline.
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.
Looks good to me!
objects/src/lib.rs
Outdated
mut hex_bytes: &[u8], | ||
mut upper_limit: usize, |
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.
mut hex_bytes: &[u8], | |
mut upper_limit: usize, | |
hex_bytes: &[u8], | |
upper_limit: usize, |
Nit: These don't need to be mutable.
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.
All looks good! Thank you!
This PR implements a new
digest_from_hex!
macro for convenient creation ofDigest
from long hex string.Closes: #872