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

Make helium-crypto-rs compilable with the latest ed25519-compact version #69

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

kurotych
Copy link
Member

@kurotych kurotych commented Feb 5, 2024

Fix compiling issue

❯ cargo build
   Compiling helium-crypto v0.8.3 (/home/kurotych/Sources/helium-crypto-rs)
error[E0277]: the trait bound `ed25519_compact::Signature: signature::Signature` is not satisfied
   --> src/ed25519/mod.rs:103:22
    |
103 |         Ok(Signature(signature::Signature::from_bytes(input)?))
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `signature::Signature` is not implemented for `ed25519_compact::Signature`
    |
    = help: the following other types implement trait `signature::Signature`:
              ecdsa::der::Signature<C>
              ecdsa::Signature<C>
              ecc_compact::Signature
              ed25519::Signature
              secp256k1::Signature
              k256::ecdsa::recoverable::Signature

error[E0599]: no method named `as_bytes` found for struct `ed25519_compact::Signature` in the current scope
   --> src/ed25519/mod.rs:107:16
    |
107 |         self.0.as_bytes()
    |                ^^^^^^^^ method not found in `Signature`

error[E0277]: the trait bound `ed25519_compact::Signature: signature::Signature` is not satisfied
   --> src/ed25519/mod.rs:141:22
    |
141 |         Ok(Signature(signature::Signature::from_bytes(bytes)?))
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `signature::Signature` is not implemented for `ed25519_compact::Signature`
    |
    = help: the following other types implement trait `signature::Signature`:
              ecdsa::der::Signature<C>
              ecdsa::Signature<C>
              ecc_compact::Signature
              ed25519::Signature
              secp256k1::Signature
              k256::ecdsa::recoverable::Signature

error[E0277]: the trait bound `ed25519_compact::Signature: signature::Signature` is not satisfied
   --> src/ed25519/mod.rs:153:9
    |
153 |         signature::Signature::from_bytes(input)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `signature::Signature` is not implemented for `ed25519_compact::Signature`
    |
    = help: the following other types implement trait `signature::Signature`:
              ecdsa::der::Signature<C>
              ecdsa::Signature<C>
              ecc_compact::Signature
              ed25519::Signature
              secp256k1::Signature
              k256::ecdsa::recoverable::Signature

Cargo.toml Outdated
@@ -18,7 +18,7 @@ serde = { version = "1", features = ["derive"] }
rand_core = "^0.6"
getrandom = "0"
sha2 = { version = "0.10", default-features = false, features = ["std", "oid"] }
ed25519-compact = { version = "2", features = ["std", "traits"] }
ed25519-compact = { version = "=2.0.6", features = ["std", "traits"] }
Copy link
Member

Choose a reason for hiding this comment

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

Instead of pinning can you fix the issue so we don’t have to keep the ed crate in the past?

Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of pinning can you fix the issue so we don’t have to keep the ed crate in the past?

Ok will try to do that

@kurotych kurotych changed the title Fix compiling issue. Use ed25519-compact 2.0.6 version Make helium-crypto-rs compilable with the latest ed25519-compact version Feb 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (0b855d4) 68.70% compared to head (0be3c41) 67.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   68.70%   67.63%   -1.08%     
==========================================
  Files          12       12              
  Lines         898      862      -36     
==========================================
- Hits          617      583      -34     
+ Misses        281      279       -2     
Files Coverage Δ
src/ed25519/mod.rs 77.92% <14.28%> (-4.23%) ⬇️

... and 7 files with indirect coverage changes

@kurotych kurotych force-pushed the kurotych-patch-1 branch 2 times, most recently from 50c1345 to 642b113 Compare February 5, 2024 16:07
@kurotych
Copy link
Member Author

kurotych commented Feb 5, 2024

@madninja Looks ready. I intentionally used ed25519 compact::Signature::try_from for all trait functions to have more explicit solution

@madninja madninja merged commit 79d1f90 into helium:main Feb 5, 2024
2 checks passed
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