Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadot v1.1.0 #1605

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,508 changes: 8,352 additions & 4,156 deletions Cargo.lock

Large diffs are not rendered by default.

1,069 changes: 536 additions & 533 deletions Cargo.toml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions libs/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ version = "0.0.1"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { default-features = false, version = "3.0.0", features = ["derive"] }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
cfg-types = { path = "../types", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" }
orml-traits = { workspace = true }

mock-builder = { workspace = true }

Expand Down
28 changes: 14 additions & 14 deletions libs/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ version = "2.0.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { version = "1.0.119" }

# substrate primitives dependencies
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-arithmetic = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# substrate frame dependencies
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-collective = { workspace = true }

# cumulus primitives dependencies
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" }
cumulus-primitives-core = { workspace = true }

# XCM primitives dependencies
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
xcm = { package = "staging-xcm", workspace = true }
xcm-executor = { package = "staging-xcm-executor", workspace = true }

[features]
default = ["std"]
Expand Down
35 changes: 15 additions & 20 deletions libs/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,8 @@ pub mod liquidity_pools {

impl sp_core::Get<[u8; 12]> for GeneralCurrencyPrefix {
fn get() -> [u8; 12] {
let hash: [u8; 16] = frame_support::sp_io::hashing::blake2_128(
&crate::constants::GENERAL_CURRENCY_INDEX_PREFIX,
);
let hash: [u8; 16] =
sp_io::hashing::blake2_128(&crate::constants::GENERAL_CURRENCY_INDEX_PREFIX);
let (trimmed, _) = hash.split_at(12);

trimmed
Expand All @@ -357,36 +356,36 @@ pub mod liquidity_pools {
pub mod xcm {
use parity_scale_codec::{Compact, Encode};
use sp_io::hashing::blake2_256;
use sp_std::{borrow::Borrow, marker::PhantomData, vec::Vec};
use sp_std::{marker::PhantomData, vec::Vec};
use xcm::prelude::{
AccountId32, AccountKey20, Here, MultiLocation, PalletInstance, Parachain, X1,
};
use xcm_executor::traits::Convert;
use xcm_executor::traits::ConvertLocation;

// TODO(william): Check
/// NOTE: Copied from <https://github.com/moonbeam-foundation/polkadot/blob/d83bb6cc7d7c93ead2fd3cafce0e268fd3f6b9bc/xcm/xcm-builder/src/location_conversion.rs#L25C1-L68C2>
///
/// temporary struct that mimics the behavior of the upstream type that we
/// will move to once we update this repository to Polkadot 0.9.43+.
pub struct HashedDescriptionDescribeFamilyAllTerminal<AccountId>(PhantomData<AccountId>);
impl<AccountId: From<[u8; 32]> + Clone> HashedDescriptionDescribeFamilyAllTerminal<AccountId> {
fn describe_location_suffix(l: &MultiLocation) -> Result<Vec<u8>, ()> {
fn describe_location_suffix(l: &MultiLocation) -> Option<Vec<u8>> {
match (l.parents, &l.interior) {
(0, Here) => Ok(Vec::new()),
(0, Here) => Some(Vec::new()),
(0, X1(PalletInstance(i))) => {
Ok((b"Pallet", Compact::<u32>::from(*i as u32)).encode())
Some((b"Pallet", Compact::<u32>::from(*i as u32)).encode())
}
(0, X1(AccountId32 { id, .. })) => Ok((b"AccountId32", id).encode()),
(0, X1(AccountKey20 { key, .. })) => Ok((b"AccountKey20", key).encode()),
_ => Err(()),
(0, X1(AccountId32 { id, .. })) => Some((b"AccountId32", id).encode()),
(0, X1(AccountKey20 { key, .. })) => Some((b"AccountKey20", key).encode()),
_ => None,
}
}
}

impl<AccountId: From<[u8; 32]> + Clone> Convert<MultiLocation, AccountId>
impl<AccountId: From<[u8; 32]> + Clone> ConvertLocation<AccountId>
for HashedDescriptionDescribeFamilyAllTerminal<AccountId>
{
fn convert_ref(location: impl Borrow<MultiLocation>) -> Result<AccountId, ()> {
let l = location.borrow();
fn convert_location(l: &MultiLocation) -> Option<AccountId> {
let to_hash = match (l.parents, l.interior.first()) {
(0, Some(Parachain(index))) => {
let tail = l.interior.split_first().0;
Expand All @@ -403,13 +402,9 @@ pub mod xcm {
let interior = Self::describe_location_suffix(&tail)?;
(b"ParentChain", interior).encode()
}
_ => return Err(()),
_ => return None,
};
Ok(blake2_256(&to_hash).into())
}

fn reverse_ref(_: impl Borrow<AccountId>) -> Result<MultiLocation, ()> {
Err(())
Some(blake2_256(&to_hash).into())
}
}

Expand Down
8 changes: 4 additions & 4 deletions libs/proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ version = "2.0.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" }
sp-core = { workspace = true, default-features = true }

[features]
default = ["std"]
Expand Down
14 changes: 7 additions & 7 deletions libs/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
cfg-types = { path = "../types", default-features = false }

parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { version = "1.0.119", default-features = false }

frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# Optional dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" }
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, optional = true, tag = "polkadot-v1.1.0" }

[features]
default = ["std"]
Expand Down
12 changes: 6 additions & 6 deletions libs/traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
cfg-primitives = { path = "../primitives", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
impl-trait-for-tuples = "0.2.1"
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
sp-arithmetic = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
strum = { workspace = true, default-features = false }

[dev-dependencies]
Expand Down
20 changes: 10 additions & 10 deletions libs/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
bitflags = { version = "1.3", default-features = false }
hex-literal = { version = "0.3.4", default-features = false }
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { workspace = true }

# substrate dependencies
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
sp-arithmetic = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v1.1.0" }
xcm = { package = "staging-xcm", workspace = true }

# local dependencies
cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
cfg-utils = { path = "../utils", default-features = false }

[dev-dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true, default-features = true }
hex = { version = "0.4.3", default_features = false }

[features]
Expand Down
12 changes: 12 additions & 0 deletions libs/types/src/oracles.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// Copyright 2023 Centrifuge Foundation (centrifuge.io).
//
// This file is part of the Centrifuge chain project.
// Centrifuge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version (see http://www.gnu.org/licenses).
// Centrifuge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

use frame_support::RuntimeDebug;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
Expand Down
16 changes: 8 additions & 8 deletions libs/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ version = "2.0.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
hex = { version = "0.4.3", default_features = false }
pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
pallet-aura = { workspace = true }
pallet-timestamp = { workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { version = "2.0", default-features = false, features = ["derive"] }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-consensus-aura = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

[features]
default = ["std"]
Expand Down
3 changes: 2 additions & 1 deletion libs/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// Ensure we're `no_std` when compiling for WebAssembly.
#![cfg_attr(not(feature = "std"), no_std)]

use frame_system::pallet_prelude::BlockNumberFor;
use parity_scale_codec::{Decode, Encode, Error, Input};
use sp_std::{cmp::min, vec::Vec};

Expand Down Expand Up @@ -58,7 +59,7 @@ pub fn decode<const S: usize, O: Decode, I: Input>(input: &mut I) -> Result<O, E
/// Function that initializes the frame system & Aura, so a timestamp can be set
/// and pass validation
#[cfg(any(feature = "runtime-benchmarks", feature = "std"))]
pub fn set_block_number_timestamp<T>(block_number: T::BlockNumber, timestamp: T::Moment)
pub fn set_block_number_timestamp<T>(block_number: BlockNumberFor<T>, timestamp: T::Moment)
where
T: pallet_aura::Config + frame_system::Config + pallet_timestamp::Config,
{
Expand Down
30 changes: 15 additions & 15 deletions pallets/anchors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ version = "2.0.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { version = "1.0.119" }

cfg-traits = { path = "../../libs/traits", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-balances = { workspace = true }
pallet-timestamp = { workspace = true }
sp-arithmetic = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# optional dependencies for benchmarking
cfg-utils = { path = "../../libs/utils", default-features = false, optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" }
pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-benchmarking = { workspace = true, optional = true }
pallet-aura = { workspace = true }

[dev-dependencies]
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-authorship = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-io = { workspace = true }

cfg-mocks = { path = "../../libs/mocks" }

Expand Down
Loading
Loading