Rename: primitives/sr-io -> primitives/sp-io (#4328)

* primitives/sr-io -> primitives/io

* fix

* rename

* runtime-io -> sp-io

* git mv

* fix ci

* remove package name

* fix

* fix

* try minimizing diff

* try minimizing diff again

* try minimizing diff again
This commit is contained in:
Weiliang Li
2019-12-11 00:08:35 +09:00
committed by Bastian Köcher
parent 1f84d6d41d
commit 4f2cdb20c1
134 changed files with 312 additions and 315 deletions
@@ -10,7 +10,7 @@ primitives = { package = "sp-core", path = "../core", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sp-std = { path = "../std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-io = { path = "../../primitives/io", default-features = false }
[dev-dependencies]
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
@@ -18,7 +18,7 @@ sp-runtime = { path = "../../primitives/runtime" }
[features]
default = [ "std" ]
std = [ "full_crypto", "primitives/std", "codec/std", "serde", "sp-std/std", "runtime-io/std" ]
std = [ "full_crypto", "primitives/std", "codec/std", "serde", "sp-std/std", "sp-io/std" ]
# This feature enables all crypto primitives for `no_std` builds like microcontrollers
# or Intel SGX.
@@ -39,19 +39,19 @@ impl RuntimePublic for Public {
type Signature = Signature;
fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
runtime_io::crypto::ed25519_public_keys(key_type)
sp_io::crypto::ed25519_public_keys(key_type)
}
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
runtime_io::crypto::ed25519_generate(key_type, seed)
sp_io::crypto::ed25519_generate(key_type, seed)
}
fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
runtime_io::crypto::ed25519_sign(key_type, self, msg.as_ref())
sp_io::crypto::ed25519_sign(key_type, self, msg.as_ref())
}
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
runtime_io::crypto::ed25519_verify(&signature, msg.as_ref(), self)
sp_io::crypto::ed25519_verify(&signature, msg.as_ref(), self)
}
}
@@ -39,19 +39,19 @@ impl RuntimePublic for Public {
type Signature = Signature;
fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
runtime_io::crypto::sr25519_public_keys(key_type)
sp_io::crypto::sr25519_public_keys(key_type)
}
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
runtime_io::crypto::sr25519_generate(key_type, seed)
sp_io::crypto::sr25519_generate(key_type, seed)
}
fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
runtime_io::crypto::sr25519_sign(key_type, self, msg.as_ref())
sp_io::crypto::sr25519_sign(key_type, self, msg.as_ref())
}
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
runtime_io::crypto::sr25519_verify(&signature, msg.as_ref(), self)
sp_io::crypto::sr25519_verify(&signature, msg.as_ref(), self)
}
}