Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit f28e192

Browse files
committed
Merge branch 'master' of github.com:paritytech/substrate into a-fix-sync
2 parents 7e1ec28 + a86bb37 commit f28e192

File tree

118 files changed

+4860
-2788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4860
-2788
lines changed

Cargo.lock

Lines changed: 80 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ members = [
2929
"core/rpc",
3030
"core/rpc/primitives",
3131
"core/rpc-servers",
32+
"core/runtime-interface",
33+
"core/runtime-interface/proc-macro",
34+
"core/runtime-interface/test-wasm",
3235
"core/serializer",
3336
"core/service",
3437
"core/service/test",

core/application-crypto/src/ed25519.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
1919
use crate::{RuntimePublic, KeyTypeId};
2020

21+
use rstd::vec::Vec;
22+
2123
pub use primitives::ed25519::*;
2224

2325
mod app {
@@ -29,28 +31,27 @@ mod app {
2931
}
3032
}
3133

32-
pub use app::Public as AppPublic;
33-
pub use app::Signature as AppSignature;
34+
pub use app::{Public as AppPublic, Signature as AppSignature};
3435
#[cfg(feature = "full_crypto")]
3536
pub use app::Pair as AppPair;
3637

3738
impl RuntimePublic for Public {
3839
type Signature = Signature;
3940

4041
fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
41-
runtime_io::ed25519_public_keys(key_type)
42+
runtime_io::crypto::ed25519_public_keys(key_type)
4243
}
4344

44-
fn generate_pair(key_type: KeyTypeId, seed: Option<&str>) -> Self {
45-
runtime_io::ed25519_generate(key_type, seed)
45+
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
46+
runtime_io::crypto::ed25519_generate(key_type, seed)
4647
}
4748

4849
fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
49-
runtime_io::ed25519_sign(key_type, self, msg.as_ref())
50+
runtime_io::crypto::ed25519_sign(key_type, self, msg.as_ref())
5051
}
5152

5253
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
53-
runtime_io::ed25519_verify(&signature, msg.as_ref(), self)
54+
runtime_io::crypto::ed25519_verify(&signature, msg.as_ref(), self)
5455
}
5556
}
5657

core/application-crypto/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ macro_rules! app_crypto_public_common {
286286
<$public as $crate::RuntimePublic>::all($key_type).into_iter().map(Self).collect()
287287
}
288288

289-
fn generate_pair(seed: Option<&str>) -> Self {
289+
fn generate_pair(seed: Option<$crate::Vec<u8>>) -> Self {
290290
Self(<$public as $crate::RuntimePublic>::generate_pair($key_type, seed))
291291
}
292292

core/application-crypto/src/sr25519.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
1919
use crate::{RuntimePublic, KeyTypeId};
2020

21+
use rstd::vec::Vec;
22+
2123
pub use primitives::sr25519::*;
2224

2325
mod app {
@@ -29,28 +31,27 @@ mod app {
2931
}
3032
}
3133

32-
pub use app::Public as AppPublic;
33-
pub use app::Signature as AppSignature;
34+
pub use app::{Public as AppPublic, Signature as AppSignature};
3435
#[cfg(feature = "full_crypto")]
3536
pub use app::Pair as AppPair;
3637

3738
impl RuntimePublic for Public {
3839
type Signature = Signature;
3940

4041
fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
41-
runtime_io::sr25519_public_keys(key_type)
42+
runtime_io::crypto::sr25519_public_keys(key_type)
4243
}
4344

44-
fn generate_pair(key_type: KeyTypeId, seed: Option<&str>) -> Self {
45-
runtime_io::sr25519_generate(key_type, seed)
45+
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
46+
runtime_io::crypto::sr25519_generate(key_type, seed)
4647
}
4748

4849
fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
49-
runtime_io::sr25519_sign(key_type, self, msg.as_ref())
50+
runtime_io::crypto::sr25519_sign(key_type, self, msg.as_ref())
5051
}
5152

5253
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
53-
runtime_io::sr25519_verify(&signature, msg.as_ref(), self)
54+
runtime_io::crypto::sr25519_verify(&signature, msg.as_ref(), self)
5455
}
5556
}
5657

0 commit comments

Comments
 (0)