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

Update to polkadot-sdk v1.12.0 #409

Merged
merged 30 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
71f1f24
change(cargo): initiate updating dependencies
pandres95 May 30, 2024
0fe5cf3
change(cargo): format files / update dependencies / patch broken depe…
pandres95 Jun 6, 2024
4926aeb
change(pallet-communities): explicitly define ItemConfig
pandres95 Jun 6, 2024
20a3d2b
change(pallet-communities-manager): use pallet-communities' ItemConfi…
pandres95 Jun 6, 2024
2dd27c1
change(cargo): apply frame-contrib#14
pandres95 Jun 6, 2024
4b51f84
change(runtime-common): update definitions to XCMv4
pandres95 Jun 6, 2024
bd909f9
change(kusama-runtime-constants): update definitions to XCMv4
pandres95 Jun 6, 2024
76cdede
wip(virto-common): use XCMv3 as the version for structuring locations…
pandres95 Jun 11, 2024
a0ddc6d
change(pallets): update pallets to use new features present in PSDK v…
pandres95 Jun 11, 2024
e70787e
change(pallets): prune unused pallets
pandres95 Jun 11, 2024
976ce39
change(cargo): remove crate patch / update dependencies
pandres95 Jun 11, 2024
ca6f008
wip(kreivo-runtime): adjust parameters for runtime
pandres95 Jun 14, 2024
0c20dbb
change(kreivo-runtime): adjust xcm to use latest
pandres95 Jun 14, 2024
a86622c
change: update deps / lint
pandres95 Jun 14, 2024
baea0ce
fix: lint
pandres95 Jun 14, 2024
17ea111
fix(kreivo-runtime): output WASM in builds
pandres95 Jun 14, 2024
e404595
change(node): adjustments in cli settings
pandres95 Jun 21, 2024
b6e6b40
change(kreivo-runtime): update version
pandres95 Jun 21, 2024
00e8407
change(justfile): adjust to new TOML format
pandres95 Jun 21, 2024
d19ea67
Merge branch 'master' into update/polkadot-sdk-v1.12.0
pandres95 Jun 21, 2024
478cf43
change(virto-node): update to latest template
pandres95 Jun 21, 2024
1d3255e
change(kreivo-runtime): include missing impls for aura
pandres95 Jun 21, 2024
aa47be9
fix(kreivo-runtime): missing feature propagation / invalid visiblity …
pandres95 Jun 22, 2024
d57cba3
fix(virto-node): misaligned version for json_rpsee dependency
pandres95 Jun 22, 2024
fae0dbb
fix(virto-node): format
pandres95 Jun 22, 2024
fc6da53
change(zombienet): adjust configs
pandres95 Jun 22, 2024
d05d4fc
fix(kreivo-runtime): use specific CreateOrigin for runtime benchmarks
pandres95 Jun 25, 2024
c17edf9
fix: lint
pandres95 Jun 25, 2024
3cdf30b
[ci] calculate weights (#414)
github-actions[bot] Jun 26, 2024
7cf24ec
change: version bump
pandres95 Jun 26, 2024
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
4,165 changes: 2,300 additions & 1,865 deletions Cargo.lock

Large diffs are not rendered by default.

303 changes: 151 additions & 152 deletions Cargo.toml

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
[package]
name = "virto-common"
version = "0.1.0"
edition = "2021"
name = "virto-common"
version = "0.1.0"
edition = "2021"

[dependencies]
bs58 = { version = "0.5.0", default-features = false }
wasm-bindgen = { version = "0.2.87", optional = true }
bs58 = { version = "0.5.0", default-features = false }
wasm-bindgen = { version = "0.2.87", optional = true }

cumulus-primitives-core = { workspace = true, optional = true }
frame-support = { workspace = true, optional = true }
pallet-payments = { workspace = true, optional = true }
parity-scale-codec = { workspace = true, optional = true }
scale-info = { workspace = true, optional = true }
serde = { workspace = true, optional = true, default-features = false }
sp-runtime = { workspace = true, optional = true }
xcm = { workspace = true, optional = true }
cumulus-primitives-core = { workspace = true, optional = true }
frame-support = { workspace = true, optional = true }
pallet-payments = { workspace = true, optional = true }
parity-scale-codec = { workspace = true, optional = true }
scale-info = { workspace = true, optional = true }
serde = { workspace = true, optional = true, default-features = false }
sp-runtime = { workspace = true, optional = true }
xcm = { workspace = true, optional = true }

[dev-dependencies]
frame-support = { workspace = true, features = ["std"] }
frame-support = { workspace = true, features = ["std"] }

[features]
default = ["std"]
std = [
"bs58/std",
"cumulus-primitives-core?/std",
"frame-support?/std",
"pallet-payments?/std",
"parity-scale-codec?/std",
"scale-info?/std",
"serde?/std",
"sp-runtime?/std",
"xcm?/std",
]
alloc = []
js = ["alloc", "wasm-bindgen"]
nightly = []
runtime = [
"dep:cumulus-primitives-core",
"dep:frame-support",
"dep:pallet-payments",
"dep:parity-scale-codec",
"dep:serde",
"dep:scale-info",
"dep:sp-runtime",
"dep:xcm",
]
default = ["std"]
std = [
"bs58/std",
"cumulus-primitives-core?/std",
"frame-support?/std",
"pallet-payments?/std",
"parity-scale-codec?/std",
"scale-info?/std",
"serde?/std",
"sp-runtime?/std",
"xcm?/std",
]
alloc = []
js = ["alloc", "wasm-bindgen"]
nightly = []
runtime = [
"dep:cumulus-primitives-core",
"dep:frame-support",
"dep:pallet-payments",
"dep:parity-scale-codec",
"dep:serde",
"dep:scale-info",
"dep:sp-runtime",
"dep:xcm",
]
98 changes: 44 additions & 54 deletions common/src/multilocation_asset_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ impl From<u32> for FungibleAssetLocation {
#[cfg(feature = "runtime")]
pub mod runtime {
use super::{FungibleAssetLocation, Para};
use cumulus_primitives_core::MultiLocation;
use sp_runtime::traits::MaybeEquivalence;
use xcm::v3::{
use xcm::latest::{
Junction::{GeneralIndex, GlobalConsensus, PalletInstance, Parachain},
Junctions, NetworkId,
Location, NetworkId,
};

impl TryFrom<NetworkId> for super::NetworkId {
Expand All @@ -83,72 +82,63 @@ pub mod runtime {
}

pub struct AsFungibleAssetLocation;
impl MaybeEquivalence<MultiLocation, FungibleAssetLocation> for AsFungibleAssetLocation {
fn convert(value: &MultiLocation) -> Option<FungibleAssetLocation> {
match *value {
MultiLocation {
parents: 2,
interior: Junctions::X1(GlobalConsensus(network)),
} => Some(FungibleAssetLocation::External {
network: network.try_into().ok()?,
impl MaybeEquivalence<Location, FungibleAssetLocation> for AsFungibleAssetLocation {
fn convert(value: &Location) -> Option<FungibleAssetLocation> {
match value.unpack() {
(2, [GlobalConsensus(network)]) => Some(FungibleAssetLocation::External {
network: (*network).try_into().ok()?,
child: None,
}),
MultiLocation {
parents: 2,
interior:
Junctions::X4(GlobalConsensus(network), Parachain(id), PalletInstance(pallet), GeneralIndex(index)),
} => Some(FungibleAssetLocation::External {
network: network.try_into().ok()?,
child: Some(Para {
id: id.try_into().ok()?,
pallet,
index: index.try_into().ok()?,
}),
}),
MultiLocation {
parents: 1,
interior: Junctions::X3(Parachain(id), PalletInstance(pallet), GeneralIndex(index)),
} => Some(FungibleAssetLocation::Sibling(Para {
id: id.try_into().ok()?,
pallet,
index: index.try_into().ok()?,
})),
MultiLocation {
parents: 0,
interior: Junctions::X2(PalletInstance(13), GeneralIndex(index)),
} => Some(FungibleAssetLocation::Here(
index.try_into().expect("as it is here, we the types will match; qed"),
(2, [GlobalConsensus(network), Parachain(id), PalletInstance(pallet), GeneralIndex(index)]) => {
Some(FungibleAssetLocation::External {
network: (*network).try_into().ok()?,
child: Some(Para {
id: (*id).try_into().ok()?,
pallet: *pallet,
index: (*index).try_into().ok()?,
}),
})
}
(1, [Parachain(id), PalletInstance(pallet), GeneralIndex(index)]) => {
Some(FungibleAssetLocation::Sibling(Para {
id: (*id).try_into().ok()?,
pallet: *pallet,
index: (*index).try_into().ok()?,
}))
}
(0, [PalletInstance(13), GeneralIndex(index)]) => Some(FungibleAssetLocation::Here(
(*index)
.try_into()
.expect("as it is here, we the types will match; qed"),
)),
_ => None,
}
}

fn convert_back(value: &FungibleAssetLocation) -> Option<MultiLocation> {
fn convert_back(value: &FungibleAssetLocation) -> Option<Location> {
match *value {
FungibleAssetLocation::Here(index) => Some(MultiLocation {
parents: 0,
interior: Junctions::X2(PalletInstance(13), GeneralIndex(index.into())),
}),
FungibleAssetLocation::Sibling(Para { id, pallet, index }) => Some(MultiLocation {
parents: 1,
interior: Junctions::X3(Parachain(id.into()), PalletInstance(pallet), GeneralIndex(index.into())),
}),
FungibleAssetLocation::External { network, child: None } => Some(MultiLocation {
parents: 2,
interior: Junctions::X1(GlobalConsensus(network.into())),
}),
FungibleAssetLocation::Here(index) => {
Some(Location::new(0, [PalletInstance(13), GeneralIndex(index.into())]))
}
FungibleAssetLocation::Sibling(Para { id, pallet, index }) => Some(Location::new(
1,
[Parachain(id.into()), PalletInstance(pallet), GeneralIndex(index.into())],
)),
FungibleAssetLocation::External { network, child: None } => {
Some(Location::new(2, [GlobalConsensus(network.into())]))
}
FungibleAssetLocation::External {
network,
child: Some(Para { id, pallet, index }),
} => Some(MultiLocation {
parents: 2,
interior: Junctions::X4(
} => Some(Location::new(
2,
[
GlobalConsensus(network.into()),
Parachain(id.into()),
PalletInstance(pallet),
GeneralIndex(index.into()),
),
}),
],
)),
}
}
}
Expand Down
Loading