Skip to content

Commit

Permalink
Bumping parity-common
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Sep 11, 2024
1 parent 8236718 commit 6881bc7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 27 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ enumflags2 = { version = "0.7.7" }
enumn = { version = "0.1.13" }
environmental = { version = "1.1.4", default-features = false }
equivocation-detector = { path = "bridges/relays/equivocation" }
ethabi = { version = "1.0.0", default-features = false, package = "ethabi-decode" }
ethbloom = { version = "0.13.0", default-features = false }
ethereum-types = { version = "0.14.1", default-features = false }
ethabi = { version = "1.1.0", default-features = false, package = "ethabi-decode" }
ethbloom = { version = "0.14.0", default-features = false }
ethereum-types = { version = "0.15.0", default-features = false }
exit-future = { version = "0.2.0" }
expander = { version = "2.0.0" }
fatality = { version = "0.1.1" }
Expand Down Expand Up @@ -1002,7 +1002,6 @@ parachains-relay = { path = "bridges/relays/parachains" }
parachains-runtimes-test-utils = { path = "cumulus/parachains/runtimes/test-utils", default-features = false }
parity-bytes = { version = "0.1.2", default-features = false }
parity-db = { version = "0.4.12" }
parity-util-mem = { version = "0.12.0" }
parity-wasm = { version = "0.45.0" }
parking_lot = { version = "0.12.1", default-features = false }
partial_sort = { version = "0.2.0" }
Expand Down Expand Up @@ -1076,7 +1075,7 @@ polkavm-derive = "0.9.1"
polkavm-linker = "0.9.2"
portpicker = { version = "0.1.1" }
pretty_assertions = { version = "1.3.0" }
primitive-types = { version = "0.12.1", default-features = false }
primitive-types = { version = "0.13.0", default-features = false }
proc-macro-crate = { version = "3.0.0" }
proc-macro-warning = { version = "1.0.0", default-features = false }
proc-macro2 = { version = "1.0.86" }
Expand Down Expand Up @@ -1104,7 +1103,7 @@ relay-substrate-client = { path = "bridges/relays/client-substrate" }
relay-utils = { path = "bridges/relays/utils" }
remote-externalities = { path = "substrate/utils/frame/remote-externalities", default-features = false, package = "frame-remote-externalities" }
reqwest = { version = "0.11", default-features = false }
rlp = { version = "0.5.2", default-features = false }
rlp = { version = "0.6.0", default-features = false }
rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/rococo" }
rococo-parachain-runtime = { path = "cumulus/parachains/runtimes/testing/rococo-parachain" }
rococo-runtime = { path = "polkadot/runtime/rococo" }
Expand Down
2 changes: 0 additions & 2 deletions bridges/primitives/polkadot-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ workspace = true

[dependencies]
codec = { features = ["derive"], workspace = true }
parity-util-mem = { optional = true, workspace = true }
scale-info = { features = ["derive"], workspace = true }
serde = { optional = true, features = [
"derive",
Expand Down Expand Up @@ -42,7 +41,6 @@ std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"parity-util-mem",
"scale-info/std",
"serde",
"sp-core/std",
Expand Down
5 changes: 1 addition & 4 deletions bridges/primitives/polkadot-core/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ use sp_std::vec::Vec;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};

#[cfg(feature = "std")]
use parity_util_mem::MallocSizeOf;

/// Parachain id.
///
/// This is an equivalent of the `polkadot_parachain_primitives::Id`, which is a compact-encoded
Expand Down Expand Up @@ -71,7 +68,7 @@ impl From<u32> for ParaId {
#[derive(
PartialEq, Eq, Clone, PartialOrd, Ord, Encode, Decode, RuntimeDebug, TypeInfo, Default,
)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash, MallocSizeOf))]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))]
pub struct ParaHead(pub Vec<u8>);

impl ParaHead {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachains/runtimes/testing/penpal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ parachain-info = { workspace = true }
parachains-common = { workspace = true }
assets-common = { workspace = true }

primitive-types = { version = "0.12.1", default-features = false, features = ["codec", "num-traits", "scale-info"] }
primitive-types = { workspace = true, default-features = false, features = ["codec", "num-traits", "scale-info"] }

[features]
default = ["std"]
Expand Down
3 changes: 2 additions & 1 deletion substrate/client/consensus/babe/src/authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ pub(super) fn secondary_slot_author(
return None
}

let rand = U256::from((randomness, slot).using_encoded(sp_crypto_hashing::blake2_256));
let rand =
U256::from_big_endian(&(randomness, slot).using_encoded(sp_crypto_hashing::blake2_256));

let authorities_len = U256::from(authorities.len());
let idx = rand % authorities_len;
Expand Down
17 changes: 5 additions & 12 deletions substrate/frame/revive/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ type CallOf<T> = <T as frame_system::Config>::RuntimeCall;
/// The maximum nesting depth a contract can use when encoding types.
const MAX_DECODE_NESTING: u32 = 256;

/// Encode a `U256` into a 32 byte buffer.
fn as_bytes(u: U256) -> [u8; 32] {
let mut bytes = [0u8; 32];
u.to_little_endian(&mut bytes);
bytes
}

#[derive(Clone, Copy)]
pub enum ApiVersion {
/// Expose all APIs even unversioned ones. Only used for testing and benchmarking.
Expand Down Expand Up @@ -1510,7 +1503,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.balance()),
&self.ext.balance().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1524,7 +1517,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.value_transferred()),
&self.ext.value_transferred().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1538,7 +1531,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.now()),
&self.ext.now().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1552,7 +1545,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.minimum_balance()),
&self.ext.minimum_balance().to_little_endian(),
false,
already_charged,
)?)
Expand Down Expand Up @@ -1606,7 +1599,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.block_number()),
&self.ext.block_number().to_little_endian(),
false,
already_charged,
)?)
Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/runtime/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl From<UintAuthorityId> for u64 {
impl UintAuthorityId {
/// Convert this authority ID into a public key.
pub fn to_public_key<T: ByteArray>(&self) -> T {
let bytes: [u8; 32] = U256::from(self.0).into();
let bytes = U256::from(self.0).to_big_endian();
T::from_slice(&bytes).unwrap()
}
}
Expand Down

0 comments on commit 6881bc7

Please sign in to comment.