mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-24 02:01:06 +00:00
Add subxt feature in subxt-signer crate to default features (#1193)
* add subxt to subxt-signer default features * distinguish between native and web in signer * fix formatting and clippy * rustfmt
This commit is contained in:
@@ -7,7 +7,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
subxt = { path = "../../subxt" }
|
subxt = { path = "../../subxt" }
|
||||||
subxt-signer = { path = "../../signer", features = ["subxt"] }
|
subxt-signer = { path = "../../signer" }
|
||||||
futures = { version = "0.3.27", default-features = false, features = ["std"] }
|
futures = { version = "0.3.27", default-features = false, features = ["std"] }
|
||||||
tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"] }
|
tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"] }
|
||||||
sp-core = "21.0.0"
|
sp-core = "21.0.0"
|
||||||
|
|||||||
+4
-3
@@ -15,7 +15,7 @@ description = "Sign extrinsics to be submitted by Subxt"
|
|||||||
keywords = ["parity", "subxt", "extrinsic", "signer"]
|
keywords = ["parity", "subxt", "extrinsic", "signer"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["sr25519", "ecdsa"]
|
default = ["sr25519", "ecdsa", "subxt", "native"]
|
||||||
|
|
||||||
# Pick the signer implementation(s) you need by enabling the
|
# Pick the signer implementation(s) you need by enabling the
|
||||||
# corresponding features. Note: I had more difficulties getting
|
# 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
|
# The getrandom package is used via schnorrkel. We need to enable the JS
|
||||||
# feature on it if compiling for the web.
|
# feature on it if compiling for the web.
|
||||||
web = ["getrandom/js"]
|
web = ["getrandom/js", "subxt?/web"]
|
||||||
|
native = ["subxt?/native"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
subxt = { workspace = true, optional = true, default-features = false }
|
||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
subxt = { workspace = true, optional = true }
|
|
||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
|
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
|
||||||
sp-core-hashing = { workspace = true }
|
sp-core-hashing = { workspace = true }
|
||||||
|
|||||||
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
# Subxt-signer
|
# Subxt-signer
|
||||||
|
|
||||||
This library exposes a small, WASM compatible signer implementation which can be used in conjunction with Subxt to sign transactions.
|
This library exposes a small, WASM compatible signer implementation which can be used in conjunction with Subxt to sign transactions.
|
||||||
|
|
||||||
|
This library can be used without Subxt by disabling the `subxt` feature flag, which is enabled by default.
|
||||||
|
|||||||
@@ -38,3 +38,6 @@ pub use secrecy::{ExposeSecret, SecretString};
|
|||||||
// SecretUri's can be parsed from strings and used to generate key pairs.
|
// SecretUri's can be parsed from strings and used to generate key pairs.
|
||||||
// DeriveJunctions are the "path" part of these SecretUris.
|
// DeriveJunctions are the "path" part of these SecretUris.
|
||||||
pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE};
|
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.");
|
||||||
|
|||||||
+1
-1
@@ -103,7 +103,7 @@ sp-core = { workspace = true }
|
|||||||
sp-keyring = { workspace = true }
|
sp-keyring = { workspace = true }
|
||||||
sp-runtime = { workspace = true }
|
sp-runtime = { workspace = true }
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
subxt-signer = { path = "../signer", features = ["subxt"] }
|
subxt-signer = { path = "../signer" }
|
||||||
# Tracing subscriber is useful for light-client examples to ensure that
|
# Tracing subscriber is useful for light-client examples to ensure that
|
||||||
# the `bootNodes` and chain spec are configured correctly. If all is fine, then
|
# the `bootNodes` and chain spec are configured correctly. If all is fine, then
|
||||||
# the light-client wlll emit INFO logs with
|
# the light-client wlll emit INFO logs with
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ scale-info = { workspace = true, features = ["bit-vec"] }
|
|||||||
sp-core = { workspace = true }
|
sp-core = { workspace = true }
|
||||||
syn = { workspace = true }
|
syn = { workspace = true }
|
||||||
subxt = { workspace = true, features = ["unstable-metadata", "native", "jsonrpsee", "substrate-compat"] }
|
subxt = { workspace = true, features = ["unstable-metadata", "native", "jsonrpsee", "substrate-compat"] }
|
||||||
subxt-signer = { workspace = true, features = ["subxt"] }
|
subxt-signer = { workspace = true }
|
||||||
subxt-codegen = { workspace = true }
|
subxt-codegen = { workspace = true }
|
||||||
subxt-metadata = { workspace = true }
|
subxt-metadata = { workspace = true }
|
||||||
test-runtime = { workspace = true }
|
test-runtime = { workspace = true }
|
||||||
|
|||||||
@@ -210,10 +210,7 @@ async fn chainhead_unstable_unpin() {
|
|||||||
};
|
};
|
||||||
let sub_id = blocks.subscription_id().unwrap();
|
let sub_id = blocks.subscription_id().unwrap();
|
||||||
|
|
||||||
assert!(rpc
|
assert!(rpc.chainhead_unstable_unpin(sub_id, hash).await.is_ok());
|
||||||
.chainhead_unstable_unpin(sub_id.clone(), hash)
|
|
||||||
.await
|
|
||||||
.is_ok());
|
|
||||||
// The block was already unpinned.
|
// The block was already unpinned.
|
||||||
assert!(rpc.chainhead_unstable_unpin(sub_id, hash).await.is_err());
|
assert!(rpc.chainhead_unstable_unpin(sub_id, hash).await.is_err());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,7 @@ trybuild = { workspace = true }
|
|||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
scale-info = { workspace = true, features = ["bit-vec"] }
|
scale-info = { workspace = true, features = ["bit-vec"] }
|
||||||
frame-metadata = { workspace = true }
|
frame-metadata = { workspace = true }
|
||||||
codec = { package = "parity-scale-codec", workspace = true, features = [
|
codec = { package = "parity-scale-codec", workspace = true, features = ["derive", "bit-vec"] }
|
||||||
"derive",
|
|
||||||
"bit-vec",
|
|
||||||
] }
|
|
||||||
subxt = { workspace = true, features = ["native", "jsonrpsee"] }
|
subxt = { workspace = true, features = ["native", "jsonrpsee"] }
|
||||||
subxt-metadata = { workspace = true }
|
subxt-metadata = { workspace = true }
|
||||||
generate-custom-metadata = { path = "../generate-custom-metadata" }
|
generate-custom-metadata = { path = "../generate-custom-metadata" }
|
||||||
|
|||||||
Reference in New Issue
Block a user