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

use crates.io #961

Merged
merged 7 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
134 changes: 68 additions & 66 deletions Cargo.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,70 +35,72 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive
serde = { version = "1.0.189" }
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["max-encoded-len"] }

frame-benchmarking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-support = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-system = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-authority-discovery = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-authorship = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-babe = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-balances = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-elections-phragmen = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-message-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-staking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-treasury = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-preimage = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-root-testing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-authority-discovery = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-consensus = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-consensus-slots = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-debug-derive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-externalities = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-inherents = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-io = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-keystore = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-npos-elections = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-panic-handler = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-runtime = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-runtime-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-staking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-state-machine = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-std = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-storage = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-trie = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-version = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-wasm-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-tracing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-maybe-compressed-blob = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-weights = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-pallet-xcm = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
parachain-info = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
pallet-xcm = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
polkadot-parachain-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
polkadot-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.4.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.4.0", default-features = false }
cumulus-pallet-xcm = { version = "0.4.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.4.0", default-features = false }
cumulus-primitives-core = { version = "0.4.0", default-features = false }
frame-benchmarking = { version = "25.0.0", default-features = false }
frame-support = { version = "25.0.0", default-features = false }
frame-system = { version = "25.0.0", default-features = false }
pallet-authority-discovery = { version = "25.0.0", default-features = false }
pallet-authorship = { version = "25.0.0", default-features = false }
pallet-babe = { version = "25.0.0", default-features = false }
pallet-balances = { version = "25.0.0", default-features = false }
pallet-elections-phragmen = { version = "26.0.0", default-features = false }
pallet-message-queue = { version = "28.0.0", default-features = false }
pallet-preimage = { version = "25.0.0", default-features = false }
pallet-root-testing = { version = "1.0.0", default-features = false }
pallet-scheduler = { version = "26.0.0", default-features = false }
pallet-session = { version = "25.0.0", default-features = false }
pallet-staking = { version = "25.0.0", default-features = false }
pallet-timestamp = { version = "24.0.0", default-features = false }
pallet-transaction-payment = { version = "25.0.0", default-features = false }
pallet-treasury = { version = "24.0.0", default-features = false }
pallet-vesting = { version = "25.0.0", default-features = false }
pallet-xcm = { version = "4.0.0", default-features = false }
parachain-info = { package = "staging-parachain-info", version = "0.4.0", default-features = false }
polkadot-core-primitives = { version = "4.0.0", default-features = false }
polkadot-parachain-primitives = { version = "3.0.0", default-features = false }
polkadot-primitives = { version = "4.0.0", default-features = false }
polkadot-runtime-common = { version = "4.0.0", default-features = false }
polkadot-runtime-parachains = { version = "4.0.0", default-features = false }
sp-api = { version = "23.0.0", default-features = false }
sp-application-crypto = { version = "27.0.0", default-features = false }
sp-arithmetic = { version = "20.0.0", default-features = false }
sp-authority-discovery = { version = "23.0.0", default-features = false }
sp-blockchain = { version = "25.0.0", default-features = false }
sp-consensus = { version = "0.29.0", default-features = false }
sp-consensus-slots = { version = "0.29.0", default-features = false }
sp-core = { version = "25.0.0", default-features = false }
sp-debug-derive = { version = "12.0.0", default-features = false }
sp-externalities = { version = "0.23.0", default-features = false }
sp-inherents = { version = "23.0.0", default-features = false }
sp-io = { version = "27.0.0", default-features = false }
sp-keystore = { version = "0.31.0", default-features = false }
sp-maybe-compressed-blob = { version = "9.0.0", default-features = false }
sp-npos-elections = { version = "23.0.0", default-features = false }
sp-panic-handler = { version = "12.0.0", default-features = false }
sp-runtime = { version = "28.0.0", default-features = false }
sp-runtime-interface = { version = "21.0.0", default-features = false }
sp-session = { version = "24.0.0", default-features = false }
sp-staking = { version = "23.0.0", default-features = false }
sp-state-machine = { version = "0.32.0", default-features = false }
sp-std = { version = "12.0.0", default-features = false }
sp-storage = { version = "17.0.0", default-features = false }
sp-timestamp = { version = "23.0.0", default-features = false }
sp-tracing = { version = "14.0.0", default-features = false }
sp-trie = { version = "26.0.0", default-features = false }
sp-version = { version = "26.0.0", default-features = false }
sp-wasm-interface = { version = "18.0.0", default-features = false }
sp-weights = { version = "24.0.0", default-features = false }
xcm = { package = "staging-xcm", version = "4.0.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", version = "4.0.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", version = "4.0.0", default-features = false }

xcm-simulator = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-client-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-client-db = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-executor = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-executor-common = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-utils = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-client-api = { version = "25.0.0" }
sc-client-db = { version = "0.32.0" }
sc-executor = { version = "0.29.0" }
sc-executor-common = { version = "0.26.0" }
sc-utils = { version = "11.0.0" }
xcm-simulator = { version = "4.0.0" }
4 changes: 4 additions & 0 deletions asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ cumulus-primitives-core = { workspace = true, features = ["std"] }
cumulus-pallet-dmp-queue = { workspace = true, features = ["std"] }
cumulus-pallet-xcmp-queue = { workspace = true, features = ["std"] }
cumulus-pallet-xcm = { workspace = true, features = ["std"] }
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
parachain-info = { workspace = true, features = ["std"] }

# polkadot
polkadot-parachain-primitives = { workspace = true, features = ["std"] }
polkadot-runtime-parachains = { workspace = true, features = ["std"] }
polkadot-runtime-common = { workspace = true, features = ["std"] }
xcm-simulator = { workspace = true }

# orml
Expand Down Expand Up @@ -78,6 +80,8 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
2 changes: 1 addition & 1 deletion asset-registry/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod v2 {

pub(crate) fn migrate<T: Config>() -> Weight {
let mut weight: Weight = Weight::zero();
let module_prefix = LocationToAssetId::<T>::module_prefix();
let module_prefix = LocationToAssetId::<T>::pallet_prefix();
let storage_prefix = LocationToAssetId::<T>::storage_prefix();

weight.saturating_accrue(T::DbWeight::get().reads(1));
Expand Down
30 changes: 18 additions & 12 deletions asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use super::{Amount, Balance, CurrencyId, CurrencyIdConvert, ParachainXcmRouter};

use crate as orml_asset_registry;

use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId};
use cumulus_pallet_parachain_system::AnyRelayNumber;
use cumulus_primitives_core::ParaId;
use frame_support::traits::{EnsureOrigin, EnsureOriginWithArg};
use frame_support::{
construct_runtime, match_types, ord_parameter_types, parameter_types,
Expand All @@ -20,6 +21,7 @@ use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}
use pallet_xcm::XcmPassthrough;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
use sp_core::H256;
use sp_runtime::{
traits::{AccountIdConversion, Convert, IdentityLookup},
Expand Down Expand Up @@ -57,7 +59,7 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = Everything;
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Runtime>;
type MaxConsumers = ConstU32<16>;
}

Expand All @@ -72,6 +74,7 @@ impl pallet_balances::Config for Runtime {
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = [u8; 8];
type MaxHolds = ();
type MaxFreezes = ();
Expand Down Expand Up @@ -261,26 +264,28 @@ impl Config for XcmConfig {
type Aliasers = Nothing;
}

pub struct ChannelInfo;
impl GetChannelInfo for ChannelInfo {
fn get_channel_status(_id: ParaId) -> ChannelStatus {
ChannelStatus::Ready(10, 10)
}
fn get_channel_max(_id: ParaId) -> Option<usize> {
Some(usize::max_value())
}
impl cumulus_pallet_parachain_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = ();
type OutboundXcmpMessageSource = XcmpQueue;
type DmpMessageHandler = ();
type ReservedDmpWeight = ();
type XcmpMessageHandler = XcmpQueue;
type ReservedXcmpWeight = ();
type CheckAssociatedRelayNumber = AnyRelayNumber;
}

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
type ChannelInfo = ChannelInfo;
type ChannelInfo = ParachainSystem;
type VersionWrapper = ();
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
type ControllerOrigin = EnsureRoot<AccountId>;
type ControllerOriginConverter = XcmOriginToCallOrigin;
type WeightInfo = ();
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down Expand Up @@ -397,6 +402,7 @@ construct_runtime!(
Balances: pallet_balances,

ParachainInfo: parachain_info,
ParachainSystem: cumulus_pallet_parachain_system,
XcmpQueue: cumulus_pallet_xcmp_queue,
DmpQueue: cumulus_pallet_dmp_queue,
CumulusXcm: cumulus_pallet_xcm,
Expand Down
1 change: 1 addition & 0 deletions asset-registry/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ impl pallet_balances::Config for Runtime {
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = [u8; 8];
type MaxHolds = ();
type MaxFreezes = ();
Expand Down
3 changes: 1 addition & 2 deletions authority/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ impl pallet_preimage::Config for Runtime {
type WeightInfo = ();
type Currency = ();
type ManagerOrigin = EnsureRoot<u128>;
type BaseDeposit = ();
type ByteDeposit = ();
type Consideration = ();
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions currencies/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = ReserveIdentifier;
type WeightInfo = ();
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = [u8; 8];
type MaxHolds = ();
type MaxFreezes = ();
Expand Down
12 changes: 12 additions & 0 deletions tokens/src/imbalances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Imbalance<T::Balance> for Pos
fn peek(&self) -> T::Balance {
self.0
}

fn extract(&mut self, amount: T::Balance) -> Self {
let new: T::Balance = self.0.min(amount);
self.0 -= new;
Self::new(new)
}
}

impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> TryDrop for NegativeImbalance<T, GetCurrencyId> {
Expand Down Expand Up @@ -157,6 +163,12 @@ impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Imbalance<T::Balance> for Neg
fn peek(&self) -> T::Balance {
self.0
}

fn extract(&mut self, amount: T::Balance) -> Self {
let new: T::Balance = self.0.min(amount);
self.0 -= new;
Self::new(new)
}
}

impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Drop for PositiveImbalance<T, GetCurrencyId> {
Expand Down
Loading
Loading