diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 71de708b31..d8e0398203 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -15,7 +15,7 @@ description = "Sign extrinsics to be submitted by Subxt" keywords = ["parity", "subxt", "extrinsic", "signer"] [features] -default = ["sr25519", "ecdsa", "subxt"] +default = ["sr25519", "ecdsa", "subxt", "native"] # Pick the signer implementation(s) you need by enabling the # corresponding features. Note: I had more difficulties getting @@ -30,11 +30,12 @@ subxt = ["dep:subxt"] # The getrandom package is used via schnorrkel. We need to enable the JS # feature on it if compiling for the web. -web = ["getrandom/js"] +web = ["getrandom/js", "subxt?/web"] +native = ["subxt?/native"] [dependencies] +subxt = { workspace = true, optional = true, default-features = false } regex = { workspace = true } -subxt = { workspace = true, optional = true } hex = { workspace = true } codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] } sp-core-hashing = { workspace = true } diff --git a/signer/src/lib.rs b/signer/src/lib.rs index 846d95d36b..dbba7e1468 100644 --- a/signer/src/lib.rs +++ b/signer/src/lib.rs @@ -38,3 +38,8 @@ pub use secrecy::{ExposeSecret, SecretString}; // SecretUri's can be parsed from strings and used to generate key pairs. // DeriveJunctions are the "path" part of these SecretUris. pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE}; + +#[cfg(all( + feature = "subxt", not(any(feature = "web", feature = "native")) +))] +compile_error!("subxt-signer: When using the 'subxt' feature, exactly one of the 'web' and 'native' features should be used."); \ No newline at end of file