Skip to content

Commit

Permalink
Bump codec version 3.0.0 -> 3.1.5 + unify parity-scale-codec vs codec (
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored and bkchr committed Apr 10, 2024
1 parent 682fafd commit 7ad5b0f
Show file tree
Hide file tree
Showing 30 changed files with 38 additions and 50 deletions.
2 changes: 1 addition & 1 deletion bridges/bin/millau/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
hex-literal = "0.3"
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
libsecp256k1 = { version = "0.7", optional = true, default-features = false, features = ["hmac"] }
log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto-parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runtime-benchmarks = ['rialto-parachain-runtime/runtime-benchmarks']
clap = { version = "3.1", features = ["derive"] }
derive_more = '0.99.2'
log = '0.4.17'
codec = { package = 'parity-scale-codec', version = '3.0.0' }
codec = { package = 'parity-scale-codec', version = '3.1.5' }
serde = { version = '1.0', features = ['derive'] }
hex-literal = '0.3.1'

Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto-parachain/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[dependencies]
codec = { package = 'parity-scale-codec', version = '3.0.0', default-features = false, features = ['derive']}
codec = { package = 'parity-scale-codec', version = '3.1.5', default-features = false, features = ['derive']}
log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = '1.0', optional = true, features = ['derive'] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
hex-literal = "0.3"
libsecp256k1 = { version = "0.7", optional = true, default-features = false, features = ["hmac"] }
log = { version = "0.4.17", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
hash-db = { version = "0.15.2", default-features = false }
log = { version = "0.4.17", default-features = false }
num-traits = { version = "0.2", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
finality-grandpa = { version = "0.15.0", default-features = false }
log = { version = "0.4.17", default-features = false }
num-traits = { version = "0.2", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
bitvec = { version = "1", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
log = { version = "0.4.17", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
log = { version = "0.4.17", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/shift-session-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

# Substrate Dependencies
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/chain-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
paste = "1.0"
smallvec = "1.7"

Expand All @@ -30,7 +30,7 @@ std = [
"bp-polkadot-core/std",
"bp-runtime/std",
"frame-support/std",
"parity-scale-codec/std",
"codec/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/chain-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
smallvec = "1.7"

Expand All @@ -32,7 +32,7 @@ std = [
"bp-polkadot-core/std",
"bp-runtime/std",
"frame-support/std",
"parity-scale-codec/std",
"codec/std",
"scale-info/std",
"sp-api/std",
"sp-runtime/std",
Expand Down
4 changes: 1 addition & 3 deletions bridges/primitives/chain-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Westend Runtime `Call` enum.
///
/// We are not currently submitting any Westend transactions => it is empty.
#[derive(
parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone, TypeInfo,
)]
#[derive(codec::Encode, codec::Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub enum Call {}

impl sp_runtime::traits::Dispatchable for Call {
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/chain-wococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
paste = "1.0"

# Bridge Dependencies
Expand All @@ -28,7 +28,7 @@ std = [
"bp-polkadot-core/std",
"bp-runtime/std",
"bp-rococo/std",
"parity-scale-codec/std",
"codec/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/header-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
finality-grandpa = { version = "0.15.0", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
bitvec = { version = "1", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "bit-vec"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "bit-vec"] }
impl-trait-for-tuples = "0.2"
scale-info = { version = "2.1.1", default-features = false, features = ["bit-vec", "derive"] }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true, features = ["derive"] }

Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/polkadot-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
parity-util-mem = { version = "0.11.0", optional = true }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down Expand Up @@ -37,7 +37,7 @@ std = [
"bp-runtime/std",
"frame-support/std",
"frame-system/std",
"parity-scale-codec/std",
"codec/std",
"parity-util-mem",
"scale-info/std",
"serde",
Expand Down
21 changes: 6 additions & 15 deletions bridges/primitives/polkadot-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use bp_messages::MessageNonce;
use bp_runtime::{Chain, EncodedOrDecodedCall};
use codec::Compact;
use frame_support::{
dispatch::Dispatchable,
parameter_types,
Expand All @@ -28,7 +29,6 @@ use frame_support::{
Blake2_128Concat, RuntimeDebug, StorageHasher, Twox128,
};
use frame_system::limits;
use parity_scale_codec::Compact;
use scale_info::{StaticTypeInfo, TypeInfo};
use sp_core::Hasher as HasherT;
use sp_runtime::{
Expand Down Expand Up @@ -256,16 +256,14 @@ pub struct SignedExtensions<Call> {
_data: sp_std::marker::PhantomData<Call>,
}

impl<Call> parity_scale_codec::Encode for SignedExtensions<Call> {
impl<Call> codec::Encode for SignedExtensions<Call> {
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R {
self.encode_payload.using_encoded(f)
}
}

impl<Call> parity_scale_codec::Decode for SignedExtensions<Call> {
fn decode<I: parity_scale_codec::Input>(
input: &mut I,
) -> Result<Self, parity_scale_codec::Error> {
impl<Call> codec::Decode for SignedExtensions<Call> {
fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
SignedExtra::decode(input).map(|encode_payload| SignedExtensions {
encode_payload,
additional_signed: None,
Expand Down Expand Up @@ -323,14 +321,7 @@ impl<Call> SignedExtensions<Call> {

impl<Call> sp_runtime::traits::SignedExtension for SignedExtensions<Call>
where
Call: parity_scale_codec::Codec
+ sp_std::fmt::Debug
+ Sync
+ Send
+ Clone
+ Eq
+ PartialEq
+ StaticTypeInfo,
Call: codec::Codec + sp_std::fmt::Debug + Sync + Send + Clone + Eq + PartialEq + StaticTypeInfo,
Call: Dispatchable,
{
const IDENTIFIER: &'static str = "Not needed.";
Expand Down Expand Up @@ -399,7 +390,7 @@ impl Chain for PolkadotLike {
pub fn account_info_storage_key(id: &AccountId) -> Vec<u8> {
let module_prefix_hashed = Twox128::hash(b"System");
let storage_prefix_hashed = Twox128::hash(b"Account");
let key_hashed = parity_scale_codec::Encode::using_encoded(id, Blake2_128Concat::hash);
let key_hashed = codec::Encode::using_encoded(id, Blake2_128Concat::hash);

let mut final_key = Vec::with_capacity(
module_prefix_hashed.len() + storage_prefix_hashed.len() + key_hashed.len(),
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/polkadot-core/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
//! be two versions of polkadot crates included in the runtime. Which is bad.
use bp_runtime::Size;
use codec::{CompactAs, Decode, Encode, MaxEncodedLen};
use frame_support::RuntimeDebug;
use parity_scale_codec::{CompactAs, Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_core::Hasher;
use sp_std::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
hash-db = { version = "0.15.2", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
bp-header-chain = { path = "../header-chain", default-features = false }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
ed25519-dalek = { version = "1.0", default-features = false, features = ["u64_backend"] }
finality-grandpa = { version = "0.15.0", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/bin-substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
anyhow = "1.0"
async-std = "1.9.0"
async-trait = "0.1"
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
futures = "0.3.12"
hex = "0.4"
log = "0.4.17"
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/client-millau/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
relay-substrate-client = { path = "../client-substrate" }
relay-utils = { path = "../utils" }

Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/client-rialto-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
relay-substrate-client = { path = "../client-substrate" }
relay-utils = { path = "../utils" }

Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/client-rialto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
relay-substrate-client = { path = "../client-substrate" }
relay-utils = { path = "../utils" }

Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/client-substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
async-trait = "0.1"
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
futures = "0.3.7"
jsonrpsee = { version = "0.15", features = ["macros", "ws-client"] }
log = "0.4.17"
Expand Down
1 change: 0 additions & 1 deletion bridges/relays/client-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
relay-substrate-client = { path = "../client-substrate" }
relay-utils = { path = "../utils" }

Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/lib-substrate-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ anyhow = "1.0"
thiserror = "1.0.26"
async-std = "1.9.0"
async-trait = "0.1"
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
futures = "0.3.12"
num-traits = "0.2"
log = "0.4.17"
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ bp-polkadot-core = { path = "../../primitives/polkadot-core" }
relay-substrate-client = { path = "../client-substrate" }

[dev-dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.1.5" }
relay-substrate-client = { path = "../client-substrate", features = ["test-helpers"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }

0 comments on commit 7ad5b0f

Please sign in to comment.