Skip to content

Commit

Permalink
polkadot-v0.9.29 版本简单加入sm2
Browse files Browse the repository at this point in the history
  • Loading branch information
魏浩哲 committed Feb 2, 2023
1 parent cc370aa commit c009d22
Show file tree
Hide file tree
Showing 8 changed files with 650 additions and 3 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion bin/node-template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use node_template_runtime::{
};
use sc_service::ChainType;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{sr25519, Pair, Public};
use sp_core::{sr25519, sm2, Pair, Public};
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::traits::{IdentifyAccount, Verify};

Expand Down Expand Up @@ -58,6 +58,8 @@ pub fn development_config() -> Result<ChainSpec, String> {
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sm2::Public>("Test"),
get_account_id_from_seed::<sm2::Public>("Test//stash"),
],
true,
)
Expand Down
2 changes: 2 additions & 0 deletions primitives/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ merlin = { version = "2.0", default-features = false, optional = true }
secp256k1 = { version = "0.24.0", default-features = false, features = ["recovery", "alloc"], optional = true }
ss58-registry = { version = "1.18.0", default-features = false }
sp-core-hashing = { version = "4.0.0", path = "./hashing", default-features = false, optional = true }
libsm = { package = "cryptape-sm", git = "https://github.com/hammeWang/libsm.git", rev = "a85974c", optional = true }
sp-runtime-interface = { version = "6.0.0", default-features = false, path = "../runtime-interface" }

[dev-dependencies]
Expand Down Expand Up @@ -121,6 +122,7 @@ std = [
"futures/thread-pool",
"libsecp256k1/std",
"dyn-clonable",
"libsm",
]

# This feature enables all crypto primitives for `no_std` builds like microcontrollers
Expand Down
1 change: 1 addition & 0 deletions primitives/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub mod crypto;
pub mod hexdisplay;

pub mod defer;
pub mod sm2;
pub mod ecdsa;
pub mod ed25519;
pub mod hash;
Expand Down
Loading

0 comments on commit c009d22

Please sign in to comment.