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

Mangata dev v0.9.36 #27

Merged
merged 29 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cafa148
run CI for release branch
xlc Nov 7, 2022
f4ef99f
Upgrade polkadot-v0.9.31 (#830)
zjb0807 Nov 7, 2022
c23d3d2
add CODECOV_TOKEN (#836)
zjb0807 Nov 10, 2022
2b4d4db
claim_rewards should not create empty records (#835)
wangjj9219 Nov 10, 2022
9d54d0e
Update Readme (#837)
fiexer Nov 10, 2022
5803a01
Token hook refactoring; Posthooks for deposit and transfer (#834)
daniel-savu Nov 10, 2022
3fcd3cf
fix(tokens): PostDeposit hook (#839)
daniel-savu Nov 15, 2022
02ec3ea
Add Centrifuge to users of orml (#842)
mikiquantum Nov 16, 2022
43d237d
Add Crust to ORML (#843)
mmyyrroonn Nov 16, 2022
740f0b8
refactor: make weight argument in xtokens transfers optional (#841)
sander2 Nov 16, 2022
7f95607
Update weight-gen template.hbs (#844)
zjb0807 Nov 21, 2022
e885d8d
prevent nested DelayedOrigin (#845)
xlc Nov 22, 2022
394d4c3
Add try-runtime feature for orml-payments (#846)
zjb0807 Nov 22, 2022
f336875
Update to Polkadot v0.9.32 (#848)
NunoAlexandre Nov 22, 2022
56876b4
Add new for DelayedOrigin (#849)
zjb0807 Nov 23, 2022
10cdcf1
Update README.md (#851)
lrcnz Nov 23, 2022
c218d98
#xcm polishing #xtokens README.md (#856)
dzmitry-lahoda Nov 29, 2022
7e3c9ae
Update github actions (#855)
zjb0807 Nov 29, 2022
65da351
Changed `vested_transfer` extrinsic behavior. (#857)
PraetorP Nov 30, 2022
dc39cfd
Upgrade polkadot-v0.9.33 (#858)
Dec 1, 2022
f94894f
use explicit call index (#865)
wangjj9219 Jan 4, 2023
0e23446
Upgrade to polkadot v0.9.36 (#864)
CertainLach Jan 5, 2023
4f5a3f3
update asset_exists (#866)
xlc Jan 5, 2023
9ecd16d
resolve conflicts version 36
devdanco Jan 6, 2023
e147d57
fix test
devdanco Jan 7, 2023
db0381f
Update polkadot v0.9.36 (#878)
zjb0807 Jan 17, 2023
bb1c600
update packages
devdanco Jan 30, 2023
ae089c2
Merge branch 'polkadot-v0.9.36' of https://github.com/open-web3-stack…
devdanco Feb 1, 2023
a8e916a
update reference
devdanco Feb 14, 2023
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
9 changes: 4 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@ jobs:
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly-2022-08-05
toolchain: nightly-2022-10-30
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Generate code coverage
run: |
wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-${{ env.TARPAULIN_VERSION }}-travis.tar.gz
tar -zxvf cargo-tarpaulin-${{ env.TARPAULIN_VERSION }}-travis.tar.gz -C $HOME/.cargo/bin
make Cargo.toml
cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
7 changes: 2 additions & 5 deletions .github/workflows/master.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly-2022-08-05
override: true
default: true
toolchain: nightly-2022-10-30
- name: Install cargo-unleash
run: cargo install cargo-unleash --git https://github.com/xlc/cargo-unleash.git # https://github.com/paritytech/cargo-unleash/pull/38
- name: Prepare
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- run: make Cargo.toml
- run: cargo install cargo-unleash --git https://github.com/xlc/cargo-unleash.git # https://github.com/paritytech/cargo-unleash/pull/38
- run: cargo unleash em-dragons
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
pull_request:
branches:
- master
- polkadot-**
paths-ignore:
- '**/README.md'
push:
branches:
- master
- polkadot-**
paths-ignore:
- '**/README.md'

Expand All @@ -30,14 +32,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly-2022-08-05
toolchain: nightly-2022-10-30
components: rustfmt
target: wasm32-unknown-unknown
override: true
default: true
- name: Install Wasm toolchain
run: rustup target add wasm32-unknown-unknown
- name: Check format
Expand Down
360 changes: 181 additions & 179 deletions Cargo.dev.toml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ dev-check: Cargo.toml check

dev-check-tests: Cargo.toml
cargo check --tests --all
cargo check --tests --features=bench --package=orml-weight-meter --package=orml-bencher-test

dev-test: Cargo.toml
cargo test --all --features runtime-benchmarks
cargo test --all --features=runtime-benchmarks
cargo test --features=bench --package=orml-weight-meter --package=orml-bencher-test

# run benchmarks via Acala node
benchmark-all:
Expand Down
70 changes: 48 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,53 @@ The Open Runtime Module Library (ORML) is a community maintained collection of S

## Runtime Modules Overview

- [orml-auction](./auction)
- Auction module that implements `Auction` trait.
- [orml-currencies](./currencies)
- Provide `MultiCurrency` implementation using `pallet-balances` and `orml-tokens` module.
- [orml-gradually-update](./gradually-update)
#### Utility
- [auction](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/auction)
- Implements a generalized auction interface, used by Acala for liquidation auctions.
- [authority](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/authority)
- Allow more advanced permission configuration such as timelock for governance actions.
- [gradually-update](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/gradually-update)
- Provides way to adjust numeric parameter gradually over a period of time.
- [orml-nft](./nft)
- Non-fungible-token module provides basic functions to create and manager NFT(non fungible token) such as `create_class`, `transfer`, `mint`, `burn`, `destroy_class`.
- [orml-oracle](./oracle)
- Oracle module that makes off-chain data available on-chain.
- [orml-tokens](./tokens)
- Fungible tokens module that implements `MultiCurrency` trait.
- [orml-traits](./traits)
- Shared traits including `BasicCurrency`, `MultiCurrency`, `Auction` and more.
- [orml-utilities](./utilities)
- Various utilities including `OrderSet`.
- [orml-vesting](./vesting)
- [oracle](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/oracle)
- Allow offchain oracle providers to feed data to be consumed by onchain pallets.
- [rewards](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/rewards)
- Implements ability to calculate and distribute token staking rewards.
- [traits](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/traits)
- Implements various utility traits including BasicCurrency, MultiCurrency, Auction and more. Used by other ORML pallets.

#### Tokens
- [asset-registry](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/asset-registry)
- Register asset / token metadata including name, decimals, and XCM MultiLocation
- Partially based on the Acala’s asset-registry pallet, which includes some Acala specific code (e.g. EVM+) so not suitable for other teams.
- [currencies](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/currencies)
- Provide an unified interface to combine pallet-balances and orml-tokens
- [nft](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/nft)
- Provide a non-fungible-token implementation
- [payments](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/payments)
- This pallet allows users to create secure reversible payments that keep funds locked in a merchant’s account until the off-chain goods are confirmed to be received. Each payment gets assigned its own judge that can help resolve any disputes between the two parties.
- [tokens](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/tokens)
- Implements fungible tokens pallet with compatibility with Substrate tokens abstractions
- [vesting](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/vesting)
- Provides scheduled balance locking mechanism, in a *graded vesting* way.
- [orml-xcm-support](./xcm-support)
- Provides traits, types, and implementations to support XCM integration.
- [orml-xtokens](./xtokens)
- Provides way to do cross-chain assets transfer.
- [Step-by-Step guide](https://github.com/open-web3-stack/open-runtime-module-library/wiki/xtokens) to make XCM cross-chain fungible asset transfer available on your parachain

#### XCM
- [xcm-support](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/xcm-support)
- Provides supporting traits, types and implementations, to support cross-chain message(XCM) integration with ORML modules.
- [xcm](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/xcm)
- Provides a way for governance body to dispatch XCM.
- [xtokens](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/xtokens)
- Provide crosschain token transfer functionality.
- Used by multiple parachains for their XCM token transfer implementation.

#### Benchmarking
- [bencher](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/bencher)
- Benchmarking tool using cargo bench for benchmarking
- [benchmarking](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/benchmarking)
- Fork of frame-benchmarking in Substrate to allow implement runtime specific benchmarks
- [weight-gen](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/weight-gen)
- Weight meter file generation
- [weight-meter](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/weight-meter)
- A low overhead dynamic weight meter

## Example

Expand Down Expand Up @@ -64,9 +88,12 @@ ORML is part of the bigger `Open-Web3-Stack` initiative, that is currently under
_In alphabetical order_

- [Acala Network](https://github.com/AcalaNetwork/Acala)
- [Astar Network](https://github.com/AstarNetwork)
- [Bifrost Finance](https://github.com/bifrost-finance/bifrost)
- [Bit.Country](https://github.com/bit-country/Bit-Country-Blockchain)
- [Centrifuge](https://github.com/centrifuge/centrifuge-chain)
- [ChainX](https://github.com/chainx-org/ChainX)
- [Crust](https://github.com/crustio/crust)
- [GameDAO Protocol](https://github.com/gamedaoco)
- [HydraDX](https://github.com/galacticcouncil/hack.HydraDX-node)
- [Interlay and Kintsugi](https://github.com/interlay/interbtc)
Expand All @@ -77,7 +104,6 @@ _In alphabetical order_
- [Manta Network](https://github.com/Manta-Network)
- [Minterest](https://github.com/minterest-finance/minterest-chain-node)
- [OAK](https://github.com/OAK-Foundation/OAK-blockchain)
- [Plasm Network](https://github.com/PlasmNetwork)
- [PolkaFoundry Network](https://github.com/PolkaFoundry)
- [Setheum Network](https://github.com/Setheum-Labs/Setheum)
- [Valiu Liquidity Network](https://github.com/valibre-org/vln-node)
Expand Down
61 changes: 32 additions & 29 deletions asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,79 @@ serde = { version = "1.0.136", optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["max-encoded-len"] }

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

# polkadot
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.31" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.31" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.31" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.31" }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.36" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.36" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.36" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.36" }

# orml
orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false }

# mangata
mangata-types = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" }
mangata-types = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev-v0.9.36" }


[dev-dependencies]
# substrate
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.31" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.36" }

# cumulus
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }

# polkadot
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.31" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.31" }
xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.31" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }

# orml
orml-tokens = { path = "../tokens" }
orml-xtokens = { path = "../xtokens" }
orml-xcm = { path = "../xcm" }
orml-xcm-support = { path = "../xcm-support", default-features = false }
orml-xtokens = { path = "../xtokens" }

[features]
default = ["std"]
std = [
"serde",

"codec/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
"orml-traits/std",
"pallet-xcm/std",
"xcm/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"xcm-builder/std",
"xcm-executor/std",
"mangata-types/std"
"mangata-types/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]

try-runtime = [
"frame-system/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-xcm/try-runtime",
]
5 changes: 3 additions & 2 deletions asset-registry/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use frame_support::{log, pallet_prelude::*, weights::constants::WEIGHT_PER_SECOND};
use crate::module::*;
use frame_support::{log, pallet_prelude::*, weights::constants::{WEIGHT_REF_TIME_PER_SECOND}};
use orml_traits::{
asset_registry::{AssetMetadata, FixedConversionRateProvider, Inspect, Mutate, WeightToFeeConverter},
GetByKey,
Expand Down Expand Up @@ -53,7 +54,7 @@ pub struct FixedRateAssetRegistryTrader<P: FixedConversionRateProvider>(PhantomD
impl<P: FixedConversionRateProvider> WeightToFeeConverter for FixedRateAssetRegistryTrader<P> {
fn convert_weight_to_fee(location: &MultiLocation, weight: Weight) -> Option<u128> {
let fee_per_second = P::get_fee_per_second(location)?;
let weight_ratio = FixedU128::saturating_from_rational(weight.ref_time(), WEIGHT_PER_SECOND.ref_time() as u128);
let weight_ratio = FixedU128::saturating_from_rational(weight.ref_time(), WEIGHT_REF_TIME_PER_SECOND);
let amount = weight_ratio.saturating_mul_int(fee_per_second);
Some(amount)
}
Expand Down
4 changes: 3 additions & 1 deletion asset-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ pub mod module {

#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::register_asset())]
#[transactional]
pub fn register_asset(
Expand All @@ -143,6 +144,7 @@ pub mod module {
Self::do_register_asset(metadata, asset_id)
}

#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::update_asset())]
#[transactional]
pub fn update_asset(
Expand Down Expand Up @@ -304,7 +306,7 @@ impl<T: Config> Pallet<T> {
fn do_insert_location(asset_id: T::AssetId, location: VersionedMultiLocation) -> DispatchResult {
// if the metadata contains a location, set the LocationToAssetId
let location: MultiLocation = location.try_into().map_err(|()| Error::<T>::BadVersion)?;
LocationToAssetId::<T>::try_mutate(&location, |maybe_asset_id| {
LocationToAssetId::<T>::try_mutate(location, |maybe_asset_id| {
ensure!(maybe_asset_id.is_none(), Error::<T>::ConflictingLocation);
*maybe_asset_id = Some(asset_id);
Ok(())
Expand Down
13 changes: 4 additions & 9 deletions asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use frame_support::traits::{EnsureOrigin, EnsureOriginWithArg};
use frame_support::{
construct_runtime, match_types, ord_parameter_types, parameter_types,
traits::{ConstU128, ConstU32, ConstU64, Everything, Nothing},
weights::constants::WEIGHT_PER_SECOND,
weights::constants::WEIGHT_REF_TIME_PER_SECOND,
PalletId,
};
use frame_system::{EnsureRoot, EnsureSignedBy};
Expand Down Expand Up @@ -92,16 +92,11 @@ impl orml_tokens::Config for Runtime {
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type OnSlash = ();
type OnDeposit = ();
type OnTransfer = ();
type CurrencyHooks = ();
type ReserveIdentifier = [u8; 8];
type MaxReserves = ();
type MaxLocks = ConstU32<50>;
type DustRemovalWhitelist = Nothing;
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

#[derive(scale_info::TypeInfo, Encode, Decode, Clone, Eq, PartialEq, Debug)]
Expand Down Expand Up @@ -174,8 +169,8 @@ impl orml_asset_registry::Config for Runtime {
}

parameter_types! {
pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND.ref_time() / 4;
pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND.ref_time() / 4;
pub const ReservedXcmpWeight: Weight = WEIGHT_REF_TIME_PER_SECOND / 4;
pub const ReservedDmpWeight: Weight = WEIGHT_REF_TIME_PER_SECOND / 4;
}

impl parachain_info::Config for Runtime {}
Expand Down
10 changes: 9 additions & 1 deletion asset-registry/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,15 @@ fn test_register_duplicate_location_returns_error() {
ParaA::execute_with(|| {
let metadata = dummy_metadata();

assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), metadata.clone(), None));
assert_ok!(AssetRegistry::register_asset(
RuntimeOrigin::root(),
metadata.clone(),
None
));
let register_asset = RuntimeCall::AssetRegistry(crate::Call::<para::Runtime>::register_asset {
metadata: metadata.clone(),
asset_id: None,
});
assert_noop!(
AssetRegistry::do_register_asset_without_asset_processor(metadata.clone(), 2),
Error::<para::Runtime>::ConflictingLocation
Expand Down
Loading