-
Notifications
You must be signed in to change notification settings - Fork 228
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
Update to deprecations in ed25519 1.3 #1024
Conversation
The most recent release of ed25519 API deprecates the standalone SIGNATURE_LENGTH constant in favor of the Signature::BYTE_SIZE associated item. Also, the Signature::new constructor is deprecated in favor of Signature::from_bytes. Update the code to not trigger the deprecation lints. In turn, deprecate what was formerly the reexport of that constant in the tendermint API.
Codecov Report
@@ Coverage Diff @@
## master #1024 +/- ##
========================================
- Coverage 66.1% 66.0% -0.1%
========================================
Files 209 209
Lines 20764 20760 -4
========================================
- Hits 13726 13719 -7
- Misses 7038 7041 +3
Continue to review full report at Codecov.
|
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.
Sweet, thanks @mzabaluev! Will leave it to @thanethomson to take another look and do the merge.
@@ -159,6 +158,7 @@ impl Vote { | |||
} | |||
|
|||
/// Default trait. Used in tests. | |||
// FIXME: Does it need to be in public crate API? If not, replace with a helper fn in crate::test? |
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.
To expand on this: it's probably not useful for non-test API users to have a Default
impl for Vote
, and there is potential for inadvertent misuse that is hard to audit for.
For test users, a dedicated helper fn would serve just as well, unless there are some commonly used cases that are more ergonomic with a Default
impl. The dedicated function will be easy to find in code.
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.
Agreed, a dedicated helper fn sounds like the way to go. As far as I can tell this Default
instance is only used in this one test (both directly via Vote::default()
and indirectly via ..Default::default
):
fn test_sign_bytes_compatibility() { |
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.
Tracked in #1025
Can you please merge this? It's blocking my build. |
Fixes: #1023
As of release 1.3.0,
ed25519
deprecates the standaloneSIGNATURE_LENGTH
constant in favor of theSignature::BYTE_SIZE
associated item. Also, theSignature::new
constructor is deprecated in favor ofSignature::from_bytes
.Update the code to not trigger the deprecation lints.
In turn, deprecate what was formerly the reexport of that constant in the tendermint API.
Updated all relevant documentation in docsWrote tests- pure refactoring, exercised by existing tests..changelog/