mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03: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
@@ -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),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user