Update patch-polkadot-sdk to remove scale_info

This commit is contained in:
Luke Parker
2025-09-05 13:56:13 -04:00
parent 2077e485bb
commit 46caca2f51
32 changed files with 303 additions and 1017 deletions

View File

@@ -22,13 +22,12 @@ workspace = true
borsh = { version = "1", default-features = false, features = ["derive", "de_strict_order"] }
bitvec = { version = "1", default-features = false, features = ["alloc"] }
sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "9451a7e8d8ff28571bd9bc8cdea91dacd80e1ab0", default-features = false }
sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "749e7a1a664813ea3ae15e646f352a410e39653c", default-features = false }
serde = { version = "1", default-features = false, features = ["derive"], optional = true }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }
sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "9451a7e8d8ff28571bd9bc8cdea91dacd80e1ab0", default-features = false, features = ["serde"], optional = true }
frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "9451a7e8d8ff28571bd9bc8cdea91dacd80e1ab0", default-features = false, optional = true }
sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "749e7a1a664813ea3ae15e646f352a410e39653c", default-features = false, features = ["serde"], optional = true }
frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "749e7a1a664813ea3ae15e646f352a410e39653c", default-features = false, optional = true }
serai-primitives = { path = "../primitives", version = "0.1", default-features = false }
@@ -41,12 +40,11 @@ std = [
"serde?/std",
"scale?/std",
"scale-info?/std",
"sp-runtime?/std",
"frame-support?/std",
"serai-primitives/std",
]
substrate = ["serde", "scale", "scale-info", "sp-runtime", "frame-support", "serai-primitives/serde", "serai-primitives/non_canonical_scale_derivations"]
substrate = ["serde", "scale", "sp-runtime", "frame-support", "serai-primitives/serde", "serai-primitives/non_canonical_scale_derivations"]
try-runtime = ["sp-runtime/try-runtime"]
default = ["std"]

View File

@@ -106,7 +106,6 @@ mod substrate {
use core::fmt::Debug;
use scale::{Encode, Decode, DecodeWithMemTracking};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
@@ -182,7 +181,6 @@ mod substrate {
Encode,
Decode,
DecodeWithMemTracking,
TypeInfo,
sp_runtime::Serialize,
sp_runtime::Deserialize,
)]
@@ -208,7 +206,6 @@ mod substrate {
Encode,
Decode,
DecodeWithMemTracking,
TypeInfo,
sp_runtime::Serialize,
sp_runtime::Deserialize,
)]
@@ -226,7 +223,6 @@ mod substrate {
Encode,
Decode,
DecodeWithMemTracking,
TypeInfo,
sp_runtime::Serialize,
sp_runtime::Deserialize,
)]
@@ -285,7 +281,7 @@ mod substrate {
}
/// A block, as needed by Substrate.
#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, TypeInfo)]
#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking)]
pub struct SubstrateBlock {
header: SubstrateHeader,
transactions: Vec<Transaction>,

View File

@@ -256,23 +256,10 @@ mod substrate {
}
}
// Clean `Transaction` tracks its memory during decoding, as we do call
// Clean `Transaction` tracks its memory during decoding, as `read_scale_as_borsh` does call
// `Input::on_before_alloc_mem`
impl scale::DecodeWithMemTracking for Transaction {}
// Shim `TypeInfo` for `Transaction`
impl scale_info::TypeInfo for Transaction {
type Identity = Self;
fn type_info() -> scale_info::Type {
scale_info::Type {
path: scale_info::Path { segments: vec!["serai_abi", "transaction", "Transaction"] },
type_params: vec![],
type_def: (scale_info::TypeDefComposite { fields: vec![] }).into(),
docs: vec![],
}
}
}
/// The context which transactions are executed in.
pub trait TransactionContext: 'static + Send + Sync + Clone + PartialEq + Eq + Debug {
/// The base weight for a signed transaction.