mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
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:
committed by
Bastian Köcher
parent
1f84d6d41d
commit
4f2cdb20c1
@@ -12,7 +12,7 @@ primitives = { package="sp-core", path = "../../primitives/core", default-featur
|
||||
sp-std = { path = "../../primitives/std", default-features = false }
|
||||
serde = { version = "1.0.101", optional = true }
|
||||
session = { package = "pallet-session", path = "../session", default-features = false }
|
||||
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
|
||||
sp-io = { path = "../../primitives/io", default-features = false }
|
||||
sp-runtime = { path = "../../primitives/runtime", default-features = false }
|
||||
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
|
||||
support = { package = "frame-support", path = "../support", default-features = false }
|
||||
@@ -28,7 +28,7 @@ std = [
|
||||
"sp-std/std",
|
||||
"serde",
|
||||
"session/std",
|
||||
"runtime-io/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-staking/std",
|
||||
"support/std",
|
||||
|
||||
@@ -285,7 +285,7 @@ decl_module! {
|
||||
debug::RuntimeLogger::init();
|
||||
|
||||
// Only send messages if we are a potential validator.
|
||||
if runtime_io::offchain::is_validator() {
|
||||
if sp_io::offchain::is_validator() {
|
||||
Self::offchain(now);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +408,7 @@ impl<T: Trait> Module<T> {
|
||||
continue;
|
||||
}
|
||||
|
||||
let network_state = runtime_io::offchain::network_state()
|
||||
let network_state = sp_io::offchain::network_state()
|
||||
.map_err(|_| OffchainErr::NetworkState)?;
|
||||
let heartbeat_data = Heartbeat {
|
||||
block_number,
|
||||
@@ -453,7 +453,7 @@ impl<T: Trait> Module<T> {
|
||||
done,
|
||||
gossipping_at,
|
||||
};
|
||||
runtime_io::offchain::local_storage_compare_and_set(
|
||||
sp_io::offchain::local_storage_compare_and_set(
|
||||
StorageKind::PERSISTENT,
|
||||
DB_KEY,
|
||||
curr_worker_status,
|
||||
@@ -469,7 +469,7 @@ impl<T: Trait> Module<T> {
|
||||
done,
|
||||
gossipping_at,
|
||||
};
|
||||
runtime_io::offchain::local_storage_set(StorageKind::PERSISTENT, DB_KEY, &enc.encode());
|
||||
sp_io::offchain::local_storage_set(StorageKind::PERSISTENT, DB_KEY, &enc.encode());
|
||||
}
|
||||
|
||||
// Checks if a heartbeat gossip already occurred at this block number.
|
||||
@@ -479,7 +479,7 @@ impl<T: Trait> Module<T> {
|
||||
now: T::BlockNumber,
|
||||
next_gossip: T::BlockNumber,
|
||||
) -> Result<(Option<Vec<u8>>, bool), OffchainErr> {
|
||||
let last_gossip = runtime_io::offchain::local_storage_get(StorageKind::PERSISTENT, DB_KEY);
|
||||
let last_gossip = sp_io::offchain::local_storage_get(StorageKind::PERSISTENT, DB_KEY);
|
||||
match last_gossip {
|
||||
Some(last) => {
|
||||
let worker_status: WorkerStatus<T::BlockNumber> = Decode::decode(&mut &last[..])
|
||||
|
||||
@@ -27,7 +27,7 @@ use sp_runtime::testing::{Header, UintAuthorityId, TestXt};
|
||||
use sp_runtime::traits::{IdentityLookup, BlakeTwo256, ConvertInto};
|
||||
use primitives::H256;
|
||||
use support::{impl_outer_origin, impl_outer_dispatch, parameter_types, weights::Weight};
|
||||
use {runtime_io, system};
|
||||
use {sp_io, system};
|
||||
|
||||
impl_outer_origin!{
|
||||
pub enum Origin for Runtime {}
|
||||
@@ -85,7 +85,7 @@ impl ReportOffence<u64, IdentificationTuple, Offence> for OffenceHandler {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_test_ext() -> runtime_io::TestExternalities {
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let t = system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
|
||||
t.into()
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ fn should_generate_heartbeats() {
|
||||
|
||||
assert_eq!(heartbeat, Heartbeat {
|
||||
block_number: 2,
|
||||
network_state: runtime_io::offchain::network_state().unwrap(),
|
||||
network_state: sp_io::offchain::network_state().unwrap(),
|
||||
session_index: 2,
|
||||
authority_index: 2,
|
||||
});
|
||||
@@ -329,7 +329,7 @@ fn should_not_send_a_report_if_already_online() {
|
||||
|
||||
assert_eq!(heartbeat, Heartbeat {
|
||||
block_number: 4,
|
||||
network_state: runtime_io::offchain::network_state().unwrap(),
|
||||
network_state: sp_io::offchain::network_state().unwrap(),
|
||||
session_index: 2,
|
||||
authority_index: 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user