Skip to content

Commit

Permalink
Do not include libsecp256k1 on Windows (#1069)
Browse files Browse the repository at this point in the history
* Do not include `libsecp256k1` on Windows

* Apply suggestions from code review

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
  • Loading branch information
Michael Müller and HCastano authored Dec 8, 2021
1 parent b151f57 commit 7a4307f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/eth_compatibility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ include = ["Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]

[dependencies]
ink_env = { version = "3.0.0-rc7", path = "../env", default-features = false }

[target.'cfg(not(target_os = "windows"))'.dependencies]
# We do not include `libsecp256k1` on Windows, since it's incompatible.
# We have https://github.com/paritytech/ink/issues/1068 for removing
# this dependency altogether.
libsecp256k1 = { version = "0.7.0", default-features = false }

[features]
Expand Down
5 changes: 5 additions & 0 deletions crates/eth_compatibility/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ impl ECDSAPublicKey {
///
/// assert_eq!(pub_key.to_eth_address().as_ref(), EXPECTED_ETH_ADDRESS.as_ref());
/// ```
// We do not include this function on Windows, since it depends on `libsecp256k1`,
// which is incompatible with Windows.
// We have https://github.com/paritytech/ink/issues/1068 for removing this
// dependency altogether.
#[cfg(not(target_os = "windows"))]
pub fn to_eth_address(&self) -> EthereumAddress {
use ink_env::hash;
use libsecp256k1::PublicKey;
Expand Down

0 comments on commit 7a4307f

Please sign in to comment.