-
Notifications
You must be signed in to change notification settings - Fork 227
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
RPC: Update hash to 32 byte value. #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ use subtle::{self, ConstantTimeEq}; | |
use subtle_encoding::hex; | ||
|
||
/// Size of a transaction hash in bytes | ||
pub const LENGTH: usize = 20; | ||
pub const LENGTH: usize = 32; | ||
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 introduced HASH_SIZE in https://github.com/interchainio/tendermint-rs/blob/master/src/merkle.rs#L6 ... we'll need to de-duplicate eventually but for now it's fine .... |
||
|
||
/// Trannsaction hashes | ||
#[derive(Copy, Clone, Hash)] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ mod endpoints { | |
|
||
assert_eq!( | ||
&response.hash.to_string(), | ||
"E39AAB7A537ABAA237831742DCE1117F187C3C52" | ||
"88D4266FD4E6338D13B845FCF289579D209C897823B9217DA3E161936F031589" | ||
); | ||
} | ||
|
||
|
@@ -127,7 +127,7 @@ mod endpoints { | |
|
||
assert_eq!( | ||
&response.hash.to_string(), | ||
"0D33F2F03A5234F38706E43004489E061AC40A2E" | ||
"88D4266FD4E6338D13B845FCF289579D209C897823B9217DA3E161936F031589" | ||
); | ||
} | ||
|
||
|
@@ -142,7 +142,7 @@ mod endpoints { | |
|
||
assert_eq!( | ||
&response.hash.to_string(), | ||
"0D33F2F03A5234F38706E43004489E061AC40A2E" | ||
"88D4266FD4E6338D13B845FCF289579D209C897823B9217DA3E161936F031589" | ||
); | ||
} | ||
|
||
|
@@ -155,7 +155,7 @@ mod endpoints { | |
|
||
assert_eq!( | ||
&response.hash.to_string(), | ||
"75CA0F856A4DA078FC4911580360E70CEFB2EBEE" | ||
"88D4266FD4E6338D13B845FCF289579D209C897823B9217DA3E161936F031589" | ||
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. Do the values of these not matter at all? 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. As I understand, these tests only check that parsing work correctly, and do not test the actual correctness of the hash. 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.
That's right |
||
); | ||
} | ||
|
||
|
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.
Why did this change?
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.
For better readability.
This is related to a previous PR #13
In either cases
visit_u64
method is called, so thought it would be better if it is explicit in the code.