mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
The crate rename (#4223)
* Adding script for rename, could be applicable for nodes on top of it, too * add stderr and gitlab ci features * apply script * fix now minor details in expected stderr * Update the Cargo.lock * fix name: sc-transaction -> sc-tracing * fix rename in script, too
This commit is contained in:
committed by
GitHub
parent
40f6d05a4c
commit
927e13c13a
@@ -8,19 +8,19 @@ edition = "2018"
|
||||
serde = { version = "1.0.101", optional = true }
|
||||
safe-mix = { version = "1.0.0", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
|
||||
substrate-keyring = { path = "../../primitives/keyring", optional = true }
|
||||
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
|
||||
phragmen = { package = "substrate-phragmen", path = "../../primitives/phragmen", default-features = false }
|
||||
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
|
||||
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
|
||||
sp-keyring = { path = "../../primitives/keyring", optional = true }
|
||||
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
|
||||
phragmen = { package = "sp-phragmen", path = "../../primitives/phragmen", default-features = false }
|
||||
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
|
||||
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
|
||||
support = { package = "frame-support", path = "../support", default-features = false }
|
||||
system = { package = "frame-system", path = "../system", default-features = false }
|
||||
session = { package = "pallet-session", path = "../session", default-features = false, features = ["historical"] }
|
||||
authorship = { package = "pallet-authorship", path = "../authorship", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
balances = { package = "pallet-balances", path = "../balances" }
|
||||
timestamp = { package = "pallet-timestamp", path = "../timestamp" }
|
||||
pallet-staking-reward-curve = { path = "../staking/reward-curve"}
|
||||
@@ -33,14 +33,14 @@ default = ["std", "equalize"]
|
||||
std = [
|
||||
"serde",
|
||||
"safe-mix/std",
|
||||
"substrate-keyring",
|
||||
"sp-keyring",
|
||||
"codec/std",
|
||||
"rstd/std",
|
||||
"phragmen/std",
|
||||
"runtime-io/std",
|
||||
"support/std",
|
||||
"sr-primitives/std",
|
||||
"sr-staking-primitives/std",
|
||||
"sp-runtime/std",
|
||||
"sp-staking/std",
|
||||
"session/std",
|
||||
"system/std",
|
||||
"authorship/std",
|
||||
|
||||
@@ -14,4 +14,4 @@ proc-macro2 = "1.0.6"
|
||||
proc-macro-crate = "0.1.4"
|
||||
|
||||
[dev-dependencies]
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
|
||||
@@ -42,7 +42,7 @@ use syn::parse::{Parse, ParseStream};
|
||||
///
|
||||
/// ```
|
||||
/// # fn main() {}
|
||||
/// use sr_primitives::curve::PiecewiseLinear;
|
||||
/// use sp_runtime::curve::PiecewiseLinear;
|
||||
///
|
||||
/// pallet_staking_reward_curve::build! {
|
||||
/// const I_NPOS: PiecewiseLinear<'static> = curve!(
|
||||
@@ -64,10 +64,10 @@ pub fn build(input: TokenStream) -> TokenStream {
|
||||
let declaration = generate_piecewise_linear(points);
|
||||
let test_module = generate_test_module(&input);
|
||||
|
||||
let imports = match crate_name("sr-primitives") {
|
||||
Ok(sr_primitives) => {
|
||||
let ident = syn::Ident::new(&sr_primitives, Span::call_site());
|
||||
quote!( extern crate #ident as _sr_primitives; )
|
||||
let imports = match crate_name("sp-runtime") {
|
||||
Ok(sp_runtime) => {
|
||||
let ident = syn::Ident::new(&sp_runtime, Span::call_site());
|
||||
quote!( extern crate #ident as _sp_runtime; )
|
||||
},
|
||||
Err(e) => syn::Error::new(Span::call_site(), &e).to_compile_error(),
|
||||
};
|
||||
@@ -345,16 +345,16 @@ fn generate_piecewise_linear(points: Vec<(u32, u32)>) -> TokenStream2 {
|
||||
|
||||
points_tokens.extend(quote!(
|
||||
(
|
||||
_sr_primitives::Perbill::from_parts(#x_perbill),
|
||||
_sr_primitives::Perbill::from_parts(#y_perbill),
|
||||
_sp_runtime::Perbill::from_parts(#x_perbill),
|
||||
_sp_runtime::Perbill::from_parts(#y_perbill),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
quote!(
|
||||
_sr_primitives::curve::PiecewiseLinear::<'static> {
|
||||
_sp_runtime::curve::PiecewiseLinear::<'static> {
|
||||
points: & [ #points_tokens ],
|
||||
maximum: _sr_primitives::Perbill::from_parts(#max),
|
||||
maximum: _sp_runtime::Perbill::from_parts(#max),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
mod test_small_falloff {
|
||||
pallet_staking_reward_curve::build! {
|
||||
const REWARD_CURVE: sr_primitives::curve::PiecewiseLinear<'static> = curve!(
|
||||
const REWARD_CURVE: sp_runtime::curve::PiecewiseLinear<'static> = curve!(
|
||||
min_inflation: 0_020_000,
|
||||
max_inflation: 0_200_000,
|
||||
ideal_stake: 0_600_000,
|
||||
@@ -32,7 +32,7 @@ mod test_small_falloff {
|
||||
|
||||
mod test_big_falloff {
|
||||
pallet_staking_reward_curve::build! {
|
||||
const REWARD_CURVE: sr_primitives::curve::PiecewiseLinear<'static> = curve!(
|
||||
const REWARD_CURVE: sp_runtime::curve::PiecewiseLinear<'static> = curve!(
|
||||
min_inflation: 0_100_000,
|
||||
max_inflation: 0_400_000,
|
||||
ideal_stake: 0_400_000,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! The staking rate in NPoS is the total amount of tokens staked by nominators and validators,
|
||||
//! divided by the total token supply.
|
||||
|
||||
use sr_primitives::{Perbill, traits::SimpleArithmetic, curve::PiecewiseLinear};
|
||||
use sp_runtime::{Perbill, traits::SimpleArithmetic, curve::PiecewiseLinear};
|
||||
|
||||
/// The total payout to all validators (and their nominators) per era.
|
||||
///
|
||||
@@ -47,7 +47,7 @@ pub fn compute_total_payout<N>(
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use sr_primitives::curve::PiecewiseLinear;
|
||||
use sp_runtime::curve::PiecewiseLinear;
|
||||
|
||||
pallet_staking_reward_curve::build! {
|
||||
const I_NPOS: PiecewiseLinear<'static> = curve!(
|
||||
|
||||
@@ -266,7 +266,7 @@ use support::{
|
||||
}
|
||||
};
|
||||
use session::{historical::OnSessionEnding, SelectInitialValidators};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
Perbill,
|
||||
RuntimeDebug,
|
||||
curve::PiecewiseLinear,
|
||||
@@ -275,12 +275,12 @@ use sr_primitives::{
|
||||
SimpleArithmetic, EnsureOrigin,
|
||||
}
|
||||
};
|
||||
use sr_staking_primitives::{
|
||||
use sp_staking::{
|
||||
SessionIndex,
|
||||
offence::{OnOffenceHandler, OffenceDetails, Offence, ReportOffence},
|
||||
};
|
||||
#[cfg(feature = "std")]
|
||||
use sr_primitives::{Serialize, Deserialize};
|
||||
use sp_runtime::{Serialize, Deserialize};
|
||||
use system::{ensure_signed, ensure_root};
|
||||
|
||||
use phragmen::{ExtendedBalance, PhragmenStakedAssignment};
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
//! Test utilities
|
||||
|
||||
use std::{collections::HashSet, cell::RefCell};
|
||||
use sr_primitives::{Perbill, KeyTypeId};
|
||||
use sr_primitives::curve::PiecewiseLinear;
|
||||
use sr_primitives::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize, SaturatedConversion};
|
||||
use sr_primitives::testing::{Header, UintAuthorityId};
|
||||
use sr_staking_primitives::{SessionIndex, offence::{OffenceDetails, OnOffenceHandler}};
|
||||
use sp_runtime::{Perbill, KeyTypeId};
|
||||
use sp_runtime::curve::PiecewiseLinear;
|
||||
use sp_runtime::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize, SaturatedConversion};
|
||||
use sp_runtime::testing::{Header, UintAuthorityId};
|
||||
use sp_staking::{SessionIndex, offence::{OffenceDetails, OnOffenceHandler}};
|
||||
use primitives::{H256, crypto::key_types};
|
||||
use runtime_io;
|
||||
use support::{
|
||||
@@ -127,7 +127,7 @@ impl system::Trait for Test {
|
||||
type BlockNumber = BlockNumber;
|
||||
type Call = ();
|
||||
type Hash = H256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = AccountId;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
|
||||
@@ -52,7 +52,7 @@ use super::{
|
||||
EraIndex, Trait, Module, Store, BalanceOf, Exposure, Perbill, SessionInterface,
|
||||
NegativeImbalanceOf, UnappliedSlash,
|
||||
};
|
||||
use sr_primitives::traits::{Zero, Saturating};
|
||||
use sp_runtime::traits::{Zero, Saturating};
|
||||
use support::{
|
||||
StorageMap, StorageDoubleMap,
|
||||
traits::{Currency, OnUnbalanced, Imbalance},
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
use super::*;
|
||||
use mock::*;
|
||||
use sr_primitives::{assert_eq_error_rate, traits::OnInitialize};
|
||||
use sr_staking_primitives::offence::OffenceDetails;
|
||||
use sp_runtime::{assert_eq_error_rate, traits::OnInitialize};
|
||||
use sp_staking::offence::OffenceDetails;
|
||||
use support::{assert_ok, assert_noop, traits::{Currency, ReservableCurrency}};
|
||||
use substrate_test_utils::assert_eq_uvec;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user