forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for
keyring
in runtimes (paritytech#2044)
This functionality is required for paritytech#1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306282e3de848a09c9aa9cba6f95a7811f0/substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on rust-bitcoin/rust-bip39#57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
- Loading branch information
1 parent
688c25b
commit b764deb
Showing
28 changed files
with
193 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
substrate/primitives/application-crypto/check-features-variants.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env -S bash -eux | ||
|
||
export RUSTFLAGS="-Cdebug-assertions=y -Dwarnings" | ||
T=wasm32-unknown-unknown | ||
cargo check --release | ||
cargo check --release --target=$T --no-default-features | ||
cargo check --release --target=$T --no-default-features --features="full_crypto" | ||
cargo check --release --target=$T --no-default-features --features="serde" | ||
cargo check --release --target=$T --no-default-features --features="serde,full_crypto" | ||
cargo check --release --target=$T --no-default-features --features="bandersnatch-experimental" | ||
cargo check --release --target=$T --no-default-features --features="bls-experimental" | ||
cargo check --release --target=$T --no-default-features --features="bls-experimental,full_crypto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env -S bash -eux | ||
|
||
export RUSTFLAGS="-Cdebug-assertions=y -Dwarnings" | ||
T=wasm32-unknown-unknown | ||
|
||
cargo check --target=$T --release --no-default-features --features="bls-experimental" | ||
cargo check --target=$T --release --no-default-features --features="full_crypto,bls-experimental" | ||
cargo check --target=$T --release --no-default-features --features="bandersnatch-experimental" | ||
cargo check --target=$T --release --no-default-features --features="full_crypto,serde,bandersnatch-experimental" | ||
cargo check --target=$T --release --no-default-features --features="full_crypto,serde" | ||
cargo check --target=$T --release --no-default-features --features="full_crypto" | ||
cargo check --target=$T --release --no-default-features --features="serde" | ||
cargo check --target=$T --release --no-default-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.