mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 11:27:58 +00:00
fully enable RuntimeDebug in feature = try-runtime (#14136)
* fully enable `RuntimeDebug` in `feature = try-runtime` * Delete settings.json * fix * fix * fix * update lock file with sp-debug-derive dep * update doc --------- Co-authored-by: muharem <ismailov.m.h@gmail.com>
This commit is contained in:
@@ -648,12 +648,13 @@ pub fn derive_debug_no_bound(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
/// Derive [`Debug`], if `std` is enabled it uses `frame_support::DebugNoBound`, if `std` is not
|
||||
/// enabled it just returns `"<stripped>"`.
|
||||
/// enabled it just returns `"<wasm:stripped>"`.
|
||||
/// This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.
|
||||
#[proc_macro_derive(RuntimeDebugNoBound)]
|
||||
pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream {
|
||||
#[cfg(not(feature = "std"))]
|
||||
{
|
||||
if cfg!(any(feature = "std", feature = "try-runtime")) {
|
||||
debug_no_bound::derive_debug_no_bound(input)
|
||||
} else {
|
||||
let input: syn::DeriveInput = match syn::parse(input) {
|
||||
Ok(input) => input,
|
||||
Err(e) => return e.to_compile_error().into(),
|
||||
@@ -666,18 +667,13 @@ pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream {
|
||||
const _: () = {
|
||||
impl #impl_generics core::fmt::Debug for #name #ty_generics #where_clause {
|
||||
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
fmt.write_str("<stripped>")
|
||||
fmt.write_str("<wasm:stripped>")
|
||||
}
|
||||
}
|
||||
};
|
||||
)
|
||||
.into()
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
debug_no_bound::derive_debug_no_bound(input)
|
||||
}
|
||||
}
|
||||
|
||||
/// Derive [`PartialEq`] but do not bound any generic. Docs are at
|
||||
|
||||
Reference in New Issue
Block a user