Skip to content

Commit

Permalink
Polkadot v0.9.38 (#1332)
Browse files Browse the repository at this point in the history
* Diener 0.9.38 + cargo update

* fix import

* wip on GeneralKey and xcm configs

* fixup

* Update docker images to 0.9.38

* Fix dup dependencies

* wip

* Add missing features to root, dev, connectors

* wip

* Add getrandom js

* Fix missing features

* cargo update

* cargo update

* tmp: Add std features to integration-tests

* Fix all pallet's missing features

* Fix missing features of all libs

* wip

* wip

* fix: remove unused rand from integration tests

* fix: remove unused dep

* fix: missing std feat in pool-system

* chore: revert rust nightly version to latest supported

* cargo update

* Fix connectors weight issue

* xcm updates

* pallet_authorship::Config updates

* wip: Update xcm Trader

* Update xtokens Config

* Update more configs

* Dry AccountIdToMultiLocation

* Weights v2 updates

* Use ConvertedConcreteId instead

ConvertedConcreteAssetId is now deprecated

* wip

* wip

* fmt

* Update pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi

* wip

* wip

* Update impl xcm_executor::Config

* Fix imports

* wip

* wip

* Fix node, service and evm issues

* fmt

* Fix integration tests compilation errors

* wip: Fix xcm transfer tests

* wip: Fix xcm tests

* Fix transfer_ausd_to_centrifuge

* fix xcm tests

* fmt

* fixup

* clippy fix

* Update xcm v1 -> v3 in some tests

* more fixes

* fmt

* Add note on failing test

* Re-enable all other e2e tests

* fmt

* fixup

* Drop comments

* Test handling of XCM v2 multilocations in storage

* fmt

* fixup

* fixup

* Fix from_xcm_versioned_address_works

* Revive and fix kusama/currency_id_convert tests

* xcm: Simplify CurrencyIdConvert

* fmt

* fmt

* Address @wischli's review comments

* Fix all missing cargo features

* Fix cargo doc by bumping toolchain

The issue we are experiencing now apparently by bumping to polkadot
0.9.38 seems to have been fixed bacm in Nov 2022 but our current
toolchain version didn't yet include it. So we bump the toolchain
version. Working well locally.

* fmt

* clippy

* Fix: Failing integration tests (#1370)

* deps: Update RUST_TOOLCHAIN to nightly-2023-02-07

* Document general_key fn

* Fix clippy

* fmt

---------

Co-authored-by: William Freudenberger <w.freude@icloud.com>
Co-authored-by: Frederik Gartenmeister <mustermeiszer@posteo.de>
Co-authored-by: cdamian <17934949+cdamian@users.noreply.github.com>
  • Loading branch information
4 people committed May 31, 2023
1 parent eb6d366 commit 241ff57
Show file tree
Hide file tree
Showing 102 changed files with 3,611 additions and 2,491 deletions.
990 changes: 555 additions & 435 deletions Cargo.lock

Large diffs are not rendered by default.

928 changes: 469 additions & 459 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eux

RUST_TOOLCHAIN="${RUST_TOOLCHAIN:-nightly-2022-11-14}"
RUST_TOOLCHAIN="${RUST_TOOLCHAIN:-nightly-2023-02-07}"
SRTOOL_VERSION="${SRTOOL_VERSION:-1.66.1-0.9.25}"
PACKAGE="${PACKAGE:-centrifuge-runtime}" # Need to replicate job for all runtimes
RUNTIME="${RUNTIME:-centrifuge}"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-local-relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3'
services:
node_alice:
container_name: alice
image: "parity/polkadot:v0.9.37"
image: "parity/polkadot:v0.9.38"
ports:
- "30333:30333"
- "9933:9933"
Expand Down Expand Up @@ -32,7 +32,7 @@ services:
node_bob:
container_name: bob
image: "parity/polkadot:v0.9.37"
image: "parity/polkadot:v0.9.38"
ports:
- "30344:30333"
- "9935:9933"
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# This selects a nightly Rust version, based on the date.
nightly-date = pkgs.lib.strings.removePrefix "nightly-" rustToolChainTOML.toolchain.channel;
# This is the hash of the Rust toolchain at nightly-date, required for reproducibility.
nightly-sha256 = "sha256-UuVX3RxSsUfng4G/Bec8JcI/lOUmxrG7NXSG5hMRgbc=";
nightly-sha256 = "sha256-0HHSyIcGCh8bXZFzFMc2dSPJTtd02eijcok5YXHd+5A=";
# This is the git short commit of the current version of the program.
shortCommit = builtins.substring 0 7 (inputs.self.rev or "dirty");

Expand Down
10 changes: 5 additions & 5 deletions libs/mock-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ version = "0.0.1"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }

[dev-dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
scale-info = { version = "2.3.0", features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
4 changes: 2 additions & 2 deletions libs/mock-builder/src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl FunctionLocation {
.map(|trait_path| trait_path.split_once(" as").expect("always ' as'").0)
.unwrap_or(path);

Self(format!("{}::{}", path, name))
Self(format!("{path}::{name}"))
}

/// Remove the prefix from the function name.
Expand All @@ -57,7 +57,7 @@ impl FunctionLocation {
)
});

Self(format!("{}::{}", path, name))
Self(format!("{path}::{name}"))
}

/// Add a representation of the function input and output types
Expand Down
3 changes: 1 addition & 2 deletions libs/mock-builder/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ impl fmt::Display for Error {
Error::CallNotFound => write!(f, "Trying to call a function that is not registered"),
Error::TypeNotMatch { expected, found } => write!(
f,
"The function is registered but the type mismatches. Expected {}, found: {}",
expected, found
"The function is registered but the type mismatches. Expected {expected}, found: {found}",
),
}
}
Expand Down
17 changes: 11 additions & 6 deletions libs/mocks/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]
codec = { package = "parity-scale-codec", default-features = false, version = "3.0.0", features = ["derive"] }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }

cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
Expand All @@ -36,18 +36,23 @@ std = [
"cfg-primitives/std",
"cfg-traits/std",
"cfg-types/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"cfg-primitives/runtime-benchmarks",
"cfg-traits/runtime-benchmarks",
"cfg-types/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"cfg-types/try-runtime",
"cfg-primitives/try-runtime",
"cfg-traits/try-runtime",
"sp-runtime/try-runtime",
]
17 changes: 9 additions & 8 deletions libs/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ scale-info = { version = "2.3.0", default-features = false, features = ["derive"
serde = { version = "1.0.119" }

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

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

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

[features]
default = ["std"]
Expand All @@ -54,4 +54,5 @@ try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-collective/try-runtime",
"sp-runtime/try-runtime",
]
2 changes: 1 addition & 1 deletion libs/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub mod types {

/// Common constants for all runtimes
pub mod constants {
use cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE;
use cumulus_primitives_core::relay_chain::MAX_POV_SIZE;
use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight};
use sp_runtime::Perbill;

Expand Down
4 changes: 2 additions & 2 deletions libs/proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "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.37" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }

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

[features]
default = ["std"]
Expand Down
11 changes: 6 additions & 5 deletions libs/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.119", default-features = false }

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

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

[features]
default = ["std"]
Expand Down Expand Up @@ -59,4 +59,5 @@ try-runtime = [
"cfg-types/try-runtime",
"cfg-primitives/try-runtime",
"cfg-traits/try-runtime",
"sp-runtime/try-runtime",
]
4 changes: 2 additions & 2 deletions libs/test-utils/src/mocks/authority_origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin(_asset_id: &Option<CurrencyId>) -> Origin {
todo!()
fn try_successful_origin(_: &Option<CurrencyId>) -> Result<Origin, ()> {
Err(())
}
}
9 changes: 5 additions & 4 deletions libs/traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
cfg-primitives = { path = "../primitives", default-features = false }
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
impl-trait-for-tuples = "0.2.1"
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.37" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }

[dev-dependencies]
cfg-mocks = { path = "../mocks" }
Expand All @@ -44,4 +44,5 @@ std = [
try-runtime = [
"frame-support/try-runtime",
"cfg-primitives/try-runtime",
"sp-runtime/try-runtime",
]
22 changes: 13 additions & 9 deletions libs/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ scale-info = { version = "2.3.0", default-features = false, features = ["derive"
serde = { version = "1.0.119" }

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

orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.37" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.38" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.38" }

# 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.37" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.38" }
hex = { version = "0.4.3", default_features = false }

[features]
Expand All @@ -41,9 +41,9 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"cfg-primitives/runtime-benchmarks",
"cfg-traits/runtime-benchmarks",
"cfg-utils/runtime-benchmarks",
"orml-asset-registry/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
std = [
"cfg-primitives/std",
Expand All @@ -58,10 +58,14 @@ std = [
"serde/std",
"sp-arithmetic/std",
"xcm/std",
"cfg-utils/std",
"sp-core/std",
]
try-runtime = [
"cfg-primitives/try-runtime",
"cfg-traits/try-runtime",
"cfg-utils/try-runtime",
"frame-support/try-runtime",
"orml-asset-registry/try-runtime",
"sp-runtime/try-runtime",
]
2 changes: 1 addition & 1 deletion libs/types/src/fixed_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ impl sp_std::fmt::Debug for Rate {
} else {
""
};
format!("{}{}", signum_for_zero, int)
format!("{signum_for_zero}{int}")
};
let precision = (Self::accuracy() as f64).log10() as usize;
let fractional = format!(
Expand Down
18 changes: 13 additions & 5 deletions libs/types/src/locations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use sp_runtime::{
traits::{BlakeTwo256, Hash},
AccountId32,
};
use xcm::{v1::MultiLocation, VersionedMultiLocation};
use xcm::{latest::MultiLocation, VersionedMultiLocation};

use crate::domain_address::DomainAddress;
/// Location types for destinations that can receive restricted transfers
Expand Down Expand Up @@ -49,6 +49,14 @@ impl From<MultiLocation> for Location {
}
}

impl From<xcm::v2::MultiLocation> for Location {
fn from(ml: xcm::v2::MultiLocation) -> Self {
// using hash here as multilocation is significantly larger than any other enum
// type here -- 592 bytes, vs 40 bytes for domain address (next largest)
Self::XCM(BlakeTwo256::hash(&ml.encode()))
}
}

impl From<VersionedMultiLocation> for Location {
fn from(vml: VersionedMultiLocation) -> Self {
// using hash here as multilocation is significantly larger than any other enum
Expand Down Expand Up @@ -87,13 +95,13 @@ mod test {

#[test]
fn from_xcm_versioned_address_works() {
let xa = VersionedMultiLocation::V1(MultiLocation::default());
let xa = VersionedMultiLocation::V3(MultiLocation::default());
let l = Location::from(xa.clone());
assert_eq!(
l,
Location::XCM(sp_core::H256(
<[u8; 32]>::from_hex(
"5a121beb1148b31fc56f3d26f80800fd9eb4a90435a72d3cc74c42bc72bca9b8"
"a943e30c855a123a9506e69e678dc65ae9f5b70149cb6b26eb2ed58a59b4bf77"
)
.unwrap()
))
Expand All @@ -102,8 +110,8 @@ mod test {

#[test]
fn from_xcm_versioned_address_doesnt_change_if_content_stays_same() {
let xa = xcm::v1::MultiLocation::default();
let xb = xcm::v2::MultiLocation::default();
let xa = xcm::v2::MultiLocation::default();
let xb = xcm::v3::MultiLocation::default();
let l0 = Location::from(xa.clone());
let l1 = Location::from(xb.clone());
assert_eq!(l0, l1);
Expand Down
20 changes: 13 additions & 7 deletions libs/types/src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ use sp_runtime::{traits::Get, DispatchError, TokenError};
use crate::xcm::XcmMetadata;

#[derive(
Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen,
Clone,
Copy,
Default,
PartialOrd,
Ord,
PartialEq,
Eq,
Debug,
Encode,
Decode,
TypeInfo,
MaxEncodedLen,
)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum CurrencyId {
// The Native token, representing AIR in Altair and CFG in Centrifuge.
#[default]
Native,

// A Tranche token
Expand Down Expand Up @@ -61,12 +73,6 @@ pub enum StakingCurrency {

pub type ForeignAssetId = u32;

impl Default for CurrencyId {
fn default() -> Self {
CurrencyId::Native
}
}

// A way to generate different currencies from a number.
// Can be used in tests/benchmarks to generate different currencies.
impl From<u32> for CurrencyId {
Expand Down

0 comments on commit 241ff57

Please sign in to comment.