Remove mem_info and references to parity-util-mem (#12795)

* Remove mem_info and some references to parity-util-mem

* [Draft] Finish removing references to `parity-util-mem`

* Upgrade dependencies

* Update scripts/ci/deny.toml

Co-authored-by: ordian <write@reusable.software>

* Fix Cargo.lock (remove unwanted dependency changes)

* Removed unused argument

* Run cargo fmt (didn't have pre-commit set up)

* Fix some CI errors

* Fix another CI error

* Remove unused dependency

Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
Marcin S
2022-12-06 09:55:10 -05:00
committed by GitHub
parent 07117e7913
commit aa21e56744
46 changed files with 70 additions and 426 deletions
@@ -22,7 +22,7 @@ use crate::{
generic::Digest,
scale_info::TypeInfo,
traits::{
self, AtLeast32BitUnsigned, Hash as HashT, MaybeDisplay, MaybeMallocSizeOf, MaybeSerialize,
self, AtLeast32BitUnsigned, Hash as HashT, MaybeDisplay, MaybeSerialize,
MaybeSerializeDeserialize, Member, SimpleBitOps,
},
};
@@ -54,22 +54,6 @@ pub struct Header<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> {
pub digest: Digest,
}
#[cfg(feature = "std")]
impl<Number, Hash> parity_util_mem::MallocSizeOf for Header<Number, Hash>
where
Number: Copy + Into<U256> + TryFrom<U256> + parity_util_mem::MallocSizeOf,
Hash: HashT,
Hash::Output: parity_util_mem::MallocSizeOf,
{
fn size_of(&self, ops: &mut parity_util_mem::MallocSizeOfOps) -> usize {
self.parent_hash.size_of(ops) +
self.number.size_of(ops) +
self.state_root.size_of(ops) +
self.extrinsics_root.size_of(ops) +
self.digest.size_of(ops)
}
}
#[cfg(feature = "std")]
pub fn serialize_number<S, T: Copy + Into<U256> + TryFrom<U256>>(
val: &T,
@@ -103,8 +87,7 @@ where
+ Copy
+ Into<U256>
+ TryFrom<U256>
+ sp_std::str::FromStr
+ MaybeMallocSizeOf,
+ sp_std::str::FromStr,
Hash: HashT,
Hash::Output: Default
+ sp_std::hash::Hash
@@ -115,8 +98,7 @@ where
+ Debug
+ MaybeDisplay
+ SimpleBitOps
+ Codec
+ MaybeMallocSizeOf,
+ Codec,
{
type Number = Number;
type Hash = <Hash as HashT>::Output;