Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into at/contracts-bounded
Browse files Browse the repository at this point in the history
  • Loading branch information
parity-processbot committed May 18, 2022
2 parents d90b4c2 + b98a9a0 commit be6f529
Show file tree
Hide file tree
Showing 16 changed files with 524 additions and 544 deletions.
954 changes: 468 additions & 486 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/relay-chain-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ parking_lot = "0.12.0"
derive_more = "0.99.2"
async-trait = "0.1.53"
thiserror = "1.0.31"
jsonrpsee-core = "0.13.0"
jsonrpsee-core = "0.13.1"
parity-scale-codec = "3.1.2"
2 changes: 1 addition & 1 deletion client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ futures = "0.3.21"
futures-timer = "3.0.2"
parity-scale-codec = "3.1.2"
parking_lot = "0.12.0"
jsonrpsee = { version = "0.13.0", features = ["ws-client"] }
jsonrpsee = { version = "0.13.1", features = ["ws-client"] }
tracing = "0.1.34"
async-trait = "0.1.53"
url = "2.2.2"
Expand Down
2 changes: 1 addition & 1 deletion pallets/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ pub mod pallet {
impl<T: Config> Pallet<T> {
/// Get a unique, inaccessible account id from the `PotId`.
pub fn account_id() -> T::AccountId {
T::PotId::get().into_account()
T::PotId::get().into_account_truncating()
}

/// Removes a candidate if they exist and sends them back their deposit
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-system/proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ proc-macro = true

[dependencies]
syn = "1.0.94"
proc-macro2 = "1.0.38"
proc-macro2 = "1.0.39"
quote = "1.0.18"
proc-macro-crate = "1.1.3"

Expand Down
2 changes: 1 addition & 1 deletion parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.137", features = ["derive"] }
hex-literal = "0.3.4"
jsonrpsee = { version = "0.13.0", features = ["server"] }
jsonrpsee = { version = "0.13.1", features = ["server"] }

# Local
parachain-template-runtime = { path = "../runtime" }
Expand Down
5 changes: 2 additions & 3 deletions parachain-template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
use parachain_template_runtime::{Block, RuntimeApi};
use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
Expand All @@ -19,7 +18,7 @@ use sc_service::{
TaskManager,
};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::traits::Block as BlockT;
use sp_runtime::traits::{AccountIdConversion, Block as BlockT};
use std::{io::Write, net::SocketAddr};

fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Expand Down Expand Up @@ -309,7 +308,7 @@ pub fn run() -> Result<()> {
let id = ParaId::from(para_id);

let parachain_account =
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account(&id);
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);

let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ statemint-runtime = { path = "statemint" }
statemine-runtime = { path = "statemine" }
westmint-runtime = { path = "westmint" }
canvas-kusama-runtime = { path = "canvas-kusama" }
jsonrpsee = { version = "0.13.0", features = ["server"] }
jsonrpsee = { version = "0.13.1", features = ["server"] }
parachains-common = { path = "parachains-common" }

# Substrate
Expand Down
5 changes: 2 additions & 3 deletions polkadot-parachains/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
use parachains_common::{AuraId, StatemintAuraId};
use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
Expand All @@ -38,7 +37,7 @@ use sc_service::{
TaskManager,
};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::traits::Block as BlockT;
use sp_runtime::traits::{AccountIdConversion, Block as BlockT};
use std::{io::Write, net::SocketAddr};

trait IdentifyChain {
Expand Down Expand Up @@ -567,7 +566,7 @@ pub fn run() -> Result<()> {
let id = ParaId::from(para_id);

let parachain_account =
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account(&id);
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);

let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
Expand Down
20 changes: 10 additions & 10 deletions polkadot-parachains/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::set_team { .. }) |
Call::Uniques(pallet_uniques::Call::set_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::set_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::clear_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::AssetManager => matches!(
Expand All @@ -362,8 +362,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::burn { .. }) |
Call::Uniques(pallet_uniques::Call::freeze { .. }) |
Call::Uniques(pallet_uniques::Call::thaw { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_class { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_class { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::Collator => matches!(
Expand Down Expand Up @@ -500,8 +500,8 @@ impl pallet_asset_tx_payment::Config for Runtime {
}

parameter_types! {
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const CollectionDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const ItemDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
Expand All @@ -512,12 +512,12 @@ parameter_types! {

impl pallet_uniques::Config for Runtime {
type Event = Event;
type ClassId = u32;
type InstanceId = u32;
type CollectionId = u32;
type ItemId = u32;
type Currency = Balances;
type ForceOrigin = AssetsForceOrigin;
type ClassDeposit = ClassDeposit;
type InstanceDeposit = InstanceDeposit;
type CollectionDeposit = CollectionDeposit;
type ItemDeposit = ItemDeposit;
type MetadataDepositBase = UniquesMetadataDepositBase;
type AttributeDepositBase = AttributeDepositBase;
type DepositPerByte = DepositPerByte;
Expand Down
10 changes: 5 additions & 5 deletions polkadot-parachains/statemine/src/weights/pallet_uniques.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn freeze_class() -> Weight {
fn freeze_collection() -> Weight {
(13_243_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn thaw_class() -> Weight {
fn thaw_collection() -> Weight {
(12_996_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand All @@ -157,7 +157,7 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassAccount (r:0 w:1)
fn force_asset_status() -> Weight {
fn force_item_status() -> Weight {
(16_719_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Expand Down Expand Up @@ -194,14 +194,14 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn set_class_metadata() -> Weight {
fn set_collection_metadata() -> Weight {
(28_446_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Uniques Class (r:1 w:0)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn clear_class_metadata() -> Weight {
fn clear_collection_metadata() -> Weight {
(26_425_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand Down
20 changes: 10 additions & 10 deletions polkadot-parachains/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::set_team { .. }) |
Call::Uniques(pallet_uniques::Call::set_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::set_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::clear_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::AssetManager => matches!(
Expand All @@ -363,8 +363,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::burn { .. }) |
Call::Uniques(pallet_uniques::Call::freeze { .. }) |
Call::Uniques(pallet_uniques::Call::thaw { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_class { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_class { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::Collator => matches!(
Expand Down Expand Up @@ -501,8 +501,8 @@ impl pallet_asset_tx_payment::Config for Runtime {
}

parameter_types! {
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const CollectionDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const ItemDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
Expand All @@ -513,12 +513,12 @@ parameter_types! {

impl pallet_uniques::Config for Runtime {
type Event = Event;
type ClassId = u32;
type InstanceId = u32;
type CollectionId = u32;
type ItemId = u32;
type Currency = Balances;
type ForceOrigin = AssetsForceOrigin;
type ClassDeposit = ClassDeposit;
type InstanceDeposit = InstanceDeposit;
type CollectionDeposit = CollectionDeposit;
type ItemDeposit = ItemDeposit;
type MetadataDepositBase = UniquesMetadataDepositBase;
type AttributeDepositBase = AttributeDepositBase;
type DepositPerByte = DepositPerByte;
Expand Down
10 changes: 5 additions & 5 deletions polkadot-parachains/statemint/src/weights/pallet_uniques.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn freeze_class() -> Weight {
fn freeze_collection() -> Weight {
(13_259_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn thaw_class() -> Weight {
fn thaw_collection() -> Weight {
(13_207_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand All @@ -157,7 +157,7 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassAccount (r:0 w:1)
fn force_asset_status() -> Weight {
fn force_item_status() -> Weight {
(16_812_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Expand Down Expand Up @@ -194,14 +194,14 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn set_class_metadata() -> Weight {
fn set_collection_metadata() -> Weight {
(28_613_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Uniques Class (r:1 w:0)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn clear_class_metadata() -> Weight {
fn clear_collection_metadata() -> Weight {
(26_273_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand Down
20 changes: 10 additions & 10 deletions polkadot-parachains/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::set_team { .. }) |
Call::Uniques(pallet_uniques::Call::set_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::set_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::clear_class_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::AssetManager => matches!(
Expand All @@ -357,8 +357,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::Uniques(pallet_uniques::Call::burn { .. }) |
Call::Uniques(pallet_uniques::Call::freeze { .. }) |
Call::Uniques(pallet_uniques::Call::thaw { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_class { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_class { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) |
Call::Utility { .. } | Call::Multisig { .. }
),
ProxyType::Collator => matches!(
Expand Down Expand Up @@ -492,8 +492,8 @@ impl pallet_asset_tx_payment::Config for Runtime {
}

parameter_types! {
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const CollectionDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const ItemDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
Expand All @@ -504,12 +504,12 @@ parameter_types! {

impl pallet_uniques::Config for Runtime {
type Event = Event;
type ClassId = u32;
type InstanceId = u32;
type CollectionId = u32;
type ItemId = u32;
type Currency = Balances;
type ForceOrigin = AssetsForceOrigin;
type ClassDeposit = ClassDeposit;
type InstanceDeposit = InstanceDeposit;
type CollectionDeposit = CollectionDeposit;
type ItemDeposit = ItemDeposit;
type MetadataDepositBase = UniquesMetadataDepositBase;
type AttributeDepositBase = AttributeDepositBase;
type DepositPerByte = DepositPerByte;
Expand Down
10 changes: 5 additions & 5 deletions polkadot-parachains/westmint/src/weights/pallet_uniques.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn freeze_class() -> Weight {
fn freeze_collection() -> Weight {
(13_277_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Uniques Class (r:1 w:1)
fn thaw_class() -> Weight {
fn thaw_collection() -> Weight {
(12_984_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand All @@ -157,7 +157,7 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassAccount (r:0 w:1)
fn force_asset_status() -> Weight {
fn force_item_status() -> Weight {
(16_252_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Expand Down Expand Up @@ -194,14 +194,14 @@ impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
}
// Storage: Uniques Class (r:1 w:1)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn set_class_metadata() -> Weight {
fn set_collection_metadata() -> Weight {
(28_141_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Uniques Class (r:1 w:0)
// Storage: Uniques ClassMetadataOf (r:1 w:1)
fn clear_class_metadata() -> Weight {
fn clear_collection_metadata() -> Weight {
(26_122_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand Down
2 changes: 1 addition & 1 deletion test/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
async-trait = "0.1.53"
codec = { package = "parity-scale-codec", version = "3.0.0" }
criterion = { version = "0.3.5", features = [ "async_tokio" ] }
jsonrpsee = { version = "0.13.0", features = ["server"] }
jsonrpsee = { version = "0.13.1", features = ["server"] }
parking_lot = "0.12.0"
rand = "0.8.5"
serde = { version = "1.0.137", features = ["derive"] }
Expand Down

0 comments on commit be6f529

Please sign in to comment.