From 2820fcb3583b86c9d41d6ea5e26e7dbc93f9b947 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 9 Apr 2021 19:09:59 +0300 Subject: [PATCH 01/14] Updates --- Cargo.lock | 20 + Cargo.toml | 1 + pallets/webb-tokens/Cargo.toml | 45 ++ pallets/webb-tokens/src/lib.rs | 888 ++++++++++++++++++++++++++++++ pallets/webb-tokens/src/mock.rs | 173 ++++++ pallets/webb-tokens/src/tests.rs | 0 pallets/webb-tokens/src/traits.rs | 6 + pallets/webb-tokens/src/types.rs | 119 ++++ 8 files changed, 1252 insertions(+) create mode 100644 pallets/webb-tokens/Cargo.toml create mode 100644 pallets/webb-tokens/src/lib.rs create mode 100644 pallets/webb-tokens/src/mock.rs create mode 100644 pallets/webb-tokens/src/tests.rs create mode 100644 pallets/webb-tokens/src/traits.rs create mode 100644 pallets/webb-tokens/src/types.rs diff --git a/Cargo.lock b/Cargo.lock index 3ea12958..7dfdf32c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4647,6 +4647,26 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-webb-tokens" +version = "0.1.0" +dependencies = [ + "bencher", + "frame-benchmarking 3.1.0", + "frame-support", + "frame-system", + "orml-currencies", + "orml-tokens", + "orml-traits", + "pallet-balances", + "parity-scale-codec 2.0.1", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + [[package]] name = "parity-db" version = "0.2.3" diff --git a/Cargo.toml b/Cargo.toml index ae1efce2..eb4bc5b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "node", "pallets/merkle", "pallets/mixer", + "pallets/webb-tokens", "runtime", ] diff --git a/pallets/webb-tokens/Cargo.toml b/pallets/webb-tokens/Cargo.toml new file mode 100644 index 00000000..d5f7a693 --- /dev/null +++ b/pallets/webb-tokens/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "pallet-webb-tokens" +version = "0.1.0" +authors = ["Drew Stone "] +edition = "2018" + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +balances = { version = "3.0.0", default-features = false, package = "pallet-balances" } +frame-support = { default-features = false, version = '3.0.0' } +frame-system = { default-features = false, version = '3.0.0' } +sp-std = { default-features = false, version = "3.0.0" } +sp-runtime = { default-features = false, version = '3.0.0' } +serde = { version = "1.0.101", optional = true, features = ["derive"] } +frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } +orml-traits = { version = "0.4.0", default-features = false } +orml-currencies = { version = "0.4.0", default-features = false } +orml-tokens = { version = "0.4.0", default-features = false } + +[dependencies.bencher] +version = "0.1.5" + +[dev-dependencies] +sp-core = { default-features = false, version = '3.0.0' } +sp-io = { default-features = false, version = '3.0.0' } + +[features] +default = ['std'] +std = [ + "serde", + "codec/std", + "balances/std", + "frame-support/std", + "frame-system/std", + "orml-tokens/std", + "frame-benchmarking/std", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] diff --git a/pallets/webb-tokens/src/lib.rs b/pallets/webb-tokens/src/lib.rs new file mode 100644 index 00000000..2800f8f3 --- /dev/null +++ b/pallets/webb-tokens/src/lib.rs @@ -0,0 +1,888 @@ +// A runtime module Groups with necessary imports + +// Feel free to remove or edit this file as needed. +// If you change the name of this file, make sure to update its references in +// runtime/src/lib.rs If you remove this file, you can remove those references + +// For more guidance on Substrate modules, see the example module +// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod traits; +// pub mod weights; +// #[cfg(feature = "runtime-benchmarks")] +// mod benchmarking; +#[cfg(test)] +pub mod mock; +#[cfg(test)] +mod tests; + +// mod extra_mutator; +// pub use extra_mutator::*; +// mod impl_stored_map; +// mod impl_fungibles; +// mod functions; +mod types; +pub use types::*; + +use sp_std::{prelude::*, borrow::Borrow}; +use sp_runtime::{ + RuntimeDebug, TokenError, traits::{ + AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, Bounded, + StoredMapError, + } +}; +use codec::{Encode, Decode, HasCompact}; +use frame_support::{ensure, dispatch::{DispatchError, DispatchResult}}; +use frame_support::traits::{Currency, ReservableCurrency, BalanceStatus::Reserved, StoredMap}; +use frame_support::traits::tokens::{WithdrawConsequence, DepositConsequence, fungibles}; +use frame_system::Config as SystemConfig; +use orml_traits::MultiCurrency; + +/// Type alias for the orml_traits::MultiCurrency::Balance type +pub type BalanceOf = <::Currency as MultiCurrency<::AccountId>>::Balance; +/// Type alias for the orml_traits::MultiCurrency::CurrencyId type +pub type CurrencyIdOf = + <::Currency as MultiCurrency<::AccountId>>::CurrencyId; + +// pub use weights::WeightInfo; +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::{ + dispatch::DispatchResult, + pallet_prelude::*, + }; + use frame_system::pallet_prelude::*; + use super::*; + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + #[pallet::config] + /// The module configuration trait. + pub trait Config: frame_system::Config + orml_currencies::Config + orml_tokens::Config { + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// The balance type + type Balance: ::Balance; + + /// The amount type, should be signed version of `Balance` + type Amount: ::Amount; + + /// Identifier for the class of asset. + type CurrencyId: ::CurrencyId; + + /// The currency mechanism. + type Currency: MultiCurrency; + + /// The origin which may forcibly create or destroy an asset or otherwise alter privileged + /// attributes. + type ForceOrigin: EnsureOrigin; + + /// The basic amount of funds that must be reserved for an asset. + type CurrencyDeposit: Get>; + + /// The basic amount of funds that must be reserved when adding metadata to your asset. + type MetadataDepositBase: Get>; + + /// The additional funds that must be reserved for the number of bytes you store in your + /// metadata. + type MetadataDepositPerByte: Get>; + + /// The amount of funds that must be reserved when creating a new approval. + type ApprovalDeposit: Get>; + + /// The maximum length of a name or symbol stored on-chain. + type StringLimit: Get; + + /// Additional data to be stored with an account's asset balance. + type Extra: Member + Parameter + Default; + + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", T::Balance = "Balance", T::CurrencyId = "CurrencyId")] + pub enum Event { + /// Some asset class was created. \[asset_id, creator, owner\] + Created(T::CurrencyId, T::AccountId, T::AccountId), + /// Some assets were issued. \[asset_id, owner, total_supply\] + Issued(T::CurrencyId, T::AccountId, T::Balance), + /// Some assets were destroyed. \[asset_id, owner, balance\] + Burned(T::CurrencyId, T::AccountId, T::Balance), + /// The management team changed \[asset_id, issuer, admin, freezer\] + TeamChanged(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId), + /// The owner changed \[asset_id, owner\] + OwnerChanged(T::CurrencyId, T::AccountId), + /// An asset class was destroyed. + Destroyed(T::CurrencyId), + /// Some asset class was force-created. \[asset_id, owner\] + ForceCreated(T::CurrencyId, T::AccountId), + /// New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] + MetadataSet(T::CurrencyId, Vec, Vec, u8, bool), + /// Metadata has been cleared for an asset. \[asset_id\] + MetadataCleared(T::CurrencyId), + /// (Additional) funds have been approved for transfer to a destination account. + /// \[asset_id, source, delegate, amount\] + ApprovedTransfer(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), + /// An approval for account `delegate` was cancelled by `owner`. + /// \[id, owner, delegate\] + ApprovalCancelled(T::CurrencyId, T::AccountId, T::AccountId), + /// An `amount` was transferred in its entirety from `owner` to `destination` by + /// the approved `delegate`. + /// \[id, owner, delegate, destination\] + TransferredApproved(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId, T::Balance), + /// An asset has had its attributes changed by the `Force` origin. + /// \[id\] + CurrencyStatusChanged(T::CurrencyId), + } + + #[pallet::error] + pub enum Error { + /// Account balance must be greater than or equal to the transfer amount. + BalanceLow, + /// Balance should be non-zero. + BalanceZero, + /// The signing account has no permission to do the operation. + NoPermission, + /// The given currency ID is unknown. + Unknown, + /// The origin account is frozen. + Frozen, + /// The currency ID is already taken. + InUse, + /// Invalid witness data given. + BadWitness, + /// Minimum balance should be non-zero. + MinBalanceZero, + /// A mint operation lead to an overflow. + Overflow, + /// No provider reference exists to allow a non-zero balance of a non-self-sufficient currency. + NoProvider, + /// Invalid metadata given. + BadMetadata, + /// No approval exists that would allow the transfer. + Unapproved, + /// The source account would not survive the transfer and it needs to stay alive. + WouldDie, + } + + #[pallet::storage] + /// Details of an asset. + pub(super) type Currency = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + CurrencyDetails>, + >; + + #[pallet::storage] + /// Approved balance transfers. First balance is the amount approved for transfer. Second + /// is the amount of `T::Currency` reserved for storing this. + pub(super) type Approvals = StorageDoubleMap< + _, + Blake2_128Concat, + T::CurrencyId, + Blake2_128Concat, + ApprovalKey, + Approval>, + OptionQuery, + >; + + #[pallet::storage] + /// Metadata of an currency. + pub(super) type Metadata = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + CurrencyMetadata>, + ValueQuery, + >; + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Issue a new class of fungible assets from a public origin. + /// + /// This new asset class has no assets initially and its owner is the origin. + /// + /// The origin must be Signed and the sender must have sufficient funds free. + /// + /// Funds of sender are reserved by `CurrencyDeposit`. + /// + /// Parameters: + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `admin`: The admin of this class of assets. The admin is the initial address of each + /// member of the asset class's admin team. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `Created` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn create( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + admin: ::Source, + min_balance: T::Balance, + ) -> DispatchResultWithPostInfo { + let owner = ensure_signed(origin)?; + let admin = T::Lookup::lookup(admin)?; + + ensure!(!Currency::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + let deposit = T::CurrencyDeposit::get(); + T::Currency::reserve(&owner, deposit)?; + + Currency::::insert(id, CurrencyDetails { + owner: owner.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), + supply: Zero::zero(), + deposit, + min_balance, + is_sufficient: false, + accounts: 0, + sufficients: 0, + approvals: 0, + is_frozen: false, + }); + Self::deposit_event(Event::Created(id, owner, admin)); + Ok(()) + } + + /// Issue a new class of fungible assets from a privileged origin. + /// + /// This new asset class has no assets initially. + /// + /// The origin must conform to `ForceOrigin`. + /// + /// Unlike `create`, no funds are reserved. + /// + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `owner`: The owner of this class of assets. The owner has full superuser permissions + /// over this asset, but may later change and configure the permissions using `transfer_ownership` + /// and `set_team`. + /// - `max_zombies`: The total number of accounts which may hold assets in this class yet + /// have no existential deposit. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `ForceCreated` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_create( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + owner: ::Source, + is_sufficient: bool, + #[pallet::compact] min_balance: T::Balance, + ) -> DispatchResultWithPostInfo { + T::ForceOrigin::ensure_origin(origin)?; + let owner = T::Lookup::lookup(owner)?; + + ensure!(!Currency::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + Currency::::insert(id, CurrencyDetails { + owner: owner.clone(), + issuer: owner.clone(), + admin: owner.clone(), + freezer: owner.clone(), + supply: Zero::zero(), + deposit: Zero::zero(), + min_balance, + is_sufficient, + accounts: 0, + sufficients: 0, + approvals: 0, + is_frozen: false, + }); + Self::deposit_event(Event::ForceCreated(id, owner)); + Ok(()) + } + + /// Destroy a class of fungible assets. + /// + /// The origin must conform to `ForceOrigin` or must be Signed and the sender must be the + /// owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be destroyed. This must identify an existing + /// asset. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(c + p + a)` where: + /// - `c = (witness.accounts - witness.sufficients)` + /// - `s = witness.sufficients` + /// - `a = witness.approvals` + #[pallet::weight(5_000_000)] + pub(super) fn destroy( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + witness: DestroyWitness, + ) -> DispatchResultWithPostInfo { + let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { + Ok(_) => None, + Err(origin) => Some(ensure_signed(origin)?), + }; + Currency::::try_mutate_exists(id, |maybe_details| { + let mut details = maybe_details.take().ok_or(Error::::Unknown)?; + if let Some(check_owner) = maybe_check_owner { + ensure!(details.owner == check_owner, Error::::NoPermission); + } + ensure!(details.accounts == witness.accounts, Error::::BadWitness); + ensure!(details.sufficients == witness.sufficients, Error::::BadWitness); + ensure!(details.approvals == witness.approvals, Error::::BadWitness); + + for (who, v) in Account::::drain_prefix(id) { + Self::dead_account(id, &who, &mut details, v.sufficient); + } + debug_assert_eq!(details.accounts, 0); + debug_assert_eq!(details.sufficients, 0); + + let metadata = Metadata::::take(&id); + T::Currency::unreserve(&details.owner, details.deposit.saturating_add(metadata.deposit)); + + Approvals::::remove_prefix(&id); + Self::deposit_event(Event::Destroyed(id)); + + // NOTE: could use postinfo to reflect the actual number of accounts/sufficient/approvals + Ok(()) + }) + } + + /// Mint assets of a particular class. + /// + /// The origin must be Signed and the sender must be the Issuer of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount minted. + /// - `beneficiary`: The account to be credited with the minted assets. + /// - `amount`: The amount of the asset to be minted. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(1)` + /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. + #[pallet::weight(5_000_000)] + pub(super) fn mint( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + beneficiary: ::Source, + #[pallet::compact] amount: T::Balance + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + let beneficiary = T::Lookup::lookup(beneficiary)?; + Self::do_mint(id, &beneficiary, amount, Some(origin))?; + Self::deposit_event(Event::Issued(id, beneficiary, amount)); + Ok(()) + } + + /// Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. + /// + /// Origin must be Signed and the sender should be the Manager of the asset `id`. + /// + /// Bails with `BalanceZero` if the `who` is already dead. + /// + /// - `id`: The identifier of the asset to have some amount burned. + /// - `who`: The account to be debited from. + /// - `amount`: The maximum amount by which `who`'s balance should be reduced. + /// + /// Emits `Burned` with the actual amount burned. If this takes the balance to below the + /// minimum for the asset, then the amount burned is increased to take it to zero. + /// + /// Weight: `O(1)` + /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. + #[pallet::weight(5_000_000)] + pub(super) fn burn( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + who: ::Source, + #[pallet::compact] amount: T::Balance + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + let who = T::Lookup::lookup(who)?; + + let f = DebitFlags { keep_alive: false, best_effort: true }; + let burned = Self::do_burn(id, &who, amount, Some(origin), f)?; + Self::deposit_event(Event::Burned(id, who, burned)); + Ok(()) + } + + /// Change the Owner of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// + /// Emits `OwnerChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_ownership( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + owner: ::Source, + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + + Currency::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + if details.owner == owner { return Ok(()) } + + let metadata_deposit = Metadata::::get(id).deposit; + let deposit = details.deposit + metadata_deposit; + + // Move the deposit to the new owner. + T::Currency::repatriate_reserved(&details.owner, &owner, deposit, Reserved)?; + + details.owner = owner.clone(); + + Self::deposit_event(Event::OwnerChanged(id, owner)); + Ok(()) + }) + } + + /// Change the Issuer, Admin and Freezer of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// + /// Emits `TeamChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_team( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + let issuer = T::Lookup::lookup(issuer)?; + let admin = T::Lookup::lookup(admin)?; + let freezer = T::Lookup::lookup(freezer)?; + + Currency::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + + details.issuer = issuer.clone(); + details.admin = admin.clone(); + details.freezer = freezer.clone(); + + Self::deposit_event(Event::TeamChanged(id, issuer, admin, freezer)); + Ok(()) + }) + } + + /// Set the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Funds of sender are reserved according to the formula: + /// `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into + /// account any already reserved funds. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_metadata( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + let d = Currency::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + ensure!(metadata.as_ref().map_or(true, |m| !m.is_frozen), Error::::NoPermission); + + let old_deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + let new_deposit = T::MetadataDepositPerByte::get() + .saturating_mul(((name.len() + symbol.len()) as u32).into()) + .saturating_add(T::MetadataDepositBase::get()); + + if new_deposit > old_deposit { + T::Currency::reserve(&origin, new_deposit - old_deposit)?; + } else { + T::Currency::unreserve(&origin, old_deposit - new_deposit); + } + + *metadata = Some(CurrencyMetadata { + deposit: new_deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen: false, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, false)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Any deposit is freed for the asset owner. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn clear_metadata( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + ) -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + + let d = Currency::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + T::Currency::unreserve(&d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Force the metadata for an asset to some value. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is left alone. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively. + #[pallet::weight(5_000_000)] + pub(super) fn force_set_metadata( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, + ) -> DispatchResultWithPostInfo { + T::ForceOrigin::ensure_origin(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + ensure!(Currency::::contains_key(id), Error::::Unknown); + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + *metadata = Some(CurrencyMetadata { + deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, is_frozen)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is returned. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_clear_metadata( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + ) -> DispatchResultWithPostInfo { + T::ForceOrigin::ensure_origin(origin)?; + + let d = Currency::::get(id).ok_or(Error::::Unknown)?; + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + T::Currency::unreserve(&d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Alter the attributes of a given asset. + /// + /// Origin must be `ForceOrigin`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient + /// value to account for the state bloat associated with its balance storage. If set to + /// `true`, then non-zero balances may be stored without a `consumer` reference (and thus + /// an ED in the Balances pallet or whatever else is used to control user-account state + /// growth). + /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin + /// instructions. + /// + /// Emits `CurrencyStatusChanged` with the identity of the asset. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_asset_status( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + owner: ::Source, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + #[pallet::compact] min_balance: T::Balance, + is_sufficient: bool, + is_frozen: bool, + ) -> DispatchResultWithPostInfo { + T::ForceOrigin::ensure_origin(origin)?; + + Currency::::try_mutate(id, |maybe_asset| { + let mut asset = maybe_asset.take().ok_or(Error::::Unknown)?; + asset.owner = T::Lookup::lookup(owner)?; + asset.issuer = T::Lookup::lookup(issuer)?; + asset.admin = T::Lookup::lookup(admin)?; + asset.freezer = T::Lookup::lookup(freezer)?; + asset.min_balance = min_balance; + asset.is_sufficient = is_sufficient; + asset.is_frozen = is_frozen; + *maybe_asset = Some(asset); + + Self::deposit_event(Event::CurrencyStatusChanged(id)); + Ok(()) + }) + } + + /// Approve an amount of asset for transfer by a delegated third-party account. + /// + /// Origin must be Signed. + /// + /// Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account + /// for the purpose of holding the approval. If some non-zero amount of assets is already + /// approved from signing account to `delegate`, then it is topped up or unreserved to + /// meet the right value. + /// + /// NOTE: The signing account does not need to own `amount` of assets at the point of + /// making this call. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account to delegate permission to transfer asset. + /// - `amount`: The amount of asset that may be transferred by `delegate`. If there is + /// already an approval in place, then this acts additively. + /// + /// Emits `ApprovedTransfer` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn approve_transfer( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + delegate: ::Source, + #[pallet::compact] amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate(id, &key, |maybe_approved| -> DispatchResultWithPostInfo { + let mut approved = maybe_approved.take().unwrap_or_default(); + let deposit_required = T::ApprovalDeposit::get(); + if approved.deposit < deposit_required { + T::Currency::reserve(&key.owner, deposit_required - approved.deposit)?; + approved.deposit = deposit_required; + } + approved.amount = approved.amount.saturating_add(amount); + *maybe_approved = Some(approved); + Ok(()) + })?; + Self::deposit_event(Event::ApprovedTransfer(id, key.owner, key.delegate, amount)); + + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be Signed and there must be an approval in place between signer and + /// `delegate`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn cancel_approval( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + delegate: ::Source, + ) -> DispatchResultWithPostInfo { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + T::Currency::unreserve(&key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be either ForceOrigin or Signed origin with the signer being the Admin + /// account of the asset `id`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_cancel_approval( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + owner: ::Source, + delegate: ::Source, + ) -> DispatchResultWithPostInfo { + T::ForceOrigin::try_origin(origin) + .map(|_| ()) + .or_else(|origin| -> DispatchResultWithPostInfo { + let origin = ensure_signed(origin)?; + let d = Currency::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.admin, Error::::NoPermission); + Ok(()) + })?; + + let owner = T::Lookup::lookup(owner)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + T::Currency::unreserve(&key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Transfer some asset balance from a previously delegated account to some third-party + /// account. + /// + /// Origin must be Signed and there must be an approval in place by the `owner` to the + /// signer. + /// + /// If the entire amount approved for transfer is transferred, then any deposit previously + /// reserved by `approve_transfer` is unreserved. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The account which previously approved for a transfer of at least `amount` and + /// from which the asset balance will be withdrawn. + /// - `destination`: The account to which the asset balance of `amount` will be transferred. + /// - `amount`: The amount of assets to transfer. + /// + /// Emits `TransferredApproved` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_approved( + origin: OriginFor, + #[pallet::compact] id: T::CurrencyId, + owner: ::Source, + destination: ::Source, + #[pallet::compact] amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let delegate = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + let destination = T::Lookup::lookup(destination)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate_exists(id, &key, |maybe_approved| -> DispatchResultWithPostInfo { + let mut approved = maybe_approved.take().ok_or(Error::::Unapproved)?; + let remaining = approved.amount.checked_sub(&amount).ok_or(Error::::Unapproved)?; + + let f = TransferFlags { + keep_alive: false, + best_effort: false, + burn_dust: false + }; + Self::do_transfer(id, &key.owner, &destination, amount, None, f)?; + + if remaining.is_zero() { + T::Currency::unreserve(&key.owner, approved.deposit); + } else { + approved.amount = remaining; + *maybe_approved = Some(approved); + } + Ok(()) + })?; + Ok(()) + } + } +} + +impl Pallet { + pub fn account_id() -> T::AccountId { + T::ModuleId::get().into_account() + } +} diff --git a/pallets/webb-tokens/src/mock.rs b/pallets/webb-tokens/src/mock.rs new file mode 100644 index 00000000..4f6b9dd4 --- /dev/null +++ b/pallets/webb-tokens/src/mock.rs @@ -0,0 +1,173 @@ +use super::*; +use crate as pallet_webb_tokens; +use frame_benchmarking::whitelisted_caller; +use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; +use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; +use merkle::weights::Weights as MerkleWeights; +use orml_currencies::BasicCurrencyAdapter; +use orml_traits::parameter_type_with_key; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + ModuleId, Perbill, +}; +use weights::Weights; + +pub(crate) type Balance = u64; +pub type Amount = i128; +pub type CurrencyId = u64; +pub type AccountId = u64; +pub type BlockNumber = u64; + +// Configure a mock runtime to test the pallet. +type UncheckedExtrinsic = MockUncheckedExtrinsic; +type Block = MockBlock; + +construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Balances: balances::{Module, Call, Storage, Config, Event}, + MerkleTrees: merkle::{Module, Call, Storage, Event}, + WebbTokens: pallet_webb_tokens::{Module, Call, Storage, Event}, + Currencies: orml_currencies::{Module, Storage, Event}, + Tokens: orml_tokens::{Module, Storage, Event, Config}, + } +); + +parameter_types! { + pub Prefix: u8 = 100; + pub const BlockHashCount: u64 = 250; + pub const MaximumBlockWeight: Weight = 1024; + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); +} + +impl frame_system::Config for Test { + type AccountData = balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = (); + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = BlockNumber; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = Prefix; + type SystemWeightInfo = (); + type Version = (); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 0; + pub const MaxLocks: u32 = 50; + pub const MaxTreeDepth: u8 = 32; + pub const CacheBlockLength: u64 = 5; + // Minimum deposit length is 1 month w/ 6 second blocks + pub const MinimumDepositLength: u64 = 10 * 60 * 24 * 28; +} + +impl balances::Config for Test { + type AccountStore = System; + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = MaxLocks; + type WeightInfo = (); +} + +parameter_type_with_key! { + pub ExistentialDepositMap: |k: CurrencyId| -> Balance { + match k { + _ => 2, + } + }; +} + +parameter_types! { + pub const NativeCurrencyId: CurrencyId = 0; +} + +impl orml_tokens::Config for Test { + type Amount = Amount; + type Balance = Balance; + type CurrencyId = CurrencyId; + type Event = Event; + type ExistentialDeposits = ExistentialDepositMap; + type OnDust = (); + type WeightInfo = (); +} + +impl orml_currencies::Config for Test { + type Event = Event; + type GetNativeCurrencyId = NativeCurrencyId; + type MultiCurrency = Tokens; + type NativeCurrency = BasicCurrencyAdapter; + type WeightInfo = (); +} + +parameter_types! { + pub const CurrencyDeposit: u64 = 1; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; +} + +impl Config for Test { + type Event = Event; + type Balance = Balance; + type AssetId = CurrencyId; + type Currency = Currencies; + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; + type WeightInfo = (); + type Extra = (); +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + use balances::GenesisConfig as BalancesConfig; + use orml_tokens::GenesisConfig as TokensConfig; + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + BalancesConfig:: { + // Total issuance will be 200 with treasury account initialized at ED. + balances: vec![ + (0, 1_000_000_000), + (1, 1_000_000_000), + (2, 1_000_000_000), + (whitelisted_caller(), 1_000_000_000), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + let token_currency_id: CurrencyId = 1; + TokensConfig:: { + endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], + } + .assimilate_storage(&mut t) + .unwrap(); + + t.into() +} diff --git a/pallets/webb-tokens/src/tests.rs b/pallets/webb-tokens/src/tests.rs new file mode 100644 index 00000000..e69de29b diff --git a/pallets/webb-tokens/src/traits.rs b/pallets/webb-tokens/src/traits.rs new file mode 100644 index 00000000..95cd6a0e --- /dev/null +++ b/pallets/webb-tokens/src/traits.rs @@ -0,0 +1,6 @@ +use frame_support::dispatch; + +pub trait ExtendedTokenSystem { + fn issue(account_id: AccountId, currency_id: CurrencyId, size: Balance) + -> Result<(), dispatch::DispatchError>; +} diff --git a/pallets/webb-tokens/src/types.rs b/pallets/webb-tokens/src/types.rs new file mode 100644 index 00000000..00b6c240 --- /dev/null +++ b/pallets/webb-tokens/src/types.rs @@ -0,0 +1,119 @@ +use super::*; + +pub(super) type DepositBalanceOf = <::Currency as Currency<::AccountId>>::Balance; + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct CurrencyDetails< + Balance, + AccountId, + DepositBalance, +> { + /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. + pub(super) owner: AccountId, + /// Can mint tokens. + pub(super) issuer: AccountId, + /// Can thaw tokens, force transfers and burn tokens from any account. + pub(super) admin: AccountId, + /// Can freeze tokens. + pub(super) freezer: AccountId, + /// The total supply across all accounts. + pub(super) supply: Balance, + /// The balance deposited for this currency. This pays for the data stored here. + pub(super) deposit: DepositBalance, + /// The ED for virtual accounts. + pub(super) min_balance: Balance, + /// If `true`, then any account with this currency is given a provider reference. Otherwise, it + /// requires a consumer reference. + pub(super) is_sufficient: bool, + /// The total number of accounts. + pub(super) accounts: u32, + /// The total number of accounts for which we have placed a self-sufficient reference. + pub(super) sufficients: u32, + /// The total number of approvals. + pub(super) approvals: u32, + /// Whether the currency is frozen for non-admin transfers. + pub(super) is_frozen: bool, +} + +/// A pair to act as a key for the approval storage map. +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct ApprovalKey { + /// The owner of the funds that are being approved. + pub(super) owner: AccountId, + /// The party to whom transfer of the funds is being delegated. + pub(super) delegate: AccountId, +} + +/// Data concerning an approval. +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] +pub struct Approval { + /// The amount of funds approved for the balance transfer from the owner to some delegated + /// target. + pub(super) amount: Balance, + /// The amount reserved on the owner's account to hold this item in storage. + pub(super) deposit: DepositBalance, +} + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] +pub struct CurrencyMetadata { + /// The balance deposited for this metadata. + /// + /// This pays for the data stored in this struct. + pub(super) deposit: DepositBalance, + /// The user friendly name of this asset. Limited in length by `StringLimit`. + pub(super) name: Vec, + /// The ticker symbol for this asset. Limited in length by `StringLimit`. + pub(super) symbol: Vec, + /// The number of decimals this asset uses to represent one unit. + pub(super) decimals: u8, + /// Whether the asset metadata may be changed by a non Force origin. + pub(super) is_frozen: bool, +} + +/// Witness data for the destroy transactions. +#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct DestroyWitness { + /// The number of accounts holding the asset. + #[codec(compact)] + pub(super) accounts: u32, + /// The number of accounts holding the asset with a self-sufficient reference. + #[codec(compact)] + pub(super) sufficients: u32, + /// The number of transfer-approvals of the asset. + #[codec(compact)] + pub(super) approvals: u32, +} + +#[derive(Copy, Clone, PartialEq, Eq)] +pub(super) struct TransferFlags { + /// The debited account must stay alive at the end of the operation; an error is returned if + /// this cannot be achieved legally. + pub(super) keep_alive: bool, + /// Less than the amount specified needs be debited by the operation for it to be considered + /// successful. If `false`, then the amount debited will always be at least the amount + /// specified. + pub(super) best_effort: bool, + /// Any additional funds debited (due to minimum balance requirements) should be burned rather + /// than credited to the destination account. + pub(super) burn_dust: bool, +} + +#[derive(Copy, Clone, PartialEq, Eq)] +pub(super) struct DebitFlags { + /// The debited account must stay alive at the end of the operation; an error is returned if + /// this cannot be achieved legally. + pub(super) keep_alive: bool, + /// Less than the amount specified needs be debited by the operation for it to be considered + /// successful. If `false`, then the amount debited will always be at least the amount + /// specified. + pub(super) best_effort: bool, +} + +impl From for DebitFlags { + fn from(f: TransferFlags) -> Self { + Self { + keep_alive: f.keep_alive, + best_effort: f.best_effort, + } + } +} From b15b5e4aa9c6bd7e819b898a50bce869185819ac Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 9 Apr 2021 21:16:12 +0300 Subject: [PATCH 02/14] Updates --- pallets/webb-tokens/src/lib.rs | 31 +-- pallets/webb-tokens/src/weights.rs | 295 +++++++++++++++++++++++++++++ 2 files changed, 315 insertions(+), 11 deletions(-) create mode 100644 pallets/webb-tokens/src/weights.rs diff --git a/pallets/webb-tokens/src/lib.rs b/pallets/webb-tokens/src/lib.rs index 2800f8f3..84d2226c 100644 --- a/pallets/webb-tokens/src/lib.rs +++ b/pallets/webb-tokens/src/lib.rs @@ -46,17 +46,18 @@ pub type BalanceOf = <::Currency as MultiCurrency< = <::Currency as MultiCurrency<::AccountId>>::CurrencyId; +pub use sp_std::convert::TryInto; + // pub use weights::WeightInfo; pub use pallet::*; #[frame_support::pallet] pub mod pallet { - use frame_support::{ - dispatch::DispatchResult, - pallet_prelude::*, - }; - use frame_system::pallet_prelude::*; use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use sp_runtime::DispatchResultWithInfo; + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] @@ -64,18 +65,26 @@ pub mod pallet { #[pallet::config] /// The module configuration trait. - pub trait Config: frame_system::Config + orml_currencies::Config + orml_tokens::Config { + pub trait Config: frame_system::Config + orml_currencies::Config { /// The overarching event type. type Event: From> + IsType<::Event>; /// The balance type - type Balance: ::Balance; + type Balance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize; /// The amount type, should be signed version of `Balance` - type Amount: ::Amount; - - /// Identifier for the class of asset. - type CurrencyId: ::CurrencyId; + type Amount: Signed + + TryInto + + TryFrom + + Parameter + + Member + + arithmetic::SimpleArithmetic + + Default + + Copy + + MaybeSerializeDeserialize; + + /// The currency ID type + type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize + Ord; /// The currency mechanism. type Currency: MultiCurrency; diff --git a/pallets/webb-tokens/src/weights.rs b/pallets/webb-tokens/src/weights.rs new file mode 100644 index 00000000..e1d2b558 --- /dev/null +++ b/pallets/webb-tokens/src/weights.rs @@ -0,0 +1,295 @@ +// This file is part of Substrate. + +// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for pallet_assets +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-03-08, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// target/release/substrate +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_assets +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./frame/assets/src/weights.rs +// --template=./.maintain/frame-weight-template.hbs + + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_assets. +pub trait WeightInfo { + fn create() -> Weight; + fn force_create() -> Weight; + fn destroy(c: u32, s: u32, a: u32, ) -> Weight; + fn mint() -> Weight; + fn burn() -> Weight; + fn transfer() -> Weight; + fn transfer_keep_alive() -> Weight; + fn force_transfer() -> Weight; + fn transfer_ownership() -> Weight; + fn set_team() -> Weight; + fn set_metadata(n: u32, s: u32, ) -> Weight; + fn clear_metadata() -> Weight; + fn force_set_metadata(n: u32, s: u32, ) -> Weight; + fn force_clear_metadata() -> Weight; + fn force_asset_status() -> Weight; + fn approve_transfer() -> Weight; + fn transfer_approved() -> Weight; + fn cancel_approval() -> Weight; + fn force_cancel_approval() -> Weight; +} + +/// Weights for pallet_assets using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn create() -> Weight { + (48_305_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_create() -> Weight { + (23_827_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 38_000 + .saturating_add((24_232_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 38_000 + .saturating_add((30_467_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 383_000 + .saturating_add((2_343_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + fn mint() -> Weight { + (46_433_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn burn() -> Weight { + (46_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn transfer() -> Weight { + (70_793_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn transfer_keep_alive() -> Weight { + (57_453_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn force_transfer() -> Weight { + (70_968_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn transfer_ownership() -> Weight { + (28_566_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn set_team() -> Weight { + (25_297_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn set_metadata(_n: u32, s: u32, ) -> Weight { + (53_367_000 as Weight) + // Standard Error: 0 + .saturating_add((8_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn clear_metadata() -> Weight { + (51_721_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + (27_117_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_clear_metadata() -> Weight { + (51_598_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_asset_status() -> Weight { + (23_366_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn approve_transfer() -> Weight { + (47_906_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn transfer_approved() -> Weight { + (90_338_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn cancel_approval() -> Weight { + (48_591_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_cancel_approval() -> Weight { + (54_879_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn create() -> Weight { + (48_305_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_create() -> Weight { + (23_827_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 38_000 + .saturating_add((24_232_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 38_000 + .saturating_add((30_467_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 383_000 + .saturating_add((2_343_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + fn mint() -> Weight { + (46_433_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn burn() -> Weight { + (46_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn transfer() -> Weight { + (70_793_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_keep_alive() -> Weight { + (57_453_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn force_transfer() -> Weight { + (70_968_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_ownership() -> Weight { + (28_566_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn set_team() -> Weight { + (25_297_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn set_metadata(_n: u32, s: u32, ) -> Weight { + (53_367_000 as Weight) + // Standard Error: 0 + .saturating_add((8_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn clear_metadata() -> Weight { + (51_721_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + (27_117_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_clear_metadata() -> Weight { + (51_598_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_asset_status() -> Weight { + (23_366_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn approve_transfer() -> Weight { + (47_906_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn transfer_approved() -> Weight { + (90_338_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + } + fn cancel_approval() -> Weight { + (48_591_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_cancel_approval() -> Weight { + (54_879_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} \ No newline at end of file From 8d888de453ef497148ee948c5bdd86621be46ffc Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Sat, 10 Apr 2021 02:03:33 +0300 Subject: [PATCH 03/14] Merge pallet_assets w/ orml_tokens --- Cargo.lock | 5162 ++++++++++++----- Cargo.toml | 270 +- pallets/mixer/Cargo.toml | 7 +- pallets/mixer/src/lib.rs | 4 - pallets/{webb-tokens => tokens}/Cargo.toml | 9 +- pallets/tokens/src/imbalance.rs | 174 + pallets/tokens/src/lib.rs | 1769 ++++++ pallets/{webb-tokens => tokens}/src/mock.rs | 58 +- pallets/{webb-tokens => tokens}/src/tests.rs | 0 pallets/tokens/src/traits.rs | 8 + pallets/{webb-tokens => tokens}/src/types.rs | 84 +- .../{webb-tokens => tokens}/src/weights.rs | 0 pallets/webb-tokens/src/lib.rs | 897 --- pallets/webb-tokens/src/traits.rs | 6 - runtime/Cargo.toml | 5 +- runtime/src/lib.rs | 17 +- 16 files changed, 5740 insertions(+), 2730 deletions(-) rename pallets/{webb-tokens => tokens}/Cargo.toml (91%) create mode 100644 pallets/tokens/src/imbalance.rs create mode 100644 pallets/tokens/src/lib.rs rename pallets/{webb-tokens => tokens}/src/mock.rs (73%) rename pallets/{webb-tokens => tokens}/src/tests.rs (100%) create mode 100644 pallets/tokens/src/traits.rs rename pallets/{webb-tokens => tokens}/src/types.rs (60%) rename pallets/{webb-tokens => tokens}/src/weights.rs (100%) delete mode 100644 pallets/webb-tokens/src/lib.rs delete mode 100644 pallets/webb-tokens/src/traits.rs diff --git a/Cargo.lock b/Cargo.lock index 7dfdf32c..92dc72c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,6 +96,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "alga" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" +dependencies = [ + "approx 0.3.2", + "num-complex 0.2.4", + "num-traits", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -116,9 +127,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" [[package]] name = "approx" @@ -129,6 +140,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "approx" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -150,6 +170,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" + [[package]] name = "asn1_der" version = "0.6.3" @@ -292,6 +318,20 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-std-resolver" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665c56111e244fe38e7708ee10948a4356ad6a548997c21f5a63a0f4e0edc4d" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "pin-utils", + "trust-dns-resolver", +] + [[package]] name = "async-task" version = "4.0.3" @@ -377,7 +417,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.23.0", + "object", "rustc-demangle", ] @@ -451,16 +491,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] - [[package]] name = "bitvec" version = "0.20.2" @@ -468,7 +498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" dependencies = [ "funty", - "radium 0.6.2", + "radium", "tap", "wyz", ] @@ -825,6 +855,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.7.0" @@ -865,18 +901,18 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4066fd63b502d73eb8c5fa6bcab9c7962b05cd580f6b149ee83a8e730d8ce7fb" +checksum = "bcee7a5107071484772b89fdf37f0f460b7db75f476e43ea7a684fd942470bcf" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a54e4beb833a3c873a18a8fe735d73d732044004c7539a072c8faa35ccb0c60" +checksum = "654ab96f0f1cab71c0d323618a58360a492da2c341eb2c1f977fc195c664001b" dependencies = [ "byteorder", "cranelift-bforest", @@ -894,9 +930,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54cac7cacb443658d8f0ff36a3545822613fa202c946c0891897843bc933810" +checksum = "65994cfc5be9d5fd10c5fc30bcdddfa50c04bb79c91329287bff846434ff8f14" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -904,24 +940,27 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a109760aff76788b2cdaeefad6875a73c2b450be13906524f6c2a81e05b8d83c" +checksum = "889d720b688b8b7df5e4903f9b788c3c59396050f5548e516e58ccb7312463ab" +dependencies = [ + "serde", +] [[package]] name = "cranelift-entity" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b044234aa32531f89a08b487630ddc6744696ec04c8123a1ad388de837f5de3" +checksum = "1a2e6884a363e42a9ba980193ea8603a4272f8a92bd8bbaf9f57a94dbea0ff96" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5452b3e4e97538ee5ef2cc071301c69a86c7adf2770916b9d04e9727096abd93" +checksum = "e6f41e2f9b57d2c030e249d0958f1cdc2c3cd46accf8c0438b3d1944e9153444" dependencies = [ "cranelift-codegen", "log", @@ -931,25 +970,24 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68035c10b2e80f26cc29c32fa824380877f38483504c2a47b54e7da311caaf3" +checksum = "aab70ba7575665375d31cbdea2462916ce58be887834e1b83c860b43b51af637" dependencies = [ "cranelift-codegen", - "raw-cpuid", "target-lexicon", ] [[package]] name = "cranelift-wasm" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a530eb9d1c95b3309deb24c3d179d8b0ba5837ed98914a429787c395f614949d" +checksum = "f2fc3d2e70da6439adf97648dcdf81834363154f2907405345b6fbe7ca38918c" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.0", "log", "serde", "smallvec 1.6.1", @@ -1022,7 +1060,7 @@ dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.3", "lazy_static", - "memoffset 0.6.1", + "memoffset 0.6.3", "scopeguard", ] @@ -1096,9 +1134,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19" +checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote", "syn", @@ -1170,10 +1208,11 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.11" +version = "0.99.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" +checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" dependencies = [ + "convert_case", "proc-macro2", "quote", "syn", @@ -1304,6 +1343,18 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "enum-as-inner" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -1353,18 +1404,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ethbloom" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a6567e6fd35589fea0c63b94b4cf2e55573e413901bdbe60ab15cf0e25e5df" -dependencies = [ - "crunchy", - "fixed-hash 0.6.1", - "impl-rlp 0.2.1", - "tiny-keccak", -] - [[package]] name = "ethbloom" version = "0.11.0" @@ -1372,9 +1411,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" dependencies = [ "crunchy", - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", "tiny-keccak", ] @@ -1385,44 +1424,31 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9" dependencies = [ - "ethereum-types 0.11.0", + "ethereum-types", "funty", "hash-db", "hash256-std-hasher", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "rlp", "rlp-derive", "serde", "sha3 0.9.1", "triehash", ] -[[package]] -name = "ethereum-types" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473aecff686bd8e7b9db0165cbbb53562376b39bf35b427f0c60446a9e1634b0" -dependencies = [ - "ethbloom 0.9.2", - "fixed-hash 0.6.1", - "impl-rlp 0.2.1", - "primitive-types 0.7.3", - "uint 0.8.5", -] - [[package]] name = "ethereum-types" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" dependencies = [ - "ethbloom 0.11.0", - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", - "primitive-types 0.9.0", - "uint 0.9.0", + "primitive-types", + "uint", ] [[package]] @@ -1433,86 +1459,53 @@ checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" [[package]] name = "evm" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0467250a12bb144ad7b2f41e03e8675e38b971ab73f6d42ede6b78af07657e7b" +checksum = "1b4bd1fb06a4962a243c8be285d8a9b2493ffa79acb32633ad07a0bc523b1acd" dependencies = [ "ethereum", - "evm-core 0.24.0", - "evm-gasometer 0.24.0", - "evm-runtime 0.24.0", + "evm-core", + "evm-gasometer", + "evm-runtime", "log", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", ] [[package]] name = "evm-core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc372feb219651f8ae872e6ec0f84b346053c058bd0e8408b1f44a2a796bfecd" -dependencies = [ - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", - "serde", -] - -[[package]] -name = "evm-core" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0db0394d7b497bf97be3d9ece9c828f8b7670a065fc9f3106c9598cce6556d" +checksum = "6b4eea3882c798813a6f92e8855ec1fc3f5ababd8b274cb81d4bedee701b478e" dependencies = [ "funty", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", + "parity-scale-codec 2.1.0", + "primitive-types", "serde", ] [[package]] name = "evm-gasometer" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5737059b7a570b3e28a0126b02e0e36e218cc828b29dddbbae73d0b97fce1e0a" -dependencies = [ - "evm-core 0.23.0", - "evm-runtime 0.23.0", - "primitive-types 0.8.0", -] - -[[package]] -name = "evm-gasometer" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c617616408f87be6826bda72cee7625aa8cbc09b759f05b1dccd329fb61b2077" -dependencies = [ - "evm-core 0.24.0", - "evm-runtime 0.24.0", - "primitive-types 0.9.0", -] - -[[package]] -name = "evm-runtime" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95726118dbc5f76ed1ee300e685950e58e52a1c4db454a7635aba636c7002186" +checksum = "0a8f04dcc8b0296652eabfa443a08ebed6071a1178e0f42a7f7b63a612bddf0b" dependencies = [ - "evm-core 0.23.0", - "primitive-types 0.8.0", - "sha3 0.8.2", + "evm-core", + "evm-runtime", + "primitive-types", ] [[package]] name = "evm-runtime" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8447504daa86bc5a7ae982b9b5c53225aa0ebcfba636b785cf0f53406eaa4d87" +checksum = "54c302f29ca8bba82a382aa52d427869964179e4f24eae57bde70958ce9b7607" dependencies = [ - "evm-core 0.24.0", - "primitive-types 0.9.0", + "evm-core", + "primitive-types", "sha3 0.8.2", ] @@ -1570,8 +1563,8 @@ dependencies = [ [[package]] name = "fc-consensus" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "derive_more", "fc-db", @@ -1579,37 +1572,37 @@ dependencies = [ "fp-rpc", "futures 0.3.13", "log", - "parity-scale-codec 2.0.1", - "sc-client-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-timestamp", - "substrate-prometheus-endpoint", + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fc-db" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "kvdb", "kvdb-rocksdb", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-core", - "sp-database", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fc-mapping-sync" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "fc-consensus", "fc-db", @@ -1618,19 +1611,20 @@ dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "log", - "sc-client-api", - "sp-api", - "sp-blockchain", - "sp-runtime", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fc-rpc" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "2.0.0-dev" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.11.0", + "ethereum-types", + "evm", "fc-consensus", "fc-db", "fc-rpc-core", @@ -1647,29 +1641,29 @@ dependencies = [ "log", "pallet-ethereum", "pallet-evm", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "rand 0.7.3", - "rlp 0.5.0", + "rlp", "rustc-hex", - "sc-client-api", - "sc-network", - "sc-rpc", - "sc-service", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "sha3 0.8.2", - "sp-api", - "sp-blockchain", - "sp-io", - "sp-runtime", - "sp-storage", - "sp-transaction-pool", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fc-rpc-core" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ - "ethereum-types 0.11.0", + "ethereum-types", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", @@ -1709,22 +1703,10 @@ dependencies = [ "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", ] -[[package]] -name = "fixed-hash" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759c" -dependencies = [ - "byteorder", - "rand 0.7.3", - "rustc-hex", - "static_assertions", -] - [[package]] name = "fixed-hash" version = "0.7.0" @@ -1765,9 +1747,17 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", +] + +[[package]] +name = "fork-tree" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", ] [[package]] @@ -1782,182 +1772,232 @@ dependencies = [ [[package]] name = "fp-consensus" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "rlp", "sha3 0.8.2", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-evm" -version = "0.8.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-rpc" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.11.0", + "ethereum-types", "fp-evm", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-storage" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.9.2", + "ethereum-types", "fp-evm", - "parity-scale-codec 1.3.7", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-benchmarking" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +version = "3.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "linregress", - "parity-scale-codec 2.0.1", - "paste 1.0.4", - "sp-api", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "log", + "parity-scale-codec 2.1.0", + "paste", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70fe99487f84579a3f2c4ba52650fec875492eea41be0e4eea8019187f105052" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "linregress", - "parity-scale-codec 2.0.1", - "paste 1.0.4", - "sp-api", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "log", + "parity-scale-codec 2.1.0", + "paste", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", "chrono", - "frame-benchmarking 3.0.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "handlebars", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-cli", - "sc-client-db", - "sc-executor", - "sc-service", + "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", ] [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-metadata" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-tracing", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-support" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "bitflags", + "frame-metadata 13.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support-procedural 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "impl-trait-for-tuples 0.2.1", + "log", + "once_cell", + "parity-scale-codec 2.1.0", + "paste", "serde", - "sp-core", - "sp-std 3.0.0", + "smallvec 1.6.1", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bitflags", - "frame-metadata", - "frame-support-procedural", + "frame-metadata 13.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support-procedural 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", "log", "once_cell", - "parity-scale-codec 2.0.1", - "paste 1.0.4", + "parity-scale-codec 2.1.0", + "paste", "serde", "smallvec 1.6.1", - "sp-arithmetic", - "sp-core", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std 3.0.0", - "sp-tracing", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-support-procedural" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "Inflector", + "frame-support-procedural-tools 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", - "frame-support-procedural-tools", + "frame-support-procedural-tools 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "proc-macro2", "quote", "syn", @@ -1966,10 +2006,32 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1978,7 +2040,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -1988,17 +2050,35 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "frame-system" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-version", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -2007,29 +2087,29 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e93602f58cdab9820b6d607b7b50834d9b878efa33405a65c89ebfb5a596b584" dependencies = [ - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "fs-swap" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5839fda247e24ca4919c87c71dd5ca658f1f39e4f06829f80e3f15c3bafcfc2c" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" dependencies = [ "lazy_static", "libc", @@ -2133,7 +2213,7 @@ dependencies = [ "lazy_static", "log", "parking_lot 0.9.0", - "pin-project 0.4.27", + "pin-project 0.4.28", "serde", "serde_json", ] @@ -2377,7 +2457,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.3", + "http 0.2.4", "indexmap", "slab", "tokio 0.2.25", @@ -2388,9 +2468,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "3.5.3" +version = "3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb0867bbc5a3da37a753e78021d5fcf8a4db00e18dd2dd90fd36e24190e162d" +checksum = "580b6f551b29a3a02436318aed09ba1c58eea177dc49e39beac627ad356730a5" dependencies = [ "log", "pest", @@ -2491,6 +2571,17 @@ dependencies = [ "hmac 0.7.1", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi 0.3.9", +] + [[package]] name = "http" version = "0.1.21" @@ -2504,9 +2595,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes 1.0.1", "fnv", @@ -2532,14 +2623,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.3", + "http 0.2.4", ] [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589" [[package]] name = "httpdate" @@ -2597,13 +2688,13 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.3", + "http 0.2.4", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.5", - "socket2", + "pin-project 1.0.6", + "socket2 0.3.19", "tokio 0.2.25", "tower-service", "tracing", @@ -2688,12 +2779,19 @@ dependencies = [ ] [[package]] -name = "impl-codec" -version = "0.4.2" +name = "if-watch" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" +checksum = "6a6d52908d4ea4ab2bc22474ba149bf1011c8e2c3ebc1ff593ae28ac44f494b6" dependencies = [ - "parity-scale-codec 1.3.7", + "async-io", + "futures 0.3.13", + "futures-lite", + "if-addrs", + "ipnet", + "libc", + "log", + "winapi 0.3.9", ] [[package]] @@ -2702,16 +2800,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec 2.0.1", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" -dependencies = [ - "rlp 0.4.6", + "parity-scale-codec 2.1.0", ] [[package]] @@ -2720,7 +2809,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp 0.5.0", + "rlp", ] [[package]] @@ -2808,6 +2897,18 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +dependencies = [ + "socket2 0.3.19", + "widestring", + "winapi 0.3.9", + "winreg", +] + [[package]] name = "ipnet" version = "2.3.0" @@ -2823,6 +2924,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" @@ -2840,9 +2950,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.48" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" +checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" dependencies = [ "wasm-bindgen", ] @@ -2929,7 +3039,7 @@ version = "14.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -2941,7 +3051,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -3119,9 +3229,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.88" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" [[package]] name = "libloading" @@ -3141,49 +3251,88 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.34.0" +version = "0.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" +checksum = "adc225a49973cf9ab10d0cdd6a4b8f0cda299df9b760824bbb623f15f8f0c95a" dependencies = [ "atomic", "bytes 1.0.1", "futures 0.3.13", "lazy_static", - "libp2p-core", - "libp2p-core-derive", - "libp2p-deflate", - "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", - "libp2p-identify", - "libp2p-kad", - "libp2p-mdns", - "libp2p-mplex", - "libp2p-noise", - "libp2p-ping", - "libp2p-plaintext", + "libp2p-core 0.27.1", + "libp2p-deflate 0.27.1", + "libp2p-dns 0.27.0", + "libp2p-floodsub 0.27.0", + "libp2p-gossipsub 0.28.0", + "libp2p-identify 0.27.0", + "libp2p-kad 0.28.1", + "libp2p-mdns 0.28.1", + "libp2p-mplex 0.27.1", + "libp2p-noise 0.29.0", + "libp2p-ping 0.27.0", + "libp2p-plaintext 0.27.1", "libp2p-pnet", - "libp2p-request-response", - "libp2p-swarm", - "libp2p-tcp", - "libp2p-uds", - "libp2p-wasm-ext", - "libp2p-websocket", - "libp2p-yamux", + "libp2p-request-response 0.9.1", + "libp2p-swarm 0.27.2", + "libp2p-swarm-derive", + "libp2p-tcp 0.27.1", + "libp2p-uds 0.27.0", + "libp2p-wasm-ext 0.27.0", + "libp2p-websocket 0.28.0", + "libp2p-yamux 0.30.1", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "smallvec 1.6.1", "wasm-timer", ] [[package]] -name = "libp2p-core" -version = "0.27.1" +name = "libp2p" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" +checksum = "fe5759b526f75102829c15e4d8566603b4bf502ed19b5f35920d98113873470d" dependencies = [ - "asn1_der", + "atomic", + "bytes 1.0.1", + "futures 0.3.13", + "lazy_static", + "libp2p-core 0.28.1", + "libp2p-deflate 0.28.0", + "libp2p-dns 0.28.1", + "libp2p-floodsub 0.28.0", + "libp2p-gossipsub 0.29.0", + "libp2p-identify 0.28.0", + "libp2p-kad 0.29.0", + "libp2p-mdns 0.29.0", + "libp2p-mplex 0.28.0", + "libp2p-noise 0.30.0", + "libp2p-ping 0.28.0", + "libp2p-plaintext 0.28.0", + "libp2p-pnet", + "libp2p-relay", + "libp2p-request-response 0.10.0", + "libp2p-swarm 0.28.0", + "libp2p-swarm-derive", + "libp2p-tcp 0.28.0", + "libp2p-uds 0.28.0", + "libp2p-wasm-ext 0.28.1", + "libp2p-websocket 0.29.0", + "libp2p-yamux 0.31.0", + "parity-multiaddr", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "smallvec 1.6.1", + "wasm-timer", +] + +[[package]] +name = "libp2p-core" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" +dependencies = [ + "asn1_der", "bs58", "ed25519-dalek", "either", @@ -3197,7 +3346,7 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "prost", "prost-build", "rand 0.7.3", @@ -3212,13 +3361,37 @@ dependencies = [ ] [[package]] -name = "libp2p-core-derive" -version = "0.21.0" +name = "libp2p-core" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" +checksum = "c1e1797734bbd4c453664fefb029628f77c356ffc5bce98f06b18a7db3ebb0f7" dependencies = [ - "quote", - "syn", + "asn1_der", + "bs58", + "ed25519-dalek", + "either", + "fnv", + "futures 0.3.13", + "futures-timer 3.0.2", + "lazy_static", + "libsecp256k1", + "log", + "multihash", + "multistream-select", + "parity-multiaddr", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "prost", + "prost-build", + "rand 0.7.3", + "ring", + "rw-stream-sink", + "sha2 0.9.3", + "smallvec 1.6.1", + "thiserror", + "unsigned-varint 0.7.0", + "void", + "zeroize", ] [[package]] @@ -3229,7 +3402,18 @@ checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345" dependencies = [ "flate2", "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", +] + +[[package]] +name = "libp2p-deflate" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" +dependencies = [ + "flate2", + "futures 0.3.13", + "libp2p-core 0.28.1", ] [[package]] @@ -3239,8 +3423,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" dependencies = [ "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", + "log", +] + +[[package]] +name = "libp2p-dns" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" +dependencies = [ + "async-std-resolver", + "futures 0.3.13", + "libp2p-core 0.28.1", "log", + "smallvec 1.6.1", + "trust-dns-resolver", ] [[package]] @@ -3252,8 +3450,26 @@ dependencies = [ "cuckoofilter", "fnv", "futures 0.3.13", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "smallvec 1.6.1", +] + +[[package]] +name = "libp2p-floodsub" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897645f99e9b396df256a6aa8ba8c4bc019ac6b7c62556f624b5feea9acc82bb" +dependencies = [ + "cuckoofilter", + "fnv", + "futures 0.3.13", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", "log", "prost", "prost-build", @@ -3263,19 +3479,19 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12451ba9493e87c91baf2a6dffce9ddf1fbc807a0861532d7cf477954f8ebbee" +checksum = "502dc5fcbfec4aa1c63ef3f7307ffe20e90c1a1387bf23ed0bec087f2dde58a1" dependencies = [ - "asynchronous-codec 0.5.0", + "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", "bytes 1.0.1", "fnv", "futures 0.3.13", "hex_fmt", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", "log", "prost", "prost-build", @@ -3283,7 +3499,33 @@ dependencies = [ "regex", "sha2 0.9.3", "smallvec 1.6.1", - "unsigned-varint 0.6.0", + "unsigned-varint 0.7.0", + "wasm-timer", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794b0c85f5df1acbc1fc38414d37272594811193b6325c76d3931c3e3f5df8c0" +dependencies = [ + "asynchronous-codec 0.6.0", + "base64 0.13.0", + "byteorder", + "bytes 1.0.1", + "fnv", + "futures 0.3.13", + "hex_fmt", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "regex", + "sha2 0.9.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", "wasm-timer", ] @@ -3294,8 +3536,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" dependencies = [ "futures 0.3.13", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", + "log", + "prost", + "prost-build", + "smallvec 1.6.1", + "wasm-timer", +] + +[[package]] +name = "libp2p-identify" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88ebc841d744979176ab4b8b294a3e655a7ba4ef26a905d073a52b49ed4dff5" +dependencies = [ + "futures 0.3.13", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", "log", "prost", "prost-build", @@ -3315,15 +3573,41 @@ dependencies = [ "either", "fnv", "futures 0.3.13", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "sha2 0.9.3", + "smallvec 1.6.1", + "uint", + "unsigned-varint 0.7.0", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-kad" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb5b90b6bda749023a85f60b49ea74b387c25f17d8df541ae72a3c75dd52e63" +dependencies = [ + "arrayvec 0.5.2", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "either", + "fnv", + "futures 0.3.13", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", "log", "prost", "prost-build", "rand 0.7.3", "sha2 0.9.3", "smallvec 1.6.1", - "uint 0.9.0", + "uint", "unsigned-varint 0.7.0", "void", "wasm-timer", @@ -3339,14 +3623,35 @@ dependencies = [ "data-encoding", "dns-parser", "futures 0.3.13", - "if-watch", + "if-watch 0.1.8", "lazy_static", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", "log", "rand 0.7.3", "smallvec 1.6.1", - "socket2", + "socket2 0.3.19", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be28ca13bb648d249a9baebd750ebc64ce7040ddd5f0ce1035ff1f4549fb596d" +dependencies = [ + "async-io", + "data-encoding", + "dns-parser", + "futures 0.3.13", + "if-watch 0.2.0", + "lazy_static", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", + "log", + "rand 0.8.3", + "smallvec 1.6.1", + "socket2 0.4.0", "void", ] @@ -3359,7 +3664,25 @@ dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", + "log", + "nohash-hasher", + "parking_lot 0.11.1", + "rand 0.7.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", +] + +[[package]] +name = "libp2p-mplex" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.13", + "libp2p-core 0.28.1", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -3378,7 +3701,29 @@ dependencies = [ "curve25519-dalek 3.0.2", "futures 0.3.13", "lazy_static", - "libp2p-core", + "libp2p-core 0.27.1", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "sha2 0.9.3", + "snow", + "static_assertions", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-noise" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" +dependencies = [ + "bytes 1.0.1", + "curve25519-dalek 3.0.2", + "futures 0.3.13", + "lazy_static", + "libp2p-core 0.28.1", "log", "prost", "prost-build", @@ -3397,8 +3742,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f3813276d0708c8db0f500d8beda1bda9ad955723b9cb272c41f4727256f73c" dependencies = [ "futures 0.3.13", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", + "log", + "rand 0.7.3", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-ping" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea10fc5209260915ea65b78f612d7ff78a29ab288e7aa3250796866af861c45" +dependencies = [ + "futures 0.3.13", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", "log", "rand 0.7.3", "void", @@ -3414,7 +3774,24 @@ dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", + "log", + "prost", + "prost-build", + "unsigned-varint 0.7.0", + "void", +] + +[[package]] +name = "libp2p-plaintext" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.13", + "libp2p-core 0.28.1", "log", "prost", "prost-build", @@ -3430,12 +3807,35 @@ checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ "futures 0.3.13", "log", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "salsa20", "sha3 0.9.1", ] +[[package]] +name = "libp2p-relay" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff268be6a9d6f3c6cca3b81bbab597b15217f9ad8787c6c40fc548c1af7cd24" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.13", + "futures-timer 3.0.2", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", + "log", + "pin-project 1.0.6", + "prost", + "prost-build", + "rand 0.7.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", + "void", + "wasm-timer", +] + [[package]] name = "libp2p-request-response" version = "0.9.1" @@ -3445,11 +3845,31 @@ dependencies = [ "async-trait", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.27.1", + "libp2p-swarm 0.27.2", + "log", + "lru", + "minicbor 0.7.2", + "rand 0.7.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", + "wasm-timer", +] + +[[package]] +name = "libp2p-request-response" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "725367dd2318c54c5ab1a6418592e5b01c63b0dedfbbfb8389220b2bcf691899" +dependencies = [ + "async-trait", + "bytes 1.0.1", + "futures 0.3.13", + "libp2p-core 0.28.1", + "libp2p-swarm 0.28.0", "log", "lru", - "minicbor", + "minicbor 0.8.0", "rand 0.7.3", "smallvec 1.6.1", "unsigned-varint 0.7.0", @@ -3464,7 +3884,7 @@ checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" dependencies = [ "either", "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", "log", "rand 0.7.3", "smallvec 1.6.1", @@ -3472,21 +3892,64 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-swarm" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c26980cadd7c25d89071cb23e1f7f5df4863128cc91d83c6ddc72338cecafa" +dependencies = [ + "either", + "futures 0.3.13", + "libp2p-core 0.28.1", + "log", + "rand 0.7.3", + "smallvec 1.6.1", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c564ebaa36a64839f51eaddb0243aaaa29ce64affb56129193cc3248b72af273" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "libp2p-tcp" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" +dependencies = [ + "async-io", + "futures 0.3.13", + "futures-timer 3.0.2", + "if-watch 0.1.8", + "ipnet", + "libc", + "libp2p-core 0.27.1", + "log", + "socket2 0.3.19", +] + [[package]] name = "libp2p-tcp" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" +checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" dependencies = [ "async-io", "futures 0.3.13", "futures-timer 3.0.2", - "if-watch", + "if-watch 0.2.0", "ipnet", "libc", - "libp2p-core", + "libp2p-core 0.28.1", "log", - "socket2", + "socket2 0.4.0", ] [[package]] @@ -3497,7 +3960,19 @@ checksum = "80ac51ce419f60be966e02103c17f67ff5dc4422ba83ba54d251d6c62a4ed487" dependencies = [ "async-std", "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", + "log", +] + +[[package]] +name = "libp2p-uds" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" +dependencies = [ + "async-std", + "futures 0.3.13", + "libp2p-core 0.28.1", "log", ] @@ -3509,7 +3984,21 @@ checksum = "6149c46cb76935c80bc8be6ec6e3ebd5f5e1679765a255fb34331d54610f15dd" dependencies = [ "futures 0.3.13", "js-sys", - "libp2p-core", + "libp2p-core 0.27.1", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef45d61e43c313531b5e903e4e8415212ff6338e0c54c47da5b9b412b5760de" +dependencies = [ + "futures 0.3.13", + "js-sys", + "libp2p-core 0.28.1", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -3524,7 +4013,25 @@ dependencies = [ "either", "futures 0.3.13", "futures-rustls", - "libp2p-core", + "libp2p-core 0.27.1", + "log", + "quicksink", + "rw-stream-sink", + "soketto", + "url 2.2.1", + "webpki-roots", +] + +[[package]] +name = "libp2p-websocket" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" +dependencies = [ + "either", + "futures 0.3.13", + "futures-rustls", + "libp2p-core 0.28.1", "log", "quicksink", "rw-stream-sink", @@ -3540,7 +4047,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4819358c542a86ff95f6ae691efb4b94ddaf477079b01a686f5705b79bfc232a" dependencies = [ "futures 0.3.13", - "libp2p-core", + "libp2p-core 0.27.1", + "parking_lot 0.11.1", + "thiserror", + "yamux", +] + +[[package]] +name = "libp2p-yamux" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d6144cc94143fb0a8dd1e7c2fbcc32a2808168bcd1d69920635424d5993b7b" +dependencies = [ + "futures 0.3.13", + "libp2p-core 0.28.1", "parking_lot 0.11.1", "thiserror", "yamux", @@ -3602,11 +4122,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" +checksum = "b36162d2e1dcbdeb61223cb788f029f8ac9f2ab19969b89c5a8f4517aad4d940" dependencies = [ - "nalgebra", + "nalgebra 0.25.4", "statrs", ] @@ -3621,9 +4141,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" dependencies = [ "scopeguard", ] @@ -3647,6 +4167,15 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "mach" version = "0.3.2" @@ -3662,6 +4191,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + [[package]] name = "matchers" version = "0.0.1" @@ -3686,6 +4221,15 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "matrixmultiply" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" +dependencies = [ + "rawpointer", +] + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -3700,9 +4244,9 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memmap2" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "397d1a6d6d0563c0f5462bbdae662cf6c784edf5e828e40c7257f85d82bf56dd" dependencies = [ "libc", ] @@ -3718,9 +4262,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" dependencies = [ "autocfg", ] @@ -3763,6 +4307,15 @@ dependencies = [ "minicbor-derive", ] +[[package]] +name = "minicbor" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea79ce4ab9f445ec6b71833a2290ac0a29c9dde0fa7cae4c481eecae021d9bd9" +dependencies = [ + "minicbor-derive", +] + [[package]] name = "minicbor-derive" version = "0.6.2" @@ -3823,7 +4376,7 @@ checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ "log", "mio", - "miow 0.3.6", + "miow 0.3.7", "winapi 0.3.9", ] @@ -3852,11 +4405,10 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "socket2", "winapi 0.3.9", ] @@ -3900,7 +4452,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro-error", "proc-macro2", "quote", @@ -3910,9 +4462,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" @@ -3923,25 +4475,42 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.13", "log", - "pin-project 1.0.5", + "pin-project 1.0.6", "smallvec 1.6.1", "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.21.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" +checksum = "0abb021006c01b126a936a8dd1351e0720d83995f4fc942d0d426c654f990745" dependencies = [ - "approx", + "alga", + "approx 0.3.2", "generic-array 0.13.3", - "matrixmultiply", - "num-complex", - "num-rational", + "matrixmultiply 0.2.4", + "num-complex 0.2.4", + "num-rational 0.2.4", "num-traits", "rand 0.7.3", "rand_distr", + "typenum", +] + +[[package]] +name = "nalgebra" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c70c9e8c5f213c8e93fc8c112ade4edd3ee62062fb897776c23dcebac7932900" +dependencies = [ + "approx 0.4.0", + "generic-array 0.14.4", + "matrixmultiply 0.3.1", + "num-complex 0.3.1", + "num-rational 0.3.2", + "num-traits", + "serde", "simba", "typenum", ] @@ -3957,12 +4526,12 @@ dependencies = [ [[package]] name = "nb-connect" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670361df1bc2399ee1ff50406a0d422587dd3bb0da596e1978fe8e05dabddf4f" +checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" dependencies = [ "libc", - "socket2", + "socket2 0.4.0", ] [[package]] @@ -3987,7 +4556,7 @@ dependencies = [ "fc-rpc-core", "fp-consensus", "fp-rpc", - "frame-benchmarking 3.1.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-benchmarking-cli", "futures 0.3.13", "jsonrpc-core 15.1.0", @@ -3999,31 +4568,31 @@ dependencies = [ "pallet-evm", "pallet-transaction-payment-rpc", "sc-basic-authorship", - "sc-chain-spec", + "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sc-cli", - "sc-client-api", - "sc-consensus", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sc-consensus-aura", - "sc-executor", - "sc-finality-grandpa", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sc-finality-grandpa-rpc", - "sc-keystore", - "sc-network", - "sc-rpc", - "sc-rpc-api", - "sc-service", - "sc-telemetry", - "sc-transaction-pool", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus-aura", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-runtime", - "sp-transaction-pool", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", "substrate-build-script-utils", "substrate-frame-rpc-system", @@ -4034,18 +4603,17 @@ name = "node-template-runtime" version = "3.0.0" dependencies = [ "fp-rpc", - "frame-benchmarking 3.1.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", "orml-currencies", - "orml-tokens", "orml-traits", "pallet-aura", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-contracts", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", @@ -4057,22 +4625,23 @@ dependencies = [ "pallet-mixer", "pallet-randomness-collective-flip", "pallet-sudo", - "pallet-timestamp", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "pallet-tokens", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", - "sp-block-builder", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std 3.0.0", - "sp-transaction-pool", - "sp-version", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "static_assertions", "substrate-wasm-builder-runner", ] @@ -4120,6 +4689,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -4142,6 +4720,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.14" @@ -4164,20 +4753,14 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" dependencies = [ "crc32fast", "indexmap", ] -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - [[package]] name = "once_cell" version = "1.7.2" @@ -4211,31 +4794,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "204fa52ab72cf353879bf57a6cccc64d1fadf3d44246d98007b218cc22fc4d06" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", "orml-traits", "orml-utilities", - "parity-scale-codec 2.0.1", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", -] - -[[package]] -name = "orml-tokens" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0321e56f921689c6c78bf2b68e3deb03172065ca8f306d4d8432d09c3569bb9d" -dependencies = [ - "frame-support", - "frame-system", - "funty", - "orml-traits", - "parity-scale-codec 2.0.1", - "serde", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4244,16 +4811,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18dd4788a7b96709d23081b1a33a5b8477cf25833f20b27b19908d5babdfe7ab" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", "impl-trait-for-tuples 0.1.3", "num-traits", "orml-utilities", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4262,13 +4829,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f84d1a0ce4c65a8695cf8c41895c6161d2345214a4a413e674478f6a37968db" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4283,89 +4850,102 @@ dependencies = [ [[package]] name = "pallet-aura" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-session", - "pallet-timestamp", - "parity-scale-codec 2.0.1", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", - "sp-application-crypto", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus-aura", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sp-authorship", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "pallet-balances" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0979c1dd82fc56a87b37311006fe56f406de027c24591353058e9e9fc56487c" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", "pallet-contracts-primitives", "pallet-contracts-proc-macro", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.16.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-sandbox", - "sp-std 3.0.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi-validation", ] [[package]] name = "pallet-contracts-primitives" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "621d75148763349f72e76e79f62365d28adb51e3f2e0285e4e8b8600ae600978" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bitflags", - "parity-scale-codec 2.0.1", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts-proc-macro" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90046017aeee3f77752a6c77cdfb1bc93eb728591dc6edad36e2706f7626fd50" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -4375,119 +4955,119 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22491e3c304819f96c83d02e43bd99128e4e42a57da4d6a9d4b5193778da915b" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts-rpc-runtime-api" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4b410cb148e68256e3827854a67ec34b16157f448e78173219dcd6a8ec7343" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "pallet-contracts-primitives", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-ethereum" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.1-dev" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.11.0", + "ethereum-types", "evm", "fp-consensus", "fp-evm", "fp-rpc", "fp-storage", - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "libsecp256k1", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "pallet-evm", - "pallet-timestamp", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "parity-scale-codec 2.1.0", + "rlp", "rustc-hex", "serde", "sha3 0.8.2", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-evm" version = "3.0.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", - "evm-gasometer 0.23.0", - "evm-runtime 0.23.0", + "evm-gasometer", + "evm-runtime", "fp-evm", - "frame-support", - "frame-system", - "pallet-balances", - "pallet-timestamp", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "rlp 0.5.0", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "log", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "parity-scale-codec 2.1.0", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-evm-precompile-simple" -version = "3.0.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", "fp-evm", "ripemd160", - "sp-core", - "sp-io", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-application-crypto", - "sp-core", - "sp-finality-grandpa", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std 3.0.0", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4496,20 +5076,20 @@ version = "3.0.0" dependencies = [ "bulletproofs-gadgets", "curve25519-dalek 3.0.2", - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "lazy_static", "merlin", - "pallet-balances", - "parity-scale-codec 2.0.1", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "rand_core 0.5.1", "serde", "sha2 0.9.3", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "webb-bulletproofs", ] @@ -4520,151 +5100,169 @@ dependencies = [ "bencher", "bulletproofs-gadgets", "curve25519-dalek 3.0.2", - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "merlin", "orml-currencies", - "orml-tokens", "orml-traits", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-merkle", - "parity-scale-codec 2.0.1", + "pallet-tokens", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "webb-bulletproofs", ] [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "safe-mix", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", - "pallet-timestamp", - "parity-scale-codec 2.0.1", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std 3.0.0", - "sp-trie", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "pallet-timestamp" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "pallet-tokens" +version = "3.0.0" +dependencies = [ + "bencher", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "orml-currencies", + "orml-traits", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", "smallvec 1.6.1", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-runtime", -] - -[[package]] -name = "pallet-webb-tokens" -version = "0.1.0" -dependencies = [ - "bencher", - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", - "orml-currencies", - "orml-tokens", - "orml-traits", - "pallet-balances", - "parity-scale-codec 2.0.1", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4686,9 +5284,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c6805f98667a3828afb2ec2c396a8d610497e8d546f5447188aae47c5a79ec" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" dependencies = [ "arrayref", "bs58", @@ -4709,22 +5307,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" dependencies = [ "arrayvec 0.5.2", - "bitvec 0.17.4", "byte-slice-cast 0.3.5", "parity-scale-codec-derive 1.2.3", - "serde", ] [[package]] name = "parity-scale-codec" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" +checksum = "731f4d179ed52b1c7eeb29baf29c604ea9301b889b23ce93660220a5465d5c6f" dependencies = [ - "arrayvec 0.5.2", - "bitvec 0.20.2", + "arrayvec 0.7.0", + "bitvec", "byte-slice-cast 1.0.0", - "parity-scale-codec-derive 2.0.1", + "parity-scale-codec-derive 2.1.0", "serde", ] @@ -4734,7 +5330,7 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41512944b1faff334a5f1b9447611bf4ef40638ccb6328173dacefb338e878c" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -4742,11 +5338,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" +checksum = "f44c5f94427bd0b5076e8f7e15ca3f60a4d8ac0077e4793884e6fdfd8915344e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -4769,7 +5365,7 @@ dependencies = [ "libc", "log", "mio-named-pipes", - "miow 0.3.6", + "miow 0.3.7", "rand 0.7.3", "tokio 0.1.22", "tokio-named-pipes", @@ -4788,7 +5384,7 @@ dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-util-mem-derive", "parking_lot 0.11.1", - "primitive-types 0.9.0", + "primitive-types", "smallvec 1.6.1", "winapi 0.3.9", ] @@ -4862,7 +5458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.2", + "lock_api 0.4.3", "parking_lot_core 0.8.3", ] @@ -4911,28 +5507,9 @@ dependencies = [ [[package]] name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - -[[package]] -name = "paste" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" - -[[package]] -name = "paste-impl" -version = "0.1.18" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" @@ -5032,27 +5609,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" dependencies = [ - "pin-project-internal 0.4.27", + "pin-project-internal 0.4.28", ] [[package]] name = "pin-project" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" +checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" dependencies = [ - "pin-project-internal 1.0.5", + "pin-project-internal 1.0.6", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote", @@ -5061,9 +5638,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" +checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" dependencies = [ "proc-macro2", "quote", @@ -5102,11 +5679,11 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" [[package]] name = "polling" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "log", "wepoll-sys", @@ -5140,40 +5717,17 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" -[[package]] -name = "primitive-types" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809" -dependencies = [ - "fixed-hash 0.6.1", - "impl-codec 0.4.2", - "impl-rlp 0.2.1", - "uint 0.8.5", -] - -[[package]] -name = "primitive-types" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8" -dependencies = [ - "fixed-hash 0.7.0", - "impl-codec 0.4.2", - "uint 0.9.0", -] - [[package]] name = "primitive-types" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" dependencies = [ - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", - "uint 0.9.0", + "uint", ] [[package]] @@ -5185,6 +5739,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5223,9 +5787,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ "unicode-xid", ] @@ -5262,14 +5826,14 @@ checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ "bytes 1.0.1", "heck", - "itertools", + "itertools 0.9.0", "log", "multimap", "petgraph", "prost", "prost-types", "tempfile", - "which 4.0.2", + "which 4.1.0", ] [[package]] @@ -5279,7 +5843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools", + "itertools 0.9.0", "proc-macro2", "quote", "syn", @@ -5358,12 +5922,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - [[package]] name = "radium" version = "0.6.2" @@ -5503,20 +6061,9 @@ dependencies = [ name = "rand_pcg" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "raw-cpuid" -version = "8.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ - "bitflags", - "cc", - "rustc_version", + "rand_core 0.5.1", ] [[package]] @@ -5623,14 +6170,15 @@ checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", + "serde", "smallvec 1.6.1", ] [[package]] name = "regex" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54fd1046a3107eb58f42de31d656fee6853e5d276c455fd943742dce89fc3dd3" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", @@ -5674,6 +6222,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error 1.2.3", +] + [[package]] name = "retain_mut" version = "0.1.2" @@ -5706,15 +6264,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "rlp" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" -dependencies = [ - "rustc-hex", -] - [[package]] name = "rlp" version = "0.5.0" @@ -5833,6 +6382,16 @@ dependencies = [ "security-framework", ] +[[package]] +name = "ruzstd" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" +dependencies = [ + "byteorder", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.2.1" @@ -5840,7 +6399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ "futures 0.3.13", - "pin-project 0.4.27", + "pin-project 0.4.28", "static_assertions", ] @@ -5871,70 +6430,117 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", - "sc-block-builder", - "sc-client-api", + "parity-scale-codec 2.1.0", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sc-proposer-metrics", - "sc-telemetry", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-transaction-pool", - "substrate-prometheus-endpoint", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-block-builder" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-chain-spec" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sc-client-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.0", + "sc-chain-spec-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "serde", + "serde_json", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sc-chain-spec-derive", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-network", - "sc-telemetry", + "parity-scale-codec 2.1.0", + "sc-chain-spec-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", - "sp-chain-spec", - "sp-consensus-babe", - "sp-core", - "sp-runtime", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-chain-spec-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -5943,35 +6549,35 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "chrono", "fdlimit", "futures 0.3.13", "hex", - "libp2p", + "libp2p 0.36.0", "log", "names", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "rand 0.7.3", "regex", "rpassword", - "sc-client-api", - "sc-keystore", - "sc-network", - "sc-service", - "sc-telemetry", - "sc-tracing", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", - "sp-blockchain", - "sp-core", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", - "sp-utils", - "sp-version", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", "thiserror", "tiny-bip39", @@ -5981,7 +6587,41 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "fnv", + "futures 0.3.13", + "hash-db", + "kvdb", + "lazy_static", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-client-api" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "fnv", @@ -5990,32 +6630,62 @@ dependencies = [ "kvdb", "lazy_static", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-client-db" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "blake2-rfc", + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec 2.1.0", + "parity-util-mem", "parking_lot 0.11.1", - "sc-executor", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-database", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-storage", - "sp-transaction-pool", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-state-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "blake2-rfc", "hash-db", @@ -6025,206 +6695,365 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "sc-client-api", - "sc-executor", - "sc-state-db", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", - "substrate-prometheus-endpoint", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-state-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-consensus" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "sc-client-api", - "sp-blockchain", - "sp-consensus", - "sp-runtime", + "parking_lot 0.11.1", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", - "sc-block-builder", - "sc-client-api", - "sc-consensus-slots", - "sc-telemetry", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", + "parity-scale-codec 2.1.0", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus-aura", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-timestamp", - "sp-version", - "substrate-prometheus-endpoint", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "futures 0.3.13", + "futures-timer 3.0.2", + "log", + "merlin", + "num-bigint", + "num-rational 0.2.4", + "num-traits", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "pdqselect", + "rand 0.7.3", + "retain_mut", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus-uncles 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "schnorrkel", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", - "fork-tree", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "futures 0.3.13", "futures-timer 3.0.2", "log", "merlin", "num-bigint", - "num-rational", + "num-rational 0.2.4", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", "retain_mut", - "sc-client-api", - "sc-consensus-epochs", - "sc-consensus-slots", - "sc-consensus-uncles", - "sc-keystore", - "sc-telemetry", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus-uncles 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "schnorrkel", "serde", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-timestamp", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "fork-tree", - "parity-scale-codec 2.0.1", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-client-api", - "sp-blockchain", - "sp-runtime", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-client-api", - "sc-telemetry", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "async-trait", + "futures 0.3.13", + "futures-timer 3.0.2", + "log", + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-consensus-uncles" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "sc-client-api", - "sp-authorship", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-executor" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "lazy_static", + "libsecp256k1", + "log", + "parity-scale-codec 2.1.0", + "parity-wasm", + "parking_lot 0.11.1", + "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-executor-wasmi 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tasks 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasmi", ] [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "lazy_static", "libsecp256k1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "parking_lot 0.11.1", - "sc-executor-common", - "sc-executor-wasmi", + "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor-wasmi 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sc-executor-wasmtime", - "sp-api", - "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-serializer", - "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-maybe-compressed-blob", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tasks 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "wasmi", +] + +[[package]] +name = "sc-executor-common" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "parity-scale-codec 2.1.0", + "parity-wasm", + "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", "wasmi", ] [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", - "sp-allocator", - "sp-core", - "sp-serializer", - "sp-wasm-interface", + "pwasm-utils 0.14.0", + "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "wasmi", ] @@ -6232,79 +7061,134 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "log", - "parity-scale-codec 2.0.1", - "sc-executor-common", - "sp-allocator", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmi" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "log", + "parity-scale-codec 2.1.0", + "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.14.0", - "sc-executor-common", + "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "scoped-tls", - "sp-allocator", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmtime", ] [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "dyn-clone", + "finality-grandpa", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "futures 0.3.13", + "futures-timer 3.0.2", + "linked-hash-map", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "rand 0.7.3", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network-gossip 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "serde_json", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-finality-grandpa" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", "dyn-clone", "finality-grandpa", - "fork-tree", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "futures 0.3.13", "futures-timer 3.0.2", "linked-hash-map", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-keystore", - "sc-network", - "sc-network-gossip", - "sc-telemetry", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network-gossip 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-utils", - "substrate-prometheus-endpoint", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "finality-grandpa", @@ -6314,39 +7198,77 @@ dependencies = [ "jsonrpc-derive 15.1.0", "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec 2.0.1", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", - "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-informant" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "ansi_term 0.12.1", + "futures 0.3.13", + "log", + "parity-util-mem", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasm-timer", ] [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "ansi_term 0.12.1", "futures 0.3.13", "log", "parity-util-mem", - "sc-client-api", - "sc-network", - "sp-blockchain", - "sp-runtime", - "sp-transaction-pool", - "sp-utils", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasm-timer", ] [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.13", + "futures-util", + "hex", + "merlin", + "parking_lot 0.11.1", + "rand 0.7.3", + "serde_json", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "subtle 2.4.0", +] + +[[package]] +name = "sc-keystore" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", "derive_more", @@ -6357,35 +7279,107 @@ dependencies = [ "parking_lot 0.11.1", "rand 0.7.3", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "subtle 2.4.0", -] - -[[package]] -name = "sc-light" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" -dependencies = [ - "hash-db", - "lazy_static", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", - "sc-client-api", - "sc-executor", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-externalities", - "sp-runtime", - "sp-state-machine", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "subtle 2.4.0", +] + +[[package]] +name = "sc-light" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "hash-db", + "lazy_static", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-light" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "hash-db", + "lazy_static", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-network" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "async-std", + "async-trait", + "asynchronous-codec 0.5.0", + "bitflags", + "bs58", + "bytes 1.0.1", + "cid", + "derive_more", + "either", + "erased-serde", + "fnv", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "futures 0.3.13", + "futures-timer 3.0.2", + "hex", + "ip_network", + "libp2p 0.35.1", + "linked-hash-map", + "linked_hash_set", + "log", + "lru", + "nohash-hasher", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "prost", + "prost-build", + "rand 0.7.3", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-peerset 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "serde", + "serde_json", + "smallvec 1.6.1", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "unsigned-varint 0.6.0", + "void", + "wasm-timer", + "zeroize", ] [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-std", "async-trait", @@ -6398,36 +7392,36 @@ dependencies = [ "either", "erased-serde", "fnv", - "fork-tree", + "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "futures 0.3.13", "futures-timer 3.0.2", "hex", "ip_network", - "libp2p", + "libp2p 0.36.0", "linked-hash-map", "linked_hash_set", "log", "lru", "nohash-hasher", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "prost", "prost-build", "rand 0.7.3", - "sc-block-builder", - "sc-client-api", - "sc-peerset", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-peerset 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", "smallvec 1.6.1", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "sp-utils", - "substrate-prometheus-endpoint", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "unsigned-varint 0.6.0", "void", @@ -6438,106 +7432,223 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.13", + "futures-timer 3.0.2", + "libp2p 0.35.1", + "log", + "lru", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasm-timer", +] + +[[package]] +name = "sc-network-gossip" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", - "libp2p", + "libp2p 0.36.0", "log", "lru", - "sc-network", - "sp-runtime", - "substrate-prometheus-endpoint", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "tracing", "wasm-timer", ] [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures 0.3.13", + "futures-timer 3.0.2", + "hex", + "hyper 0.13.10", + "hyper-rustls", + "log", + "num_cpus", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "rand 0.7.3", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "threadpool", +] + +[[package]] +name = "sc-offchain" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bytes 0.5.6", "fnv", "futures 0.3.13", "futures-timer 3.0.2", + "hex", "hyper 0.13.10", "hyper-rustls", "log", "num_cpus", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "rand 0.7.3", - "sc-client-api", - "sc-keystore", - "sc-network", - "sp-api", - "sp-core", - "sp-offchain", - "sp-runtime", - "sp-utils", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "threadpool", ] [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.13", + "libp2p 0.35.1", + "log", + "serde_json", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasm-timer", +] + +[[package]] +name = "sc-peerset" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", - "libp2p", + "libp2p 0.36.0", "log", "serde_json", - "sp-utils", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasm-timer", ] [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "substrate-prometheus-endpoint", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "futures 0.3.13", "hash-db", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-block-builder", - "sc-client-api", - "sc-executor", - "sc-keystore", - "sc-rpc-api", - "sc-tracing", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "serde_json", - "sp-api", - "sp-blockchain", - "sp-chain-spec", - "sp-core", - "sp-keystore", - "sp-offchain", - "sp-rpc", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-transaction-pool", - "sp-utils", - "sp-version", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sc-rpc" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "futures 0.3.13", + "hash-db", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "serde_json", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-rpc-api" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "futures 0.3.13", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", + "jsonrpc-pubsub 15.1.0", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "serde", + "serde_json", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "futures 0.3.13", @@ -6546,22 +7657,40 @@ dependencies = [ "jsonrpc-derive 15.1.0", "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "serde", "serde_json", - "sp-chain-spec", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-transaction-pool", - "sp-version", + "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-rpc-server" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.1.31", + "jsonrpc-core 15.1.0", + "jsonrpc-http-server", + "jsonrpc-ipc-server", + "jsonrpc-pubsub 15.1.0", + "jsonrpc-ws-server", + "log", + "serde", + "serde_json", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.1.31", "jsonrpc-core 15.1.0", @@ -6572,15 +7701,79 @@ dependencies = [ "log", "serde", "serde_json", - "sp-runtime", - "substrate-prometheus-endpoint", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sc-service" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "directories", + "exit-future", + "futures 0.1.31", + "futures 0.3.13", + "futures-timer 3.0.2", + "hash-db", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", + "lazy_static", + "log", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "rand 0.7.3", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-informant 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-light 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-rpc-server 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "serde", + "serde_json", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "tempfile", + "thiserror", + "tracing", + "tracing-futures", + "wasm-timer", ] [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "directories", "exit-future", "futures 0.1.31", @@ -6591,47 +7784,47 @@ dependencies = [ "jsonrpc-pubsub 15.1.0", "lazy_static", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-executor", - "sc-informant", - "sc-keystore", - "sc-light", - "sc-network", - "sc-offchain", - "sc-rpc", - "sc-rpc-server", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", + "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-informant 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-light 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc-server 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-tracing", - "sp-transaction-pool", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "tempfile", "thiserror", "tracing", @@ -6642,36 +7835,69 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "parity-util-mem-derive", + "parking_lot 0.11.1", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", +] + +[[package]] +name = "sc-state-db" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", - "sc-client-api", - "sp-core", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "chrono", "futures 0.3.13", - "libp2p", + "libp2p 0.35.1", "log", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "serde", "serde_json", - "sp-utils", "take_mut", - "tracing", - "tracing-subscriber", + "thiserror", + "void", + "wasm-timer", +] + +[[package]] +name = "sc-telemetry" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "chrono", + "futures 0.3.13", + "libp2p 0.36.0", + "log", + "parking_lot 0.11.1", + "pin-project 1.0.6", + "rand 0.7.3", + "serde", + "serde_json", + "take_mut", + "thiserror", "void", "wasm-timer", ] @@ -6679,7 +7905,34 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "ansi_term 0.12.1", + "atty", + "erased-serde", + "lazy_static", + "log", + "once_cell", + "parking_lot 0.11.1", + "regex", + "rustc-hash", + "sc-tracing-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "serde", + "serde_json", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "tracing", + "tracing-core", + "tracing-log", + "tracing-subscriber", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "sc-tracing" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6690,11 +7943,10 @@ dependencies = [ "parking_lot 0.11.1", "regex", "rustc-hash", - "sc-telemetry", - "sc-tracing-proc-macro", + "sc-tracing-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", "serde_json", - "sp-tracing", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "tracing", "tracing-core", @@ -6707,9 +7959,20 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -6718,7 +7981,29 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "futures 0.3.13", + "linked-hash-map", + "log", + "parity-util-mem", + "parking_lot 0.11.1", + "retain_mut", + "serde", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-transaction-graph" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "futures 0.3.13", @@ -6728,11 +8013,37 @@ dependencies = [ "parking_lot 0.11.1", "retain_mut", "serde", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-transaction-pool", - "sp-utils", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-transaction-pool" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.13", + "futures-diagnose", + "intervalier", + "log", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "parking_lot 0.11.1", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sc-transaction-graph 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "thiserror", "wasm-timer", ] @@ -6740,25 +8051,25 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", "futures-diagnose", "intervalier", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "sc-client-api", - "sc-transaction-graph", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", - "sp-transaction-pool", - "sp-utils", - "substrate-prometheus-endpoint", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-transaction-graph 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "wasm-timer", ] @@ -6883,18 +8194,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ "proc-macro2", "quote", @@ -7004,9 +8315,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa894ef3fade0ee7243422f4fbbd6c2b48e6de767e621d37ef65f2310f53cea" +checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" dependencies = [ "libc", "signal-hook-registry", @@ -7029,14 +8340,14 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.1.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" +checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" dependencies = [ - "approx", - "num-complex", + "approx 0.4.0", + "num-complex 0.3.1", "num-traits", - "paste 0.1.18", + "paste", ] [[package]] @@ -7089,6 +8400,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "soketto" version = "0.4.2" @@ -7106,40 +8427,82 @@ dependencies = [ ] [[package]] -name = "sp-allocator" +name = "sp-allocator" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", +] + +[[package]] +name = "sp-allocator" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "log", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "thiserror", +] + +[[package]] +name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ + "hash-db", "log", - "sp-core", - "sp-std 3.0.0", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "sp-api-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "thiserror", ] [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", - "parity-scale-codec 2.0.1", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-version", + "log", + "parity-scale-codec 2.1.0", + "sp-api-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "blake2-rfc", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-api-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "blake2-rfc", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7148,73 +8511,149 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-application-crypto" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-arithmetic" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "integer-sqrt", + "num-traits", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-debug-derive", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "static_assertions", ] [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-authorship" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-block-builder" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-blockchain" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "futures 0.3.13", + "log", + "lru", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", ] [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", "log", "lru", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-api", - "sp-consensus", - "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-chain-spec" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "serde", "serde_json", @@ -7223,25 +8662,52 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.13", + "futures-timer 3.0.2", + "libp2p 0.35.1", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sp-consensus" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "futures 0.3.13", "futures-timer 3.0.2", - "libp2p", + "libp2p 0.36.0", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "serde", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "wasm-timer", ] @@ -7249,64 +8715,153 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-application-crypto", - "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "merlin", + "parity-scale-codec 2.1.0", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "merlin", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "parity-scale-codec 2.1.0", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-consensus-vrf" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-arithmetic", - "sp-runtime", + "parity-scale-codec 2.1.0", + "schnorrkel", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "schnorrkel", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-core" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "base58", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.13", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "parking_lot 0.11.1", + "primitive-types", + "rand 0.7.3", + "regex", "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "secrecy", + "serde", + "sha2 0.9.3", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", ] [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "base58", "blake2-rfc", @@ -7323,21 +8878,21 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "primitive-types 0.9.0", + "primitive-types", "rand 0.7.3", "regex", "schnorrkel", "secrecy", "serde", "sha2 0.9.3", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-bip39", "thiserror", "tiny-bip39", @@ -7350,7 +8905,16 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "kvdb", + "parking_lot 0.11.1", +] + +[[package]] +name = "sp-database" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -7359,7 +8923,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -7369,63 +8943,127 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "environmental", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", - "sp-storage", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-externalities" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "environmental", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-finality-grandpa" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std 3.0.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-inherents" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", ] [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-core", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "futures 0.3.13", "hash-db", "libsecp256k1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std 3.0.0", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "futures 0.3.13", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "tracing", "tracing-core", ] @@ -7433,45 +9071,89 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "strum", ] [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.13", + "merlin", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "schnorrkel", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-keystore" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", "derive_more", "futures 0.3.13", "merlin", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "schnorrkel", "serde", - "sp-core", - "sp-externalities", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "ruzstd", + "zstd", ] [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-offchain" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-panic-handler" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "backtrace", ] [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "backtrace", ] @@ -7479,57 +9161,116 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-rpc" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-runtime" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "paste", + "rand 0.7.3", "serde", - "sp-core", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", - "paste 1.0.4", + "paste", "rand 0.7.3", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std 3.0.0", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-runtime-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.0", + "primitive-types", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "static_assertions", ] [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std 3.0.0", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "primitive-types", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "Inflector", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7538,20 +9279,29 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-core", - "sp-io", - "sp-std 3.0.0", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-serializer" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "serde", "serde_json", @@ -7560,43 +9310,88 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-session" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-staking" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-state-machine" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-runtime", - "sp-std 3.0.0", + "hash-db", + "log", + "num-traits", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "rand 0.7.3", + "smallvec 1.6.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "trie-db", + "trie-root", ] [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std 3.0.0", - "sp-trie", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "trie-db", "trie-root", @@ -7611,56 +9406,112 @@ checksum = "2585fb8f5f4fde53c2f9ccebac4517da4dc435373a8fcaf5db7f54b798da66c2" [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" + +[[package]] +name = "sp-std" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" + +[[package]] +name = "sp-storage" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-serde", + "parity-scale-codec 2.1.0", + "ref-cast", + "serde", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "ref-cast", "serde", - "sp-debug-derive", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-tasks" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasm-timer", +] + +[[package]] +name = "sp-timestamp" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasm-timer", ] [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "tracing", "tracing-core", "tracing-subscriber", @@ -7669,29 +9520,59 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "derive_more", + "futures 0.3.13", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", +] + +[[package]] +name = "sp-transaction-pool" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "futures 0.3.13", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", - "sp-blockchain", - "sp-runtime", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec 2.0.1", - "sp-core", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "trie-db", "trie-root", ] @@ -7699,7 +9580,19 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.13", + "futures-core", + "futures-timer 3.0.2", + "lazy_static", + "prometheus", +] + +[[package]] +name = "sp-utils" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", "futures-core", @@ -7711,23 +9604,46 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-serde", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-version" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-wasm-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasmi", ] [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] @@ -7751,10 +9667,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" +checksum = "1e34b58a8f9b7462b6922e0b4e3c83d1b3c2075f7f996a56d6c66afa81590064" dependencies = [ + "nalgebra 0.19.0", "rand 0.7.3", ] @@ -7853,7 +9770,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", @@ -7861,22 +9778,36 @@ dependencies = [ "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "log", - "parity-scale-codec 2.0.1", - "sc-client-api", - "sc-rpc-api", + "parity-scale-codec 2.1.0", + "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "serde", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-transaction-pool", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "async-std", + "derive_more", + "futures-util", + "hyper 0.13.10", + "log", + "prometheus", + "tokio 0.2.25", ] [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-std", "derive_more", @@ -7907,9 +9838,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717" +checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" dependencies = [ "proc-macro2", "quote", @@ -8056,9 +9987,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" dependencies = [ "tinyvec_macros", ] @@ -8362,9 +10293,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41768be5b9f3489491825f56f01f25290aa1d3e7cc97e182d4d34360493ba6fa" +checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote", @@ -8386,7 +10317,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.5", + "pin-project 1.0.6", "tracing", ] @@ -8413,9 +10344,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ab8966ac3ca27126141f7999361cc97dd6fb4b71da04c02044fa9045d98bb96" +checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -8462,7 +10393,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ "hash-db", - "rlp 0.5.0", + "rlp", +] + +[[package]] +name = "trust-dns-proto" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57e219ba600dd96c2f6d82eb79645068e14edbc5c7e27514af40436b88150c" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.2", + "ipnet", + "lazy_static", + "log", + "rand 0.8.3", + "smallvec 1.6.1", + "thiserror", + "tinyvec", + "url 2.2.1", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0437eea3a6da51acc1e946545ff53d5b8fb2611ff1c3bed58522dde100536ae" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.11.1", + "resolv-conf", + "smallvec 1.6.1", + "thiserror", + "trust-dns-proto", ] [[package]] @@ -8484,9 +10458,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "ucd-trie" @@ -8494,18 +10468,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "uint" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions", -] - [[package]] name = "uint" version = "0.9.0" @@ -8529,9 +10491,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] @@ -8649,9 +10611,9 @@ checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec-arena" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" +checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" [[package]] name = "vec_map" @@ -8661,9 +10623,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "void" @@ -8712,9 +10674,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8722,9 +10684,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" dependencies = [ "bumpalo", "lazy_static", @@ -8737,9 +10699,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.21" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" +checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8749,9 +10711,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8759,9 +10721,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ "proc-macro2", "quote", @@ -8772,9 +10734,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" [[package]] name = "wasm-timer" @@ -8799,7 +10761,7 @@ checksum = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" dependencies = [ "libc", "memory_units", - "num-rational", + "num-rational 0.2.4", "num-traits", "parity-wasm", "wasmi-validation", @@ -8816,15 +10778,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.71.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a30c99437829ede826802bfcf28500cf58df00e66cb9114df98813bc145ff1" +checksum = "755a9a4afe3f6cccbbe6d7e965eef44cf260b001f93e547eba84255c1d0187d8" [[package]] name = "wasmtime" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7426055cb92bd9a1e9469b48154d8d6119cd8c498c8b70284e420342c05dc45d" +checksum = "718cb52a9fdb7ab12471e9b9d051c9adfa6b5c504e0a1fea045e5eabc81eedd9" dependencies = [ "anyhow", "backtrace", @@ -8834,6 +10796,7 @@ dependencies = [ "indexmap", "libc", "log", + "paste", "region", "rustc-demangle", "serde", @@ -8842,6 +10805,7 @@ dependencies = [ "wasmparser", "wasmtime-cache", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit", "wasmtime-profiling", "wasmtime-runtime", @@ -8851,9 +10815,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01d9287e36921e46f5887a47007824ae5dbb9b7517a2d565660ab4471478709" +checksum = "1f984df56c4adeba91540f9052db9f7a8b3b00cfaac1a023bee50a972f588b0c" dependencies = [ "anyhow", "base64 0.13.0", @@ -8872,27 +10836,28 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4134ed3a4316cd0de0e546c6004850afe472b0fa3fcdc2f2c15f8d449562d962" +checksum = "2a05abbf94e03c2c8ee02254b1949320c4d45093de5d9d6ed4d9351d536075c9" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-wasm", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-debug" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" +checksum = "382eecd6281c6c1d1f3c904c3c143e671fc1a9573820cbfa777fba45ce2eda9c" dependencies = [ "anyhow", "gimli", "more-asserts", - "object 0.22.0", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -8901,9 +10866,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1098871dc3120aaf8190d79153e470658bb79f63ee9ca31716711e123c28220" +checksum = "81011b2b833663d7e0ce34639459a0e301e000fc7331e0298b3a27c78d0cec60" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -8919,11 +10884,22 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wasmtime-fiber" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92da32e31af2e3d828f485f5f24651ed4d3b7f03a46ea6555eae6940d1402cd" +dependencies = [ + "cc", + "libc", + "winapi 0.3.9", +] + [[package]] name = "wasmtime-jit" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" +checksum = "9b5f649623859a12d361fe4cc4793de44f7c3ff34c322c5714289787e89650bb" dependencies = [ "addr2line", "anyhow", @@ -8936,7 +10912,7 @@ dependencies = [ "gimli", "log", "more-asserts", - "object 0.22.0", + "object", "rayon", "region", "serde", @@ -8954,13 +10930,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e96d77f1801131c5e86d93e42a3cf8a35402107332c202c245c83f34888a906" +checksum = "ef2e99cd9858f57fd062e9351e07881cedfc8597928385e02a48d9333b9e15a1" dependencies = [ "anyhow", "more-asserts", - "object 0.22.0", + "object", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -8968,16 +10944,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" +checksum = "e46c0a590e49278ba7f79ef217af9db4ecc671b50042c185093e22d73524abb2" dependencies = [ "anyhow", "cfg-if 1.0.0", "gimli", "lazy_static", "libc", - "object 0.22.0", + "object", "scroll", "serde", "target-lexicon", @@ -8987,9 +10963,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978086740949eeedfefcee667b57a9e98d9a7fc0de382fcfa0da30369e3530d" +checksum = "1438a09185fc7ca067caf1a80d7e5b398eefd4fb7630d94841448ade60feb3d0" dependencies = [ "backtrace", "cc", @@ -8998,7 +10974,7 @@ dependencies = [ "lazy_static", "libc", "log", - "memoffset 0.6.1", + "memoffset 0.6.3", "more-asserts", "psm", "region", @@ -9009,27 +10985,27 @@ dependencies = [ [[package]] name = "wast" -version = "35.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5ae96da18bb5926341516fd409b5a8ce4e4714da7f0a1063d3b20ac9f9a1e1" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0fa059022c5dabe129f02b429d67086400deb8277f89c975555dacc1dadbcc" +checksum = "8ec280a739b69173e0ffd12c1658507996836ba4e992ed9bc1e5385a0bd72a02" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.48" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" +checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" dependencies = [ "js-sys", "wasm-bindgen", @@ -9068,9 +11044,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki", ] @@ -9095,14 +11071,20 @@ dependencies = [ [[package]] name = "which" -version = "4.0.2" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" dependencies = [ + "either", "libc", - "thiserror", ] +[[package]] +name = "widestring" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" + [[package]] name = "winapi" version = "0.2.8" @@ -9146,6 +11128,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -9210,18 +11201,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.5.4+zstd.1.4.7" +version = "0.6.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69996ebdb1ba8b1517f61387a883857818a66c8a295f487b1ffd8fd9d2c82910" +checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "2.0.6+zstd.1.4.7" +version = "3.0.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98aa931fb69ecee256d44589d19754e61851ae4769bf963b385119b1cc37a49e" +checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" dependencies = [ "libc", "zstd-sys", @@ -9229,162 +11220,135 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.4.18+zstd.1.4.7" +version = "1.4.20+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" +checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" dependencies = [ "cc", - "glob", - "itertools", "libc", ] [[patch.unused]] name = "pallet-assets" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-primitives" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-proc-macro" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-rpc-runtime-api" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-treasury" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-browser-utils" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-frame-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" diff --git a/Cargo.toml b/Cargo.toml index eb4bc5b2..2a5657a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [ "node", "pallets/merkle", "pallets/mixer", - "pallets/webb-tokens", + "pallets/tokens", "runtime", ] @@ -56,137 +56,137 @@ yamux = { opt-level = 3 } zeroize = { opt-level = 3 } [patch.crates-io] -fork-tree = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-executive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-metadata = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural-tools = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural-tools-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-assets = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-chain-spec-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-client-db = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-common = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-wasmi = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-informant = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-light = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-network-gossip = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-peerset = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-proposer-metrics = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc-server = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-state-db = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-transaction-graph = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-allocator = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-api-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-vrf = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-database = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-npos-elections = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-npos-elections-compact = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-panic-handler = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-sandbox = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-serializer = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-tasks = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-utils = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-browser-utils = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-frame-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-test-client = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } +fork-tree = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-executive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-metadata = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural-tools = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural-tools-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-assets = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-chain-spec-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-client-db = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-common = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-wasmi = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-informant = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-light = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-network-gossip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-peerset = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-proposer-metrics = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc-server = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-state-db = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-transaction-graph = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-allocator = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-api-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-vrf = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-database = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-npos-elections = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-npos-elections-compact = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-panic-handler = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-sandbox = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-serializer = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-tasks = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-utils = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-browser-utils = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-frame-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-test-client = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } diff --git a/pallets/mixer/Cargo.toml b/pallets/mixer/Cargo.toml index 54a10a3b..d54bf1f2 100644 --- a/pallets/mixer/Cargo.toml +++ b/pallets/mixer/Cargo.toml @@ -16,13 +16,16 @@ frame-support = { default-features = false, version = '3.0.0' } frame-system = { default-features = false, version = '3.0.0' } sp-std = { default-features = false, version = "3.0.0" } sp-runtime = { default-features = false, version = '3.0.0' } + merkle = { package = "pallet-merkle", path = "../merkle", default-features = false } +tokens = { package = "pallet-tokens", path = "../tokens", default-features = false } + + serde = { version = "1.0.101", optional = true, features = ["derive"] } merlin = { version = "2.0.0", default-features = false } frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } orml-traits = { version = "0.4.0", default-features = false } orml-currencies = { version = "0.4.0", default-features = false } -orml-tokens = { version = "0.4.0", default-features = false } [dependencies.bulletproofs] version = "2.0.0" @@ -55,7 +58,7 @@ std = [ "balances/std", "frame-support/std", "frame-system/std", - "orml-tokens/std", + "tokens/std", "frame-benchmarking/std", "merkle/std", ] diff --git a/pallets/mixer/src/lib.rs b/pallets/mixer/src/lib.rs index 44228fb1..1143fd83 100644 --- a/pallets/mixer/src/lib.rs +++ b/pallets/mixer/src/lib.rs @@ -137,10 +137,6 @@ pub mod pallet { #[pallet::getter(fn total_value_locked)] pub type TotalValueLocked = StorageMap<_, Blake2_128Concat, T::TreeId, BalanceOf, ValueQuery>; - // /// Old name generated by `decl_event`. - // #[deprecated(note = "use `Event` instead")] - // pub type RawEvent = Event; - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] #[pallet::metadata(T::AccountId = "AccountId", T::TreeId = "TreeId", BalanceOf = "Balance")] diff --git a/pallets/webb-tokens/Cargo.toml b/pallets/tokens/Cargo.toml similarity index 91% rename from pallets/webb-tokens/Cargo.toml rename to pallets/tokens/Cargo.toml index d5f7a693..06190c72 100644 --- a/pallets/webb-tokens/Cargo.toml +++ b/pallets/tokens/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "pallet-webb-tokens" -version = "0.1.0" +name = "pallet-tokens" +version = "3.0.0" authors = ["Drew Stone "] edition = "2018" @@ -17,8 +17,6 @@ sp-runtime = { default-features = false, version = '3.0.0' } serde = { version = "1.0.101", optional = true, features = ["derive"] } frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } orml-traits = { version = "0.4.0", default-features = false } -orml-currencies = { version = "0.4.0", default-features = false } -orml-tokens = { version = "0.4.0", default-features = false } [dependencies.bencher] version = "0.1.5" @@ -26,6 +24,7 @@ version = "0.1.5" [dev-dependencies] sp-core = { default-features = false, version = '3.0.0' } sp-io = { default-features = false, version = '3.0.0' } +orml-currencies = { version = "0.4.0", default-features = false } [features] default = ['std'] @@ -35,8 +34,8 @@ std = [ "balances/std", "frame-support/std", "frame-system/std", - "orml-tokens/std", "frame-benchmarking/std", + "orml-traits/std", ] runtime-benchmarks = [ "frame-benchmarking", diff --git a/pallets/tokens/src/imbalance.rs b/pallets/tokens/src/imbalance.rs new file mode 100644 index 00000000..084a3b9a --- /dev/null +++ b/pallets/tokens/src/imbalance.rs @@ -0,0 +1,174 @@ +// wrapping these imbalances in a private module is necessary to ensure absolute +// privacy of the inner member. +use crate::{Config, TotalIssuance}; +use frame_support::traits::{Get, Imbalance, SameOrOther, TryDrop}; +use sp_runtime::traits::{Saturating, Zero}; +use sp_std::{marker, mem, result}; + +/// Opaque, move-only struct with private fields that serves as a token +/// denoting that funds have been created without any equal and opposite +/// accounting. +#[must_use] +pub struct PositiveImbalance>( + T::Balance, + marker::PhantomData, +); + +impl> PositiveImbalance { + /// Create a new positive imbalance from a balance. + pub fn new(amount: T::Balance) -> Self { + PositiveImbalance(amount, marker::PhantomData::) + } +} + +impl> Default for PositiveImbalance { + fn default() -> Self { + Self::zero() + } +} + +/// Opaque, move-only struct with private fields that serves as a token +/// denoting that funds have been destroyed without any equal and opposite +/// accounting. +#[must_use] +pub struct NegativeImbalance>( + T::Balance, + marker::PhantomData, +); + +impl> NegativeImbalance { + /// Create a new negative imbalance from a balance. + pub fn new(amount: T::Balance) -> Self { + NegativeImbalance(amount, marker::PhantomData::) + } +} + +impl> Default for NegativeImbalance { + fn default() -> Self { + Self::zero() + } +} + +impl> TryDrop for PositiveImbalance { + fn try_drop(self) -> result::Result<(), Self> { + self.drop_zero() + } +} + +impl> Imbalance for PositiveImbalance { + type Opposite = NegativeImbalance; + + fn zero() -> Self { + Self::new(Zero::zero()) + } + fn drop_zero(self) -> result::Result<(), Self> { + if self.0.is_zero() { + Ok(()) + } else { + Err(self) + } + } + fn split(self, amount: T::Balance) -> (Self, Self) { + let first = self.0.min(amount); + let second = self.0 - first; + + mem::forget(self); + (Self::new(first), Self::new(second)) + } + fn merge(mut self, other: Self) -> Self { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + + self + } + fn subsume(&mut self, other: Self) { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + } + // allow to make the impl same with `pallet-balances` + #[allow(clippy::comparison_chain)] + fn offset(self, other: Self::Opposite) -> SameOrOther { + let (a, b) = (self.0, other.0); + mem::forget((self, other)); + + if a > b { + SameOrOther::Same(Self::new(a - b)) + } else if b > a { + SameOrOther::Other(NegativeImbalance::new(b - a)) + } else { + SameOrOther::None + } + } + fn peek(&self) -> T::Balance { + self.0 + } +} + +impl> TryDrop for NegativeImbalance { + fn try_drop(self) -> result::Result<(), Self> { + self.drop_zero() + } +} + +impl> Imbalance for NegativeImbalance { + type Opposite = PositiveImbalance; + + fn zero() -> Self { + Self::new(Zero::zero()) + } + fn drop_zero(self) -> result::Result<(), Self> { + if self.0.is_zero() { + Ok(()) + } else { + Err(self) + } + } + fn split(self, amount: T::Balance) -> (Self, Self) { + let first = self.0.min(amount); + let second = self.0 - first; + + mem::forget(self); + (Self::new(first), Self::new(second)) + } + fn merge(mut self, other: Self) -> Self { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + + self + } + fn subsume(&mut self, other: Self) { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + } + // allow to make the impl same with `pallet-balances` + #[allow(clippy::comparison_chain)] + fn offset(self, other: Self::Opposite) -> SameOrOther { + let (a, b) = (self.0, other.0); + mem::forget((self, other)); + + if a > b { + SameOrOther::Same(Self::new(a - b)) + } else if b > a { + SameOrOther::Other(PositiveImbalance::new(b - a)) + } else { + SameOrOther::None + } + } + fn peek(&self) -> T::Balance { + self.0 + } +} + +impl> Drop for PositiveImbalance { + /// Basic drop handler will just square up the total issuance. + fn drop(&mut self) { + TotalIssuance::::mutate(GetCurrencyId::get(), |v| *v = v.saturating_add(self.0)); + } +} + +impl> Drop for NegativeImbalance { + /// Basic drop handler will just square up the total issuance. + fn drop(&mut self) { + TotalIssuance::::mutate(GetCurrencyId::get(), |v| *v = v.saturating_sub(self.0)); + } +} diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs new file mode 100644 index 00000000..b378b04a --- /dev/null +++ b/pallets/tokens/src/lib.rs @@ -0,0 +1,1769 @@ +// A runtime module Groups with necessary imports + +// Feel free to remove or edit this file as needed. +// If you change the name of this file, make sure to update its references in +// runtime/src/lib.rs If you remove this file, you can remove those references + +// For more guidance on Substrate modules, see the example module +// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod weights; +// #[cfg(feature = "runtime-benchmarks")] +// mod benchmarking; +#[cfg(test)] +pub mod mock; +#[cfg(test)] +mod tests; + +mod traits; +pub use traits::*; +mod types; +pub use types::*; +mod imbalance; +pub use imbalance::*; + +use sp_std::{ + convert::{Infallible, TryFrom, TryInto}, + marker, + prelude::*, + vec::Vec, +}; + +use sp_runtime::{ + traits::{ + AccountIdConversion, AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, + Saturating, StaticLookup, Zero, + }, + RuntimeDebug, +}; +use codec::{Encode, Decode}; +use frame_support::{ensure, dispatch::{DispatchError, DispatchResult}, PalletId}; +use frame_support::{ + log, + traits::{ + Currency as PalletCurrency, ExistenceRequirement, Get, Imbalance, + LockableCurrency as PalletLockableCurrency, ReservableCurrency as PalletReservableCurrency, SignedImbalance, + WithdrawReasons, + }, + transactional, +}; + + +use orml_traits::{ + account::MergeAccount, + arithmetic::{self, Signed}, + BalanceStatus, LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, + MultiReservableCurrency, OnDust, +}; + +pub use weights::WeightInfo; +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + #[pallet::config] + /// The module configuration trait. + pub trait Config: frame_system::Config { + #[pallet::constant] + type PalletId: Get; + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// The balance type + type Balance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize; + + /// The amount type, should be signed version of `Balance` + type Amount: Signed + + TryInto + + TryFrom + + Parameter + + Member + + arithmetic::SimpleArithmetic + + Default + + Copy + + MaybeSerializeDeserialize; + + /// The currency ID type + type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize + Ord; + + /// The origin which may forcibly create or destroy an asset or otherwise alter privileged + /// attributes. + type ForceOrigin: EnsureOrigin; + + /// The basic amount of funds that must be reserved for an asset. + type CurrencyDeposit: Get; + + /// The basic amount of funds that must be reserved when adding metadata to your asset. + type MetadataDepositBase: Get; + + /// The additional funds that must be reserved for the number of bytes you store in your + /// metadata. + type MetadataDepositPerByte: Get; + + /// The amount of funds that must be reserved when creating a new approval. + type ApprovalDeposit: Get; + + /// The maximum length of a name or symbol stored on-chain. + type StringLimit: Get; + + /// Additional data to be stored with an account's asset balance. + type Extra: Member + Parameter + Default; + + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + + /// Handler to burn or transfer account's dust + type OnDust: OnDust; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", T::Balance = "Balance", T::CurrencyId = "CurrencyId")] + pub enum Event { + /// Some asset class was created. \[asset_id, creator, owner\] + Created(T::CurrencyId, T::AccountId, T::AccountId), + /// Some assets were issued. \[asset_id, owner, total_supply\] + Issued(T::CurrencyId, T::AccountId, T::Balance), + /// Some assets were destroyed. \[asset_id, owner, balance\] + Burned(T::CurrencyId, T::AccountId, T::Balance), + /// The management team changed \[asset_id, issuer, admin, freezer\] + TeamChanged(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId), + /// The owner changed \[asset_id, owner\] + OwnerChanged(T::CurrencyId, T::AccountId), + /// An asset class was destroyed. + Destroyed(T::CurrencyId), + /// Some asset class was force-created. \[asset_id, owner\] + ForceCreated(T::CurrencyId, T::AccountId), + /// New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] + MetadataSet(T::CurrencyId, Vec, Vec, u8, bool), + /// Metadata has been cleared for an asset. \[asset_id\] + MetadataCleared(T::CurrencyId), + /// (Additional) funds have been approved for transfer to a destination account. + /// \[asset_id, source, delegate, amount\] + ApprovedTransfer(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), + /// An approval for account `delegate` was cancelled by `owner`. + /// \[id, owner, delegate\] + ApprovalCancelled(T::CurrencyId, T::AccountId, T::AccountId), + /// An `amount` was transferred in its entirety from `owner` to `destination` by + /// the approved `delegate`. + /// \[id, owner, delegate, destination\] + TransferredApproved(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId, T::Balance), + /// An asset has had its attributes changed by the `Force` origin. + /// \[id\] + CurrencyStatusChanged(T::CurrencyId), + /// Token transfer success. \[currency_id, from, to, amount\] + Transferred(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), + /// An account was removed whose balance was non-zero but below + /// ExistentialDeposit, resulting in an outright loss. \[account, + /// currency_id, amount\] + DustLost(T::AccountId, T::CurrencyId, T::Balance), + } + + #[pallet::error] + pub enum Error { + /// The token doesn't exist + TokenDoesntExist, + /// This operation will cause balance to overflow + BalanceOverflow, + /// This operation will cause total issuance to overflow + TotalIssuanceOverflow, + /// Cannot convert Amount into Balance type + AmountIntoBalanceFailed, + /// Failed because liquidity restrictions due to locking + LiquidityRestrictions, + /// Account still has active reserved + StillHasActiveReserved, + /// Account balance must be greater than or equal to the transfer amount. + BalanceLow, + /// Balance should be non-zero. + BalanceZero, + /// The signing account has no permission to do the operation. + NoPermission, + /// The given currency ID is unknown. + Unknown, + /// The origin account is frozen. + Frozen, + /// The currency ID is already taken. + InUse, + /// Invalid witness data given. + BadWitness, + /// Minimum balance should be non-zero. + MinBalanceZero, + /// A mint operation lead to an overflow. + Overflow, + /// No provider reference exists to allow a non-zero balance of a non-self-sufficient currency. + NoProvider, + /// Invalid metadata given. + BadMetadata, + /// No approval exists that would allow the transfer. + Unapproved, + /// The source account would not survive the transfer and it needs to stay alive. + WouldDie, + } + + #[pallet::storage] + #[pallet::getter(fn currency)] + /// Details of an asset. + pub(super) type Token = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + TokenDetails, + >; + + #[pallet::storage] + #[pallet::getter(fn approvals)] + /// Approved balance transfers. First balance is the amount approved for transfer. Second + /// is the amount of `T::Currency` reserved for storing this. + pub(super) type Approvals = StorageDoubleMap< + _, + Blake2_128Concat, + T::CurrencyId, + Blake2_128Concat, + ApprovalKey, + Approval, + OptionQuery, + >; + + #[pallet::storage] + #[pallet::getter(fn metadata)] + /// Metadata of an currency. + pub(super) type Metadata = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + TokenMetadata, + ValueQuery, + >; + + /// The total issuance of a token type. + #[pallet::storage] + #[pallet::getter(fn total_issuance)] + pub type TotalIssuance = StorageMap<_, Twox64Concat, T::CurrencyId, T::Balance, ValueQuery>; + + /// Any liquidity locks of a token type under an account. + /// NOTE: Should only be accessed when setting, changing and freeing a lock. + #[pallet::storage] + #[pallet::getter(fn locks)] + pub type Locks = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Twox64Concat, + T::CurrencyId, + Vec>, + ValueQuery, + >; + + /// The balance of an account under a token type. + /// + /// NOTE: If the total is ever zero, decrease account ref account. + /// + /// NOTE: This is only used in the case that this module is used to store + /// balances. + #[pallet::storage] + #[pallet::getter(fn accounts)] + pub type Accounts = StorageDoubleMap< + _, + Blake2_128Concat, + T::CurrencyId, + Twox64Concat, + T::AccountId, + AccountData, + ValueQuery, + >; + + /// The balance of an account under a token type. + /// + /// NOTE: If the total is ever zero, decrease account ref account. + /// + /// NOTE: This is only used in the case that this module is used to store + /// balances. + #[pallet::storage] + #[pallet::getter(fn account_currencies)] + pub type AccountCurrencies = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Twox64Concat, + T::CurrencyId, + bool, + ValueQuery, + >; + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Issue a new class of fungible assets from a public origin. + /// + /// This new asset class has no assets initially and its owner is the origin. + /// + /// The origin must be Signed and the sender must have sufficient funds free. + /// + /// Funds of sender are reserved by `CurrencyDeposit`. + /// + /// Parameters: + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `admin`: The admin of this class of assets. The admin is the initial address of each + /// member of the asset class's admin team. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `Created` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn create( + origin: OriginFor, + id: T::CurrencyId, + admin: ::Source, + min_balance: T::Balance, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let admin = T::Lookup::lookup(admin)?; + + ensure!(!Token::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + let deposit = T::CurrencyDeposit::get(); + >::reserve(id, &owner, deposit)?; + + Token::::insert(id, TokenDetails { + owner: owner.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), + supply: Zero::zero(), + deposit, + min_balance, + is_sufficient: false, + accounts: 0, + sufficients: 0, + approvals: 0, + is_frozen: false, + }); + Self::deposit_event(Event::Created(id, owner, admin)); + Ok(()) + } + + /// Issue a new class of fungible assets from a privileged origin. + /// + /// This new asset class has no assets initially. + /// + /// The origin must conform to `ForceOrigin`. + /// + /// Unlike `create`, no funds are reserved. + /// + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `owner`: The owner of this class of assets. The owner has full superuser permissions + /// over this asset, but may later change and configure the permissions using `transfer_ownership` + /// and `set_team`. + /// - `max_zombies`: The total number of accounts which may hold assets in this class yet + /// have no existential deposit. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `ForceCreated` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_create( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + is_sufficient: bool, + min_balance: T::Balance, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + let owner = T::Lookup::lookup(owner)?; + + ensure!(!Token::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + Token::::insert(id, TokenDetails { + owner: owner.clone(), + issuer: owner.clone(), + admin: owner.clone(), + freezer: owner.clone(), + supply: Zero::zero(), + deposit: Zero::zero(), + min_balance, + is_sufficient, + accounts: 0, + sufficients: 0, + approvals: 0, + is_frozen: false, + }); + Self::deposit_event(Event::ForceCreated(id, owner)); + Ok(()) + } + + /// Destroy a class of fungible assets. + /// + /// The origin must conform to `ForceOrigin` or must be Signed and the sender must be the + /// owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be destroyed. This must identify an existing + /// asset. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(c + p + a)` where: + /// - `c = (witness.accounts - witness.sufficients)` + /// - `s = witness.sufficients` + /// - `a = witness.approvals` + #[pallet::weight(5_000_000)] + pub(super) fn destroy( + origin: OriginFor, + id: T::CurrencyId, + witness: DestroyWitness, + ) -> DispatchResult { + let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { + Ok(_) => None, + Err(origin) => Some(ensure_signed(origin)?), + }; + Token::::try_mutate_exists(id, |maybe_details| { + let mut details = maybe_details.take().ok_or(Error::::Unknown)?; + if let Some(check_owner) = maybe_check_owner { + ensure!(details.owner == check_owner, Error::::NoPermission); + } + ensure!(details.accounts == witness.accounts, Error::::BadWitness); + ensure!(details.sufficients == witness.sufficients, Error::::BadWitness); + ensure!(details.approvals == witness.approvals, Error::::BadWitness); + + for (who, v) in Accounts::::drain_prefix(id) { + Self::dead_account(id, &who, &mut details); + AccountCurrencies::::remove(who, id); + } + debug_assert_eq!(details.accounts, 0); + debug_assert_eq!(details.sufficients, 0); + + let metadata = Metadata::::take(&id); + >::unreserve( + id, + &details.owner, + details.deposit.saturating_add(metadata.deposit) + ); + + Approvals::::remove_prefix(&id); + Self::deposit_event(Event::Destroyed(id)); + + // NOTE: could use postinfo to reflect the actual number of accounts/sufficient/approvals + Ok(()) + }) + } + + /// Mint assets of a particular class. + /// + /// The origin must be Signed and the sender must be the Issuer of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount minted. + /// - `beneficiary`: The account to be credited with the minted assets. + /// - `amount`: The amount of the asset to be minted. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(1)` + /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. + #[pallet::weight(5_000_000)] + pub(super) fn mint( + origin: OriginFor, + id: T::CurrencyId, + beneficiary: ::Source, + amount: T::Balance + ) -> DispatchResult { + // TODO: Make this callable by the admin + let _ = ensure_signed(origin)?; + let beneficiary = T::Lookup::lookup(beneficiary)?; + >::mint(id, beneficiary.clone(), amount)?; + Self::deposit_event(Event::Issued(id, beneficiary, amount)); + Ok(()) + } + + /// Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. + /// + /// Origin must be Signed and the sender should be the Manager of the asset `id`. + /// + /// Bails with `BalanceZero` if the `who` is already dead. + /// + /// - `id`: The identifier of the asset to have some amount burned. + /// - `who`: The account to be debited from. + /// - `amount`: The maximum amount by which `who`'s balance should be reduced. + /// + /// Emits `Burned` with the actual amount burned. If this takes the balance to below the + /// minimum for the asset, then the amount burned is increased to take it to zero. + /// + /// Weight: `O(1)` + /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. + #[pallet::weight(5_000_000)] + pub(super) fn burn( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source, + amount: T::Balance + ) -> DispatchResult { + // TODO: Make this callable by the admin + let _ = ensure_signed(origin)?; + let who = T::Lookup::lookup(who)?; + >::burn(id, who.clone(), amount)?; + Self::deposit_event(Event::Burned(id, who, amount)); + Ok(()) + } + + /// Change the Owner of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// + /// Emits `OwnerChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_ownership( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + if details.owner == owner { return Ok(()) } + + let metadata_deposit = Metadata::::get(id).deposit; + let deposit = details.deposit + metadata_deposit; + + // Move the deposit to the new owner. + >::repatriate_reserved( + id, + &details.owner, + &owner, + deposit, + BalanceStatus::Reserved + )?; + + details.owner = owner.clone(); + + Self::deposit_event(Event::OwnerChanged(id, owner)); + Ok(()) + }) + } + + /// Change the Issuer, Admin and Freezer of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// + /// Emits `TeamChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_team( + origin: OriginFor, + id: T::CurrencyId, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let issuer = T::Lookup::lookup(issuer)?; + let admin = T::Lookup::lookup(admin)?; + let freezer = T::Lookup::lookup(freezer)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + + details.issuer = issuer.clone(); + details.admin = admin.clone(); + details.freezer = freezer.clone(); + + Self::deposit_event(Event::TeamChanged(id, issuer, admin, freezer)); + Ok(()) + }) + } + + /// Set the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Funds of sender are reserved according to the formula: + /// `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into + /// account any already reserved funds. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_metadata( + origin: OriginFor, + id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + ensure!(metadata.as_ref().map_or(true, |m| !m.is_frozen), Error::::NoPermission); + + let old_deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + let new_deposit = T::MetadataDepositPerByte::get() + .saturating_mul(((name.len() + symbol.len()) as u32).into()) + .saturating_add(T::MetadataDepositBase::get()); + + if new_deposit > old_deposit { + >::reserve(id, &origin, new_deposit - old_deposit)?; + } else { + >::unreserve(id, &origin, old_deposit - new_deposit); + } + + *metadata = Some(TokenMetadata { + deposit: new_deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen: false, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, false)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Any deposit is freed for the asset owner. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn clear_metadata( + origin: OriginFor, + id: T::CurrencyId, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + >::unreserve(id, &d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Force the metadata for an asset to some value. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is left alone. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively. + #[pallet::weight(5_000_000)] + pub(super) fn force_set_metadata( + origin: OriginFor, + id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + ensure!(Token::::contains_key(id), Error::::Unknown); + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + *metadata = Some(TokenMetadata { + deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, is_frozen)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is returned. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_clear_metadata( + origin: OriginFor, + id: T::CurrencyId, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + >::unreserve(id, &d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Alter the attributes of a given asset. + /// + /// Origin must be `ForceOrigin`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient + /// value to account for the state bloat associated with its balance storage. If set to + /// `true`, then non-zero balances may be stored without a `consumer` reference (and thus + /// an ED in the Balances pallet or whatever else is used to control user-account state + /// growth). + /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin + /// instructions. + /// + /// Emits `CurrencyStatusChanged` with the identity of the asset. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_asset_status( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + min_balance: T::Balance, + is_sufficient: bool, + is_frozen: bool, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + Token::::try_mutate(id, |maybe_asset| { + let mut asset = maybe_asset.take().ok_or(Error::::Unknown)?; + asset.owner = T::Lookup::lookup(owner)?; + asset.issuer = T::Lookup::lookup(issuer)?; + asset.admin = T::Lookup::lookup(admin)?; + asset.freezer = T::Lookup::lookup(freezer)?; + asset.min_balance = min_balance; + asset.is_sufficient = is_sufficient; + asset.is_frozen = is_frozen; + *maybe_asset = Some(asset); + + Self::deposit_event(Event::CurrencyStatusChanged(id)); + Ok(()) + }) + } + + /// Approve an amount of asset for transfer by a delegated third-party account. + /// + /// Origin must be Signed. + /// + /// Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account + /// for the purpose of holding the approval. If some non-zero amount of assets is already + /// approved from signing account to `delegate`, then it is topped up or unreserved to + /// meet the right value. + /// + /// NOTE: The signing account does not need to own `amount` of assets at the point of + /// making this call. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account to delegate permission to transfer asset. + /// - `amount`: The amount of asset that may be transferred by `delegate`. If there is + /// already an approval in place, then this acts additively. + /// + /// Emits `ApprovedTransfer` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn approve_transfer( + origin: OriginFor, + id: T::CurrencyId, + delegate: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate(id, &key, |maybe_approved| -> DispatchResult { + let mut approved = maybe_approved.take().unwrap_or_default(); + let deposit_required = T::ApprovalDeposit::get(); + if approved.deposit < deposit_required { + >::reserve(id, &key.owner, deposit_required - approved.deposit)?; + approved.deposit = deposit_required; + } + approved.amount = approved.amount.saturating_add(amount); + *maybe_approved = Some(approved); + Ok(()) + })?; + Self::deposit_event(Event::ApprovedTransfer(id, key.owner, key.delegate, amount)); + + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be Signed and there must be an approval in place between signer and + /// `delegate`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn cancel_approval( + origin: OriginFor, + id: T::CurrencyId, + delegate: ::Source, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + >::unreserve(id, &key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be either ForceOrigin or Signed origin with the signer being the Admin + /// account of the asset `id`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_cancel_approval( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + delegate: ::Source, + ) -> DispatchResult { + T::ForceOrigin::try_origin(origin) + .map(|_| ()) + .or_else(|origin| -> DispatchResult { + let origin = ensure_signed(origin)?; + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.admin, Error::::NoPermission); + Ok(()) + })?; + + let owner = T::Lookup::lookup(owner)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + >::unreserve(id, &key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Transfer some asset balance from a previously delegated account to some third-party + /// account. + /// + /// Origin must be Signed and there must be an approval in place by the `owner` to the + /// signer. + /// + /// If the entire amount approved for transfer is transferred, then any deposit previously + /// reserved by `approve_transfer` is unreserved. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The account which previously approved for a transfer of at least `amount` and + /// from which the asset balance will be withdrawn. + /// - `destination`: The account to which the asset balance of `amount` will be transferred. + /// - `amount`: The amount of assets to transfer. + /// + /// Emits `TransferredApproved` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_approved( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + destination: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let delegate = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + let destination = T::Lookup::lookup(destination)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate_exists(id, &key, |maybe_approved| -> DispatchResult { + let mut approved = maybe_approved.take().ok_or(Error::::Unapproved)?; + let remaining = approved.amount.checked_sub(&amount).ok_or(Error::::Unapproved)?; + + >::transfer(id, &key.owner, &destination, amount)?; + + if remaining.is_zero() { + >::unreserve(id, &key.owner, approved.deposit); + } else { + approved.amount = remaining; + *maybe_approved = Some(approved); + } + Ok(()) + })?; + Ok(()) + } + + /// Transfer some balance to another account. + /// + /// The dispatch origin for this call must be `Signed` by the + /// transactor. + #[pallet::weight(5_000_000)] + pub fn transfer( + origin: OriginFor, + dest: ::Source, + currency_id: T::CurrencyId, + amount: T::Balance, + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(dest)?; + >::transfer(currency_id, &from, &to, amount)?; + + Self::deposit_event(Event::Transferred(currency_id, from, to, amount)); + Ok(().into()) + } + + /// Transfer all remaining balance to the given account. + /// + /// The dispatch origin for this call must be `Signed` by the + /// transactor. + #[pallet::weight(5_000_000)] + pub fn transfer_all( + origin: OriginFor, + dest: ::Source, + currency_id: T::CurrencyId, + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(dest)?; + let balance = >::free_balance(currency_id, &from); + >::transfer(currency_id, &from, &to, balance)?; + + Self::deposit_event(Event::Transferred(currency_id, from, to, balance)); + Ok(().into()) + } + } +} + +impl Pallet { + /// Check whether account_id is a module account + pub(crate) fn is_module_account_id(account_id: &T::AccountId) -> bool { + PalletId::try_from_account(account_id).is_some() + } + + pub(crate) fn try_mutate_account( + who: &T::AccountId, + currency_id: T::CurrencyId, + f: impl FnOnce(&mut AccountData, bool) -> sp_std::result::Result, + ) -> sp_std::result::Result { + Accounts::::try_mutate_exists(currency_id, who, |maybe_account| { + let existed = maybe_account.is_some(); + let mut account = maybe_account.take().unwrap_or_default(); + f(&mut account, existed).map(move |result| { + let mut handle_dust: Option = None; + let total = account.total(); + *maybe_account = if total.is_zero() { + None + } else { + // if non_zero total is below existential deposit and the account is not a + // module account, should handle the dust. + match Token::::get(currency_id) { + Some(token_data) => { + if total < token_data.min_balance && !Self::is_module_account_id(who) { + handle_dust = Some(total); + } + Some(account) + }, + None => None, + } + }; + + (existed, maybe_account.is_some(), handle_dust, result) + }) + }) + .map(|(existed, exists, handle_dust, result)| { + if existed && !exists { + // If existed before, decrease account provider. + // Ignore the result, because if it failed means that these’s remain consumers, + // and the account storage in frame_system shouldn't be repeaded. + let _ = frame_system::Pallet::::dec_providers(who); + } else if !existed && exists { + // if new, increase account provider + frame_system::Pallet::::inc_providers(who); + } + + if let Some(dust_amount) = handle_dust { + // `OnDust` maybe get/set storage `Accounts` of `who`, trigger handler here + // to avoid some unexpected errors. + T::OnDust::on_dust(who, currency_id, dust_amount); + Self::deposit_event(Event::DustLost(who.clone(), currency_id, dust_amount)); + } + + result + }) + } + + pub(crate) fn mutate_account( + who: &T::AccountId, + currency_id: T::CurrencyId, + f: impl FnOnce(&mut AccountData, bool) -> R, + ) -> R { + Self::try_mutate_account(who, currency_id, |account, existed| -> Result { + Ok(f(account, existed)) + }) + .expect("Error is infallible; qed") + } + + /// Set free balance of `who` to a new value. + /// + /// Note this will not maintain total issuance, and the caller is + /// expected to do it. + pub(crate) fn set_free_balance(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + Self::mutate_account(who, currency_id, |account, _| { + account.free = amount; + }); + } + + /// Set reserved balance of `who` to a new value. + /// + /// Note this will not maintain total issuance, and the caller is + /// expected to do it. + pub(crate) fn set_reserved_balance(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + Self::mutate_account(who, currency_id, |account, _| { + account.reserved = amount; + }); + } + + /// Update the account entry for `who` under `currency_id`, given the + /// locks. + pub(crate) fn update_locks(currency_id: T::CurrencyId, who: &T::AccountId, locks: &[BalanceLock]) { + // update account data + Self::mutate_account(who, currency_id, |account, _| { + account.frozen = Zero::zero(); + for lock in locks.iter() { + account.frozen = account.frozen.max(lock.amount); + } + }); + + // update locks + let existed = >::contains_key(who, currency_id); + if locks.is_empty() { + >::remove(who, currency_id); + if existed { + // decrease account ref count when destruct lock + frame_system::Pallet::::dec_consumers(who); + } + } else { + >::insert(who, currency_id, locks); + if !existed { + // increase account ref count when initialize lock + if frame_system::Pallet::::inc_consumers(who).is_err() { + // No providers for the locks. This is impossible under normal circumstances + // since the funds that are under the lock will themselves be stored in the + // account and therefore will need a reference. + log::warn!( + "Warning: Attempt to introduce lock consumer reference, yet no providers. \ + This is unexpected but should be safe." + ); + } + } + } + } + + pub(crate) fn dead_account( + currency_id: T::CurrencyId, + who: &T::AccountId, + d: &mut TokenDetails, + ) { + frame_system::Pallet::::dec_consumers(who); + d.accounts = d.accounts.saturating_sub(1); + } +} + +impl MultiCurrency for Pallet { + type CurrencyId = T::CurrencyId; + type Balance = T::Balance; + + fn minimum_balance(currency_id: Self::CurrencyId) -> Self::Balance { + match Token::::get(currency_id) { + Some(token_data) => token_data.min_balance, + None => u32::max_value().into(), + } + } + + fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance { + >::get(currency_id) + } + + fn total_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).total() + } + + fn free_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).free + } + + // Ensure that an account can withdraw from their free balance given any + // existing withdrawal restrictions like locks and vesting balance. + // Is a no-op if amount to be withdrawn is zero. + fn ensure_can_withdraw(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + + let new_balance = Self::free_balance(currency_id, who) + .checked_sub(&amount) + .ok_or(Error::::BalanceLow)?; + ensure!( + new_balance >= Self::accounts(currency_id, who).frozen(), + Error::::LiquidityRestrictions + ); + Ok(()) + } + + /// Transfer some free balance from `from` to `to`. + /// Is a no-op if value to be transferred is zero or the `from` is the + /// same as `to`. + fn transfer( + currency_id: Self::CurrencyId, + from: &T::AccountId, + to: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() || from == to { + return Ok(()); + } + Self::ensure_can_withdraw(currency_id, from, amount)?; + + let from_balance = Self::free_balance(currency_id, from); + let to_balance = Self::free_balance(currency_id, to) + .checked_add(&amount) + .ok_or(Error::::BalanceOverflow)?; + // Cannot underflow because ensure_can_withdraw check + Self::set_free_balance(currency_id, from, from_balance - amount); + Self::set_free_balance(currency_id, to, to_balance); + + Ok(()) + } + + /// Deposit some `amount` into the free balance of account `who`. + /// + /// Is a no-op if the `amount` to be deposited is zero. + fn deposit(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + + TotalIssuance::::try_mutate(currency_id, |total_issuance| -> DispatchResult { + *total_issuance = total_issuance + .checked_add(&amount) + .ok_or(Error::::TotalIssuanceOverflow)?; + + Self::set_free_balance(currency_id, who, Self::free_balance(currency_id, who) + amount); + + Ok(()) + }) + } + + fn withdraw(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + Self::ensure_can_withdraw(currency_id, who, amount)?; + + // Cannot underflow because ensure_can_withdraw check + >::mutate(currency_id, |v| *v -= amount); + Self::set_free_balance(currency_id, who, Self::free_balance(currency_id, who) - amount); + + Ok(()) + } + + // Check if `value` amount of free balance can be slashed from `who`. + fn can_slash(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> bool { + if value.is_zero() { + return true; + } + Self::free_balance(currency_id, who) >= value + } + + /// Is a no-op if `value` to be slashed is zero. + /// + /// NOTE: `slash()` prefers free balance, but assumes that reserve + /// balance can be drawn from in extreme circumstances. `can_slash()` + /// should be used prior to `slash()` to avoid having to draw from + /// reserved funds, however we err on the side of punishment if things + /// are inconsistent or `can_slash` wasn't used appropriately. + fn slash(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> Self::Balance { + if amount.is_zero() { + return amount; + } + + let account = Self::accounts(currency_id, who); + let free_slashed_amount = account.free.min(amount); + // Cannot underflow becuase free_slashed_amount can never be greater than amount + let mut remaining_slash = amount - free_slashed_amount; + + // slash free balance + if !free_slashed_amount.is_zero() { + // Cannot underflow becuase free_slashed_amount can never be greater than + // account.free + Self::set_free_balance(currency_id, who, account.free - free_slashed_amount); + } + + // slash reserved balance + if !remaining_slash.is_zero() { + let reserved_slashed_amount = account.reserved.min(remaining_slash); + // Cannot underflow due to above line + remaining_slash -= reserved_slashed_amount; + Self::set_reserved_balance(currency_id, who, account.reserved - reserved_slashed_amount); + } + + // Cannot underflow because the slashed value cannot be greater than total + // issuance + >::mutate(currency_id, |v| *v -= amount - remaining_slash); + remaining_slash + } +} + +impl MultiCurrencyExtended for Pallet { + type Amount = T::Amount; + + fn update_balance(currency_id: Self::CurrencyId, who: &T::AccountId, by_amount: Self::Amount) -> DispatchResult { + if by_amount.is_zero() { + return Ok(()); + } + + // Ensure this doesn't overflow. There isn't any traits that exposes + // `saturating_abs` so we need to do it manually. + let by_amount_abs = if by_amount == Self::Amount::min_value() { + Self::Amount::max_value() + } else { + by_amount.abs() + }; + + let by_balance = + TryInto::::try_into(by_amount_abs).map_err(|_| Error::::AmountIntoBalanceFailed)?; + if by_amount.is_positive() { + Self::deposit(currency_id, who, by_balance) + } else { + Self::withdraw(currency_id, who, by_balance).map(|_| ()) + } + } +} + +impl MultiLockableCurrency for Pallet { + type Moment = T::BlockNumber; + + // Set a lock on the balance of `who` under `currency_id`. + // Is a no-op if lock amount is zero. + fn set_lock( + lock_id: LockIdentifier, + currency_id: Self::CurrencyId, + who: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + let mut new_lock = Some(BalanceLock { id: lock_id, amount }); + let mut locks = Self::locks(who, currency_id) + .into_iter() + .filter_map(|lock| { + if lock.id == lock_id { + new_lock.take() + } else { + Some(lock) + } + }) + .collect::>(); + if let Some(lock) = new_lock { + locks.push(lock) + } + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } + + // Extend a lock on the balance of `who` under `currency_id`. + // Is a no-op if lock amount is zero + fn extend_lock( + lock_id: LockIdentifier, + currency_id: Self::CurrencyId, + who: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + let mut new_lock = Some(BalanceLock { id: lock_id, amount }); + let mut locks = Self::locks(who, currency_id) + .into_iter() + .filter_map(|lock| { + if lock.id == lock_id { + new_lock.take().map(|nl| BalanceLock { + id: lock.id, + amount: lock.amount.max(nl.amount), + }) + } else { + Some(lock) + } + }) + .collect::>(); + if let Some(lock) = new_lock { + locks.push(lock) + } + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } + + fn remove_lock(lock_id: LockIdentifier, currency_id: Self::CurrencyId, who: &T::AccountId) -> DispatchResult { + let mut locks = Self::locks(who, currency_id); + locks.retain(|lock| lock.id != lock_id); + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } +} + +impl MultiReservableCurrency for Pallet { + /// Check if `who` can reserve `value` from their free balance. + /// + /// Always `true` if value to be reserved is zero. + fn can_reserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> bool { + if value.is_zero() { + return true; + } + Self::ensure_can_withdraw(currency_id, who, value).is_ok() + } + + /// Slash from reserved balance, returning any amount that was unable to + /// be slashed. + /// + /// Is a no-op if the value to be slashed is zero. + fn slash_reserved(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> Self::Balance { + if value.is_zero() { + return value; + } + + let reserved_balance = Self::reserved_balance(currency_id, who); + let actual = reserved_balance.min(value); + Self::set_reserved_balance(currency_id, who, reserved_balance - actual); + >::mutate(currency_id, |v| *v -= actual); + value - actual + } + + fn reserved_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).reserved + } + + /// Move `value` from the free balance from `who` to their reserved + /// balance. + /// + /// Is a no-op if value to be reserved is zero. + fn reserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> DispatchResult { + if value.is_zero() { + return Ok(()); + } + Self::ensure_can_withdraw(currency_id, who, value)?; + + let account = Self::accounts(currency_id, who); + Self::set_free_balance(currency_id, who, account.free - value); + // Cannot overflow becuase total issuance is using the same balance type and + // this doesn't increase total issuance + Self::set_reserved_balance(currency_id, who, account.reserved + value); + Ok(()) + } + + /// Unreserve some funds, returning any amount that was unable to be + /// unreserved. + /// + /// Is a no-op if the value to be unreserved is zero. + fn unreserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> Self::Balance { + if value.is_zero() { + return value; + } + + let account = Self::accounts(currency_id, who); + let actual = account.reserved.min(value); + Self::set_reserved_balance(currency_id, who, account.reserved - actual); + Self::set_free_balance(currency_id, who, account.free + actual); + + value - actual + } + + /// Move the reserved balance of one account into the balance of + /// another, according to `status`. + /// + /// Is a no-op if: + /// - the value to be moved is zero; or + /// - the `slashed` id equal to `beneficiary` and the `status` is + /// `Reserved`. + fn repatriate_reserved( + currency_id: Self::CurrencyId, + slashed: &T::AccountId, + beneficiary: &T::AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(value); + } + + if slashed == beneficiary { + return match status { + BalanceStatus::Free => Ok(Self::unreserve(currency_id, slashed, value)), + BalanceStatus::Reserved => Ok(value.saturating_sub(Self::reserved_balance(currency_id, slashed))), + }; + } + + let from_account = Self::accounts(currency_id, slashed); + let to_account = Self::accounts(currency_id, beneficiary); + let actual = from_account.reserved.min(value); + match status { + BalanceStatus::Free => { + Self::set_free_balance(currency_id, beneficiary, to_account.free + actual); + } + BalanceStatus::Reserved => { + Self::set_reserved_balance(currency_id, beneficiary, to_account.reserved + actual); + } + } + Self::set_reserved_balance(currency_id, slashed, from_account.reserved - actual); + Ok(value - actual) + } +} + +pub struct CurrencyAdapter(marker::PhantomData<(T, GetCurrencyId)>); + +impl PalletCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + type Balance = T::Balance; + type PositiveImbalance = PositiveImbalance; + type NegativeImbalance = NegativeImbalance; + + fn total_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::total_balance(GetCurrencyId::get(), who) + } + + fn can_slash(who: &T::AccountId, value: Self::Balance) -> bool { + Pallet::::can_slash(GetCurrencyId::get(), who, value) + } + + fn total_issuance() -> Self::Balance { + Pallet::::total_issuance(GetCurrencyId::get()) + } + + fn minimum_balance() -> Self::Balance { + Pallet::::minimum_balance(GetCurrencyId::get()) + } + + fn burn(mut amount: Self::Balance) -> Self::PositiveImbalance { + if amount.is_zero() { + return PositiveImbalance::zero(); + } + >::mutate(GetCurrencyId::get(), |issued| { + *issued = issued.checked_sub(&amount).unwrap_or_else(|| { + amount = *issued; + Zero::zero() + }); + }); + PositiveImbalance::new(amount) + } + + fn issue(mut amount: Self::Balance) -> Self::NegativeImbalance { + if amount.is_zero() { + return NegativeImbalance::zero(); + } + >::mutate(GetCurrencyId::get(), |issued| { + *issued = issued.checked_add(&amount).unwrap_or_else(|| { + amount = Self::Balance::max_value() - *issued; + Self::Balance::max_value() + }) + }); + NegativeImbalance::new(amount) + } + + fn free_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::free_balance(GetCurrencyId::get(), who) + } + + fn ensure_can_withdraw( + who: &T::AccountId, + amount: Self::Balance, + _reasons: WithdrawReasons, + _new_balance: Self::Balance, + ) -> DispatchResult { + Pallet::::ensure_can_withdraw(GetCurrencyId::get(), who, amount) + } + + fn transfer( + source: &T::AccountId, + dest: &T::AccountId, + value: Self::Balance, + _existence_requirement: ExistenceRequirement, + ) -> DispatchResult { + as MultiCurrency>::transfer(GetCurrencyId::get(), &source, &dest, value) + } + + fn slash(who: &T::AccountId, value: Self::Balance) -> (Self::NegativeImbalance, Self::Balance) { + if value.is_zero() { + return (Self::NegativeImbalance::zero(), value); + } + + let currency_id = GetCurrencyId::get(); + let account = Pallet::::accounts(currency_id, who); + let free_slashed_amount = account.free.min(value); + let mut remaining_slash = value - free_slashed_amount; + + // slash free balance + if !free_slashed_amount.is_zero() { + Pallet::::set_free_balance(currency_id, who, account.free - free_slashed_amount); + } + + // slash reserved balance + if !remaining_slash.is_zero() { + let reserved_slashed_amount = account.reserved.min(remaining_slash); + remaining_slash -= reserved_slashed_amount; + Pallet::::set_reserved_balance(currency_id, who, account.reserved - reserved_slashed_amount); + ( + Self::NegativeImbalance::new(free_slashed_amount + reserved_slashed_amount), + remaining_slash, + ) + } else { + (Self::NegativeImbalance::new(value), remaining_slash) + } + } + + fn deposit_into_existing( + who: &T::AccountId, + value: Self::Balance, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(Self::PositiveImbalance::zero()); + } + let currency_id = GetCurrencyId::get(); + let new_total = Pallet::::free_balance(currency_id, who) + .checked_add(&value) + .ok_or(Error::::TotalIssuanceOverflow)?; + Pallet::::set_free_balance(currency_id, who, new_total); + + Ok(Self::PositiveImbalance::new(value)) + } + + fn deposit_creating(who: &T::AccountId, value: Self::Balance) -> Self::PositiveImbalance { + Self::deposit_into_existing(who, value).unwrap_or_else(|_| Self::PositiveImbalance::zero()) + } + + fn withdraw( + who: &T::AccountId, + value: Self::Balance, + _reasons: WithdrawReasons, + _liveness: ExistenceRequirement, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(Self::NegativeImbalance::zero()); + } + let currency_id = GetCurrencyId::get(); + Pallet::::ensure_can_withdraw(currency_id, who, value)?; + Pallet::::set_free_balance(currency_id, who, Pallet::::free_balance(currency_id, who) - value); + + Ok(Self::NegativeImbalance::new(value)) + } + + fn make_free_balance_be( + who: &T::AccountId, + value: Self::Balance, + ) -> SignedImbalance { + let currency_id = GetCurrencyId::get(); + Pallet::::try_mutate_account( + who, + currency_id, + |account, existed| -> Result, ()> { + // If we're attempting to set an existing account to less than ED, then + // bypass the entire operation. It's a no-op if you follow it through, but + // since this is an instance where we might account for a negative imbalance + // (in the dust cleaner of set_account) before we account for its actual + // equal and opposite cause (returned as an Imbalance), then in the + // instance that there's no other accounts on the system at all, we might + // underflow the issuance and our arithmetic will be off. + match Token::::get(currency_id) { + Some(token_data) => { + let ed = token_data.min_balance; + ensure!(value.saturating_add(account.reserved) >= ed || existed, ()); + + let imbalance = if account.free <= value { + SignedImbalance::Positive(PositiveImbalance::new(value - account.free)) + } else { + SignedImbalance::Negative(NegativeImbalance::new(account.free - value)) + }; + account.free = value; + Ok(imbalance) + }, + None => { Err(()) }, + } + }, + ) + .unwrap_or_else(|_| SignedImbalance::Positive(Self::PositiveImbalance::zero())) + } +} + +impl PalletReservableCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + fn can_reserve(who: &T::AccountId, value: Self::Balance) -> bool { + Pallet::::can_reserve(GetCurrencyId::get(), who, value) + } + + fn slash_reserved(who: &T::AccountId, value: Self::Balance) -> (Self::NegativeImbalance, Self::Balance) { + let actual = Pallet::::slash_reserved(GetCurrencyId::get(), who, value); + (Self::NegativeImbalance::zero(), actual) + } + + fn reserved_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::reserved_balance(GetCurrencyId::get(), who) + } + + fn reserve(who: &T::AccountId, value: Self::Balance) -> DispatchResult { + Pallet::::reserve(GetCurrencyId::get(), who, value) + } + + fn unreserve(who: &T::AccountId, value: Self::Balance) -> Self::Balance { + Pallet::::unreserve(GetCurrencyId::get(), who, value) + } + + fn repatriate_reserved( + slashed: &T::AccountId, + beneficiary: &T::AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> sp_std::result::Result { + Pallet::::repatriate_reserved(GetCurrencyId::get(), slashed, beneficiary, value, status) + } +} + +impl PalletLockableCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + type Moment = T::BlockNumber; + type MaxLocks = (); + + fn set_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { + let _ = Pallet::::set_lock(id, GetCurrencyId::get(), who, amount); + } + + fn extend_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { + let _ = Pallet::::extend_lock(id, GetCurrencyId::get(), who, amount); + } + + fn remove_lock(id: LockIdentifier, who: &T::AccountId) { + let _ = Pallet::::remove_lock(id, GetCurrencyId::get(), who); + } +} + + +impl MergeAccount for Pallet { + #[transactional] + fn merge_account(source: &T::AccountId, dest: &T::AccountId) -> DispatchResult { + AccountCurrencies::::iter_prefix(source).try_for_each(|(currency_id, exists)| -> DispatchResult { + if exists { + let account_data = Accounts::::get(currency_id, source); + // ensure the account has no active reserved of non-native token + ensure!(account_data.reserved.is_zero(), Error::::StillHasActiveReserved); + + // transfer all free to recipient + >::transfer(currency_id, source, dest, account_data.free)?; + } + Ok(()) + }) + } +} + +impl ExtendedTokenSystem for Pallet { + fn mint(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) + -> Result<(), DispatchError> { + Self::deposit(currency_id, &account_id, amount) + } + fn burn(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) + -> Result<(), DispatchError> { + Self::withdraw(currency_id, &account_id, amount) + } +} \ No newline at end of file diff --git a/pallets/webb-tokens/src/mock.rs b/pallets/tokens/src/mock.rs similarity index 73% rename from pallets/webb-tokens/src/mock.rs rename to pallets/tokens/src/mock.rs index 4f6b9dd4..9a0d2733 100644 --- a/pallets/webb-tokens/src/mock.rs +++ b/pallets/tokens/src/mock.rs @@ -1,18 +1,16 @@ use super::*; -use crate as pallet_webb_tokens; +use crate as tokens; use frame_benchmarking::whitelisted_caller; -use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; +use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; -use merkle::weights::Weights as MerkleWeights; use orml_currencies::BasicCurrencyAdapter; -use orml_traits::parameter_type_with_key; + use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - ModuleId, Perbill, + Perbill, }; -use weights::Weights; pub(crate) type Balance = u64; pub type Amount = i128; @@ -30,12 +28,10 @@ construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - MerkleTrees: merkle::{Module, Call, Storage, Event}, - WebbTokens: pallet_webb_tokens::{Module, Call, Storage, Event}, - Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: orml_tokens::{Module, Storage, Event, Config}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: balances::{Pallet, Call, Storage, Config, Event}, + Tokens: tokens::{Pallet, Call, Storage, Event}, + Currencies: orml_currencies::{Pallet, Storage, Event}, } ); @@ -69,6 +65,7 @@ impl frame_system::Config for Test { type PalletInfo = PalletInfo; type SS58Prefix = Prefix; type SystemWeightInfo = (); + type OnSetCode = (); type Version = (); } @@ -91,37 +88,20 @@ impl balances::Config for Test { type WeightInfo = (); } -parameter_type_with_key! { - pub ExistentialDepositMap: |k: CurrencyId| -> Balance { - match k { - _ => 2, - } - }; -} - parameter_types! { pub const NativeCurrencyId: CurrencyId = 0; } -impl orml_tokens::Config for Test { - type Amount = Amount; - type Balance = Balance; - type CurrencyId = CurrencyId; - type Event = Event; - type ExistentialDeposits = ExistentialDepositMap; - type OnDust = (); - type WeightInfo = (); -} - impl orml_currencies::Config for Test { type Event = Event; type GetNativeCurrencyId = NativeCurrencyId; - type MultiCurrency = Tokens; + type MultiCurrency = TokenModule; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } parameter_types! { + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); pub const CurrencyDeposit: u64 = 1; pub const ApprovalDeposit: u64 = 1; pub const StringLimit: u32 = 50; @@ -130,24 +110,27 @@ parameter_types! { } impl Config for Test { + type PalletId = TokensPalletId; type Event = Event; type Balance = Balance; - type AssetId = CurrencyId; - type Currency = Currencies; + type Amount = i128; + type CurrencyId = CurrencyId; type ForceOrigin = frame_system::EnsureRoot; type CurrencyDeposit = CurrencyDeposit; type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; + type OnDust = (); type WeightInfo = (); type Extra = (); } +type TokenModule = Pallet; + // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { use balances::GenesisConfig as BalancesConfig; - use orml_tokens::GenesisConfig as TokensConfig; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); BalancesConfig:: { @@ -162,12 +145,5 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .assimilate_storage(&mut t) .unwrap(); - let token_currency_id: CurrencyId = 1; - TokensConfig:: { - endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], - } - .assimilate_storage(&mut t) - .unwrap(); - t.into() } diff --git a/pallets/webb-tokens/src/tests.rs b/pallets/tokens/src/tests.rs similarity index 100% rename from pallets/webb-tokens/src/tests.rs rename to pallets/tokens/src/tests.rs diff --git a/pallets/tokens/src/traits.rs b/pallets/tokens/src/traits.rs new file mode 100644 index 00000000..b0927903 --- /dev/null +++ b/pallets/tokens/src/traits.rs @@ -0,0 +1,8 @@ +use frame_support::dispatch; + +pub trait ExtendedTokenSystem { + fn mint(currency_id: CurrencyId, account_id: AccountId, amount: Balance) + -> Result<(), dispatch::DispatchError>; + fn burn(currency_id: CurrencyId, account_id: AccountId, amount: Balance) + -> Result<(), dispatch::DispatchError>; +} diff --git a/pallets/webb-tokens/src/types.rs b/pallets/tokens/src/types.rs similarity index 60% rename from pallets/webb-tokens/src/types.rs rename to pallets/tokens/src/types.rs index 00b6c240..44bafc84 100644 --- a/pallets/webb-tokens/src/types.rs +++ b/pallets/tokens/src/types.rs @@ -1,12 +1,9 @@ use super::*; -pub(super) type DepositBalanceOf = <::Currency as Currency<::AccountId>>::Balance; - #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] -pub struct CurrencyDetails< +pub struct TokenDetails< Balance, AccountId, - DepositBalance, > { /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. pub(super) owner: AccountId, @@ -19,7 +16,7 @@ pub struct CurrencyDetails< /// The total supply across all accounts. pub(super) supply: Balance, /// The balance deposited for this currency. This pays for the data stored here. - pub(super) deposit: DepositBalance, + pub(super) deposit: Balance, /// The ED for virtual accounts. pub(super) min_balance: Balance, /// If `true`, then any account with this currency is given a provider reference. Otherwise, it @@ -46,20 +43,20 @@ pub struct ApprovalKey { /// Data concerning an approval. #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] -pub struct Approval { +pub struct Approval { /// The amount of funds approved for the balance transfer from the owner to some delegated /// target. pub(super) amount: Balance, /// The amount reserved on the owner's account to hold this item in storage. - pub(super) deposit: DepositBalance, + pub(super) deposit: Balance, } #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] -pub struct CurrencyMetadata { +pub struct TokenMetadata { /// The balance deposited for this metadata. /// /// This pays for the data stored in this struct. - pub(super) deposit: DepositBalance, + pub(super) deposit: Balance, /// The user friendly name of this asset. Limited in length by `StringLimit`. pub(super) name: Vec, /// The ticker symbol for this asset. Limited in length by `StringLimit`. @@ -84,36 +81,49 @@ pub struct DestroyWitness { pub(super) approvals: u32, } -#[derive(Copy, Clone, PartialEq, Eq)] -pub(super) struct TransferFlags { - /// The debited account must stay alive at the end of the operation; an error is returned if - /// this cannot be achieved legally. - pub(super) keep_alive: bool, - /// Less than the amount specified needs be debited by the operation for it to be considered - /// successful. If `false`, then the amount debited will always be at least the amount - /// specified. - pub(super) best_effort: bool, - /// Any additional funds debited (due to minimum balance requirements) should be burned rather - /// than credited to the destination account. - pub(super) burn_dust: bool, +/// A single lock on a balance. There can be many of these on an account and +/// they "overlap", so the same balance is frozen by multiple locks. +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] +pub struct BalanceLock { + /// An identifier for this lock. Only one lock may be in existence for + /// each identifier. + pub id: LockIdentifier, + /// The amount which the free balance may not drop below when this lock + /// is in effect. + pub amount: Balance, } -#[derive(Copy, Clone, PartialEq, Eq)] -pub(super) struct DebitFlags { - /// The debited account must stay alive at the end of the operation; an error is returned if - /// this cannot be achieved legally. - pub(super) keep_alive: bool, - /// Less than the amount specified needs be debited by the operation for it to be considered - /// successful. If `false`, then the amount debited will always be at least the amount - /// specified. - pub(super) best_effort: bool, +/// balance information for an account. +#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, RuntimeDebug)] +pub struct AccountData { + /// Non-reserved part of the balance. There may still be restrictions on + /// this, but it is the total pool what may in principle be transferred, + /// reserved. + /// + /// This is the only balance that matters in terms of most operations on + /// tokens. + pub free: Balance, + /// Balance which is reserved and may not be used at all. + /// + /// This can still get slashed, but gets slashed last of all. + /// + /// This balance is a 'reserve' balance that other subsystems use in + /// order to set aside tokens that are still 'owned' by the account + /// holder, but which are suspendable. + pub reserved: Balance, + /// The amount that `free` may not drop below when withdrawing. + pub frozen: Balance, } -impl From for DebitFlags { - fn from(f: TransferFlags) -> Self { - Self { - keep_alive: f.keep_alive, - best_effort: f.best_effort, - } +impl AccountData { + /// The amount that this account's free balance may not be reduced + /// beyond. + pub(crate) fn frozen(&self) -> Balance { + self.frozen } -} + /// The total balance in this account including any that is reserved and + /// ignoring any frozen. + pub fn total(&self) -> Balance { + self.free.saturating_add(self.reserved) + } +} \ No newline at end of file diff --git a/pallets/webb-tokens/src/weights.rs b/pallets/tokens/src/weights.rs similarity index 100% rename from pallets/webb-tokens/src/weights.rs rename to pallets/tokens/src/weights.rs diff --git a/pallets/webb-tokens/src/lib.rs b/pallets/webb-tokens/src/lib.rs deleted file mode 100644 index 84d2226c..00000000 --- a/pallets/webb-tokens/src/lib.rs +++ /dev/null @@ -1,897 +0,0 @@ -// A runtime module Groups with necessary imports - -// Feel free to remove or edit this file as needed. -// If you change the name of this file, make sure to update its references in -// runtime/src/lib.rs If you remove this file, you can remove those references - -// For more guidance on Substrate modules, see the example module -// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs - -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod traits; -// pub mod weights; -// #[cfg(feature = "runtime-benchmarks")] -// mod benchmarking; -#[cfg(test)] -pub mod mock; -#[cfg(test)] -mod tests; - -// mod extra_mutator; -// pub use extra_mutator::*; -// mod impl_stored_map; -// mod impl_fungibles; -// mod functions; -mod types; -pub use types::*; - -use sp_std::{prelude::*, borrow::Borrow}; -use sp_runtime::{ - RuntimeDebug, TokenError, traits::{ - AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, Bounded, - StoredMapError, - } -}; -use codec::{Encode, Decode, HasCompact}; -use frame_support::{ensure, dispatch::{DispatchError, DispatchResult}}; -use frame_support::traits::{Currency, ReservableCurrency, BalanceStatus::Reserved, StoredMap}; -use frame_support::traits::tokens::{WithdrawConsequence, DepositConsequence, fungibles}; -use frame_system::Config as SystemConfig; -use orml_traits::MultiCurrency; - -/// Type alias for the orml_traits::MultiCurrency::Balance type -pub type BalanceOf = <::Currency as MultiCurrency<::AccountId>>::Balance; -/// Type alias for the orml_traits::MultiCurrency::CurrencyId type -pub type CurrencyIdOf = - <::Currency as MultiCurrency<::AccountId>>::CurrencyId; - -pub use sp_std::convert::TryInto; - -// pub use weights::WeightInfo; -pub use pallet::*; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - use sp_runtime::DispatchResultWithInfo; - - - #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - pub struct Pallet(_); - - #[pallet::config] - /// The module configuration trait. - pub trait Config: frame_system::Config + orml_currencies::Config { - /// The overarching event type. - type Event: From> + IsType<::Event>; - - /// The balance type - type Balance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize; - - /// The amount type, should be signed version of `Balance` - type Amount: Signed - + TryInto - + TryFrom - + Parameter - + Member - + arithmetic::SimpleArithmetic - + Default - + Copy - + MaybeSerializeDeserialize; - - /// The currency ID type - type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize + Ord; - - /// The currency mechanism. - type Currency: MultiCurrency; - - /// The origin which may forcibly create or destroy an asset or otherwise alter privileged - /// attributes. - type ForceOrigin: EnsureOrigin; - - /// The basic amount of funds that must be reserved for an asset. - type CurrencyDeposit: Get>; - - /// The basic amount of funds that must be reserved when adding metadata to your asset. - type MetadataDepositBase: Get>; - - /// The additional funds that must be reserved for the number of bytes you store in your - /// metadata. - type MetadataDepositPerByte: Get>; - - /// The amount of funds that must be reserved when creating a new approval. - type ApprovalDeposit: Get>; - - /// The maximum length of a name or symbol stored on-chain. - type StringLimit: Get; - - /// Additional data to be stored with an account's asset balance. - type Extra: Member + Parameter + Default; - - /// Weight information for extrinsics in this pallet. - type WeightInfo: WeightInfo; - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - #[pallet::metadata(T::AccountId = "AccountId", T::Balance = "Balance", T::CurrencyId = "CurrencyId")] - pub enum Event { - /// Some asset class was created. \[asset_id, creator, owner\] - Created(T::CurrencyId, T::AccountId, T::AccountId), - /// Some assets were issued. \[asset_id, owner, total_supply\] - Issued(T::CurrencyId, T::AccountId, T::Balance), - /// Some assets were destroyed. \[asset_id, owner, balance\] - Burned(T::CurrencyId, T::AccountId, T::Balance), - /// The management team changed \[asset_id, issuer, admin, freezer\] - TeamChanged(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId), - /// The owner changed \[asset_id, owner\] - OwnerChanged(T::CurrencyId, T::AccountId), - /// An asset class was destroyed. - Destroyed(T::CurrencyId), - /// Some asset class was force-created. \[asset_id, owner\] - ForceCreated(T::CurrencyId, T::AccountId), - /// New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] - MetadataSet(T::CurrencyId, Vec, Vec, u8, bool), - /// Metadata has been cleared for an asset. \[asset_id\] - MetadataCleared(T::CurrencyId), - /// (Additional) funds have been approved for transfer to a destination account. - /// \[asset_id, source, delegate, amount\] - ApprovedTransfer(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), - /// An approval for account `delegate` was cancelled by `owner`. - /// \[id, owner, delegate\] - ApprovalCancelled(T::CurrencyId, T::AccountId, T::AccountId), - /// An `amount` was transferred in its entirety from `owner` to `destination` by - /// the approved `delegate`. - /// \[id, owner, delegate, destination\] - TransferredApproved(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId, T::Balance), - /// An asset has had its attributes changed by the `Force` origin. - /// \[id\] - CurrencyStatusChanged(T::CurrencyId), - } - - #[pallet::error] - pub enum Error { - /// Account balance must be greater than or equal to the transfer amount. - BalanceLow, - /// Balance should be non-zero. - BalanceZero, - /// The signing account has no permission to do the operation. - NoPermission, - /// The given currency ID is unknown. - Unknown, - /// The origin account is frozen. - Frozen, - /// The currency ID is already taken. - InUse, - /// Invalid witness data given. - BadWitness, - /// Minimum balance should be non-zero. - MinBalanceZero, - /// A mint operation lead to an overflow. - Overflow, - /// No provider reference exists to allow a non-zero balance of a non-self-sufficient currency. - NoProvider, - /// Invalid metadata given. - BadMetadata, - /// No approval exists that would allow the transfer. - Unapproved, - /// The source account would not survive the transfer and it needs to stay alive. - WouldDie, - } - - #[pallet::storage] - /// Details of an asset. - pub(super) type Currency = StorageMap< - _, - Blake2_128Concat, - T::CurrencyId, - CurrencyDetails>, - >; - - #[pallet::storage] - /// Approved balance transfers. First balance is the amount approved for transfer. Second - /// is the amount of `T::Currency` reserved for storing this. - pub(super) type Approvals = StorageDoubleMap< - _, - Blake2_128Concat, - T::CurrencyId, - Blake2_128Concat, - ApprovalKey, - Approval>, - OptionQuery, - >; - - #[pallet::storage] - /// Metadata of an currency. - pub(super) type Metadata = StorageMap< - _, - Blake2_128Concat, - T::CurrencyId, - CurrencyMetadata>, - ValueQuery, - >; - - #[pallet::hooks] - impl Hooks> for Pallet {} - - #[pallet::call] - impl Pallet { - /// Issue a new class of fungible assets from a public origin. - /// - /// This new asset class has no assets initially and its owner is the origin. - /// - /// The origin must be Signed and the sender must have sufficient funds free. - /// - /// Funds of sender are reserved by `CurrencyDeposit`. - /// - /// Parameters: - /// - `id`: The identifier of the new asset. This must not be currently in use to identify - /// an existing asset. - /// - `admin`: The admin of this class of assets. The admin is the initial address of each - /// member of the asset class's admin team. - /// - `min_balance`: The minimum balance of this new asset that any single account must - /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - /// Emits `Created` event when successful. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn create( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - admin: ::Source, - min_balance: T::Balance, - ) -> DispatchResultWithPostInfo { - let owner = ensure_signed(origin)?; - let admin = T::Lookup::lookup(admin)?; - - ensure!(!Currency::::contains_key(id), Error::::InUse); - ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); - - let deposit = T::CurrencyDeposit::get(); - T::Currency::reserve(&owner, deposit)?; - - Currency::::insert(id, CurrencyDetails { - owner: owner.clone(), - issuer: admin.clone(), - admin: admin.clone(), - freezer: admin.clone(), - supply: Zero::zero(), - deposit, - min_balance, - is_sufficient: false, - accounts: 0, - sufficients: 0, - approvals: 0, - is_frozen: false, - }); - Self::deposit_event(Event::Created(id, owner, admin)); - Ok(()) - } - - /// Issue a new class of fungible assets from a privileged origin. - /// - /// This new asset class has no assets initially. - /// - /// The origin must conform to `ForceOrigin`. - /// - /// Unlike `create`, no funds are reserved. - /// - /// - `id`: The identifier of the new asset. This must not be currently in use to identify - /// an existing asset. - /// - `owner`: The owner of this class of assets. The owner has full superuser permissions - /// over this asset, but may later change and configure the permissions using `transfer_ownership` - /// and `set_team`. - /// - `max_zombies`: The total number of accounts which may hold assets in this class yet - /// have no existential deposit. - /// - `min_balance`: The minimum balance of this new asset that any single account must - /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - /// Emits `ForceCreated` event when successful. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn force_create( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - owner: ::Source, - is_sufficient: bool, - #[pallet::compact] min_balance: T::Balance, - ) -> DispatchResultWithPostInfo { - T::ForceOrigin::ensure_origin(origin)?; - let owner = T::Lookup::lookup(owner)?; - - ensure!(!Currency::::contains_key(id), Error::::InUse); - ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); - - Currency::::insert(id, CurrencyDetails { - owner: owner.clone(), - issuer: owner.clone(), - admin: owner.clone(), - freezer: owner.clone(), - supply: Zero::zero(), - deposit: Zero::zero(), - min_balance, - is_sufficient, - accounts: 0, - sufficients: 0, - approvals: 0, - is_frozen: false, - }); - Self::deposit_event(Event::ForceCreated(id, owner)); - Ok(()) - } - - /// Destroy a class of fungible assets. - /// - /// The origin must conform to `ForceOrigin` or must be Signed and the sender must be the - /// owner of the asset `id`. - /// - /// - `id`: The identifier of the asset to be destroyed. This must identify an existing - /// asset. - /// - /// Emits `Destroyed` event when successful. - /// - /// Weight: `O(c + p + a)` where: - /// - `c = (witness.accounts - witness.sufficients)` - /// - `s = witness.sufficients` - /// - `a = witness.approvals` - #[pallet::weight(5_000_000)] - pub(super) fn destroy( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - witness: DestroyWitness, - ) -> DispatchResultWithPostInfo { - let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { - Ok(_) => None, - Err(origin) => Some(ensure_signed(origin)?), - }; - Currency::::try_mutate_exists(id, |maybe_details| { - let mut details = maybe_details.take().ok_or(Error::::Unknown)?; - if let Some(check_owner) = maybe_check_owner { - ensure!(details.owner == check_owner, Error::::NoPermission); - } - ensure!(details.accounts == witness.accounts, Error::::BadWitness); - ensure!(details.sufficients == witness.sufficients, Error::::BadWitness); - ensure!(details.approvals == witness.approvals, Error::::BadWitness); - - for (who, v) in Account::::drain_prefix(id) { - Self::dead_account(id, &who, &mut details, v.sufficient); - } - debug_assert_eq!(details.accounts, 0); - debug_assert_eq!(details.sufficients, 0); - - let metadata = Metadata::::take(&id); - T::Currency::unreserve(&details.owner, details.deposit.saturating_add(metadata.deposit)); - - Approvals::::remove_prefix(&id); - Self::deposit_event(Event::Destroyed(id)); - - // NOTE: could use postinfo to reflect the actual number of accounts/sufficient/approvals - Ok(()) - }) - } - - /// Mint assets of a particular class. - /// - /// The origin must be Signed and the sender must be the Issuer of the asset `id`. - /// - /// - `id`: The identifier of the asset to have some amount minted. - /// - `beneficiary`: The account to be credited with the minted assets. - /// - `amount`: The amount of the asset to be minted. - /// - /// Emits `Destroyed` event when successful. - /// - /// Weight: `O(1)` - /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. - #[pallet::weight(5_000_000)] - pub(super) fn mint( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - beneficiary: ::Source, - #[pallet::compact] amount: T::Balance - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - let beneficiary = T::Lookup::lookup(beneficiary)?; - Self::do_mint(id, &beneficiary, amount, Some(origin))?; - Self::deposit_event(Event::Issued(id, beneficiary, amount)); - Ok(()) - } - - /// Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. - /// - /// Origin must be Signed and the sender should be the Manager of the asset `id`. - /// - /// Bails with `BalanceZero` if the `who` is already dead. - /// - /// - `id`: The identifier of the asset to have some amount burned. - /// - `who`: The account to be debited from. - /// - `amount`: The maximum amount by which `who`'s balance should be reduced. - /// - /// Emits `Burned` with the actual amount burned. If this takes the balance to below the - /// minimum for the asset, then the amount burned is increased to take it to zero. - /// - /// Weight: `O(1)` - /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. - #[pallet::weight(5_000_000)] - pub(super) fn burn( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - who: ::Source, - #[pallet::compact] amount: T::Balance - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - let who = T::Lookup::lookup(who)?; - - let f = DebitFlags { keep_alive: false, best_effort: true }; - let burned = Self::do_burn(id, &who, amount, Some(origin), f)?; - Self::deposit_event(Event::Burned(id, who, burned)); - Ok(()) - } - - /// Change the Owner of an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// - `id`: The identifier of the asset. - /// - `owner`: The new Owner of this asset. - /// - /// Emits `OwnerChanged`. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn transfer_ownership( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - owner: ::Source, - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - let owner = T::Lookup::lookup(owner)?; - - Currency::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - ensure!(&origin == &details.owner, Error::::NoPermission); - if details.owner == owner { return Ok(()) } - - let metadata_deposit = Metadata::::get(id).deposit; - let deposit = details.deposit + metadata_deposit; - - // Move the deposit to the new owner. - T::Currency::repatriate_reserved(&details.owner, &owner, deposit, Reserved)?; - - details.owner = owner.clone(); - - Self::deposit_event(Event::OwnerChanged(id, owner)); - Ok(()) - }) - } - - /// Change the Issuer, Admin and Freezer of an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// - `id`: The identifier of the asset to be frozen. - /// - `issuer`: The new Issuer of this asset. - /// - `admin`: The new Admin of this asset. - /// - `freezer`: The new Freezer of this asset. - /// - /// Emits `TeamChanged`. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn set_team( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - issuer: ::Source, - admin: ::Source, - freezer: ::Source, - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - let issuer = T::Lookup::lookup(issuer)?; - let admin = T::Lookup::lookup(admin)?; - let freezer = T::Lookup::lookup(freezer)?; - - Currency::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - ensure!(&origin == &details.owner, Error::::NoPermission); - - details.issuer = issuer.clone(); - details.admin = admin.clone(); - details.freezer = freezer.clone(); - - Self::deposit_event(Event::TeamChanged(id, issuer, admin, freezer)); - Ok(()) - }) - } - - /// Set the metadata for an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// Funds of sender are reserved according to the formula: - /// `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into - /// account any already reserved funds. - /// - /// - `id`: The identifier of the asset to update. - /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. - /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. - /// - `decimals`: The number of decimals this asset uses to represent one unit. - /// - /// Emits `MetadataSet`. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn set_metadata( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - name: Vec, - symbol: Vec, - decimals: u8, - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - - ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); - ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); - - let d = Currency::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &d.owner, Error::::NoPermission); - - Metadata::::try_mutate_exists(id, |metadata| { - ensure!(metadata.as_ref().map_or(true, |m| !m.is_frozen), Error::::NoPermission); - - let old_deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); - let new_deposit = T::MetadataDepositPerByte::get() - .saturating_mul(((name.len() + symbol.len()) as u32).into()) - .saturating_add(T::MetadataDepositBase::get()); - - if new_deposit > old_deposit { - T::Currency::reserve(&origin, new_deposit - old_deposit)?; - } else { - T::Currency::unreserve(&origin, old_deposit - new_deposit); - } - - *metadata = Some(CurrencyMetadata { - deposit: new_deposit, - name: name.clone(), - symbol: symbol.clone(), - decimals, - is_frozen: false, - }); - - Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, false)); - Ok(()) - }) - } - - /// Clear the metadata for an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// Any deposit is freed for the asset owner. - /// - /// - `id`: The identifier of the asset to clear. - /// - /// Emits `MetadataCleared`. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn clear_metadata( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - ) -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - - let d = Currency::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &d.owner, Error::::NoPermission); - - Metadata::::try_mutate_exists(id, |metadata| { - let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; - T::Currency::unreserve(&d.owner, deposit); - Self::deposit_event(Event::MetadataCleared(id)); - Ok(()) - }) - } - - /// Force the metadata for an asset to some value. - /// - /// Origin must be ForceOrigin. - /// - /// Any deposit is left alone. - /// - /// - `id`: The identifier of the asset to update. - /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. - /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. - /// - `decimals`: The number of decimals this asset uses to represent one unit. - /// - /// Emits `MetadataSet`. - /// - /// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively. - #[pallet::weight(5_000_000)] - pub(super) fn force_set_metadata( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - name: Vec, - symbol: Vec, - decimals: u8, - is_frozen: bool, - ) -> DispatchResultWithPostInfo { - T::ForceOrigin::ensure_origin(origin)?; - - ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); - ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); - - ensure!(Currency::::contains_key(id), Error::::Unknown); - Metadata::::try_mutate_exists(id, |metadata| { - let deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); - *metadata = Some(CurrencyMetadata { - deposit, - name: name.clone(), - symbol: symbol.clone(), - decimals, - is_frozen, - }); - - Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, is_frozen)); - Ok(()) - }) - } - - /// Clear the metadata for an asset. - /// - /// Origin must be ForceOrigin. - /// - /// Any deposit is returned. - /// - /// - `id`: The identifier of the asset to clear. - /// - /// Emits `MetadataCleared`. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn force_clear_metadata( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - ) -> DispatchResultWithPostInfo { - T::ForceOrigin::ensure_origin(origin)?; - - let d = Currency::::get(id).ok_or(Error::::Unknown)?; - Metadata::::try_mutate_exists(id, |metadata| { - let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; - T::Currency::unreserve(&d.owner, deposit); - Self::deposit_event(Event::MetadataCleared(id)); - Ok(()) - }) - } - - /// Alter the attributes of a given asset. - /// - /// Origin must be `ForceOrigin`. - /// - /// - `id`: The identifier of the asset. - /// - `owner`: The new Owner of this asset. - /// - `issuer`: The new Issuer of this asset. - /// - `admin`: The new Admin of this asset. - /// - `freezer`: The new Freezer of this asset. - /// - `min_balance`: The minimum balance of this new asset that any single account must - /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient - /// value to account for the state bloat associated with its balance storage. If set to - /// `true`, then non-zero balances may be stored without a `consumer` reference (and thus - /// an ED in the Balances pallet or whatever else is used to control user-account state - /// growth). - /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin - /// instructions. - /// - /// Emits `CurrencyStatusChanged` with the identity of the asset. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn force_asset_status( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - owner: ::Source, - issuer: ::Source, - admin: ::Source, - freezer: ::Source, - #[pallet::compact] min_balance: T::Balance, - is_sufficient: bool, - is_frozen: bool, - ) -> DispatchResultWithPostInfo { - T::ForceOrigin::ensure_origin(origin)?; - - Currency::::try_mutate(id, |maybe_asset| { - let mut asset = maybe_asset.take().ok_or(Error::::Unknown)?; - asset.owner = T::Lookup::lookup(owner)?; - asset.issuer = T::Lookup::lookup(issuer)?; - asset.admin = T::Lookup::lookup(admin)?; - asset.freezer = T::Lookup::lookup(freezer)?; - asset.min_balance = min_balance; - asset.is_sufficient = is_sufficient; - asset.is_frozen = is_frozen; - *maybe_asset = Some(asset); - - Self::deposit_event(Event::CurrencyStatusChanged(id)); - Ok(()) - }) - } - - /// Approve an amount of asset for transfer by a delegated third-party account. - /// - /// Origin must be Signed. - /// - /// Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account - /// for the purpose of holding the approval. If some non-zero amount of assets is already - /// approved from signing account to `delegate`, then it is topped up or unreserved to - /// meet the right value. - /// - /// NOTE: The signing account does not need to own `amount` of assets at the point of - /// making this call. - /// - /// - `id`: The identifier of the asset. - /// - `delegate`: The account to delegate permission to transfer asset. - /// - `amount`: The amount of asset that may be transferred by `delegate`. If there is - /// already an approval in place, then this acts additively. - /// - /// Emits `ApprovedTransfer` on success. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn approve_transfer( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - delegate: ::Source, - #[pallet::compact] amount: T::Balance, - ) -> DispatchResultWithPostInfo { - let owner = ensure_signed(origin)?; - let delegate = T::Lookup::lookup(delegate)?; - - let key = ApprovalKey { owner, delegate }; - Approvals::::try_mutate(id, &key, |maybe_approved| -> DispatchResultWithPostInfo { - let mut approved = maybe_approved.take().unwrap_or_default(); - let deposit_required = T::ApprovalDeposit::get(); - if approved.deposit < deposit_required { - T::Currency::reserve(&key.owner, deposit_required - approved.deposit)?; - approved.deposit = deposit_required; - } - approved.amount = approved.amount.saturating_add(amount); - *maybe_approved = Some(approved); - Ok(()) - })?; - Self::deposit_event(Event::ApprovedTransfer(id, key.owner, key.delegate, amount)); - - Ok(()) - } - - /// Cancel all of some asset approved for delegated transfer by a third-party account. - /// - /// Origin must be Signed and there must be an approval in place between signer and - /// `delegate`. - /// - /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. - /// - /// - `id`: The identifier of the asset. - /// - `delegate`: The account delegated permission to transfer asset. - /// - /// Emits `ApprovalCancelled` on success. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn cancel_approval( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - delegate: ::Source, - ) -> DispatchResultWithPostInfo { - let owner = ensure_signed(origin)?; - let delegate = T::Lookup::lookup(delegate)?; - let key = ApprovalKey { owner, delegate }; - let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; - T::Currency::unreserve(&key.owner, approval.deposit); - - Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); - Ok(()) - } - - /// Cancel all of some asset approved for delegated transfer by a third-party account. - /// - /// Origin must be either ForceOrigin or Signed origin with the signer being the Admin - /// account of the asset `id`. - /// - /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. - /// - /// - `id`: The identifier of the asset. - /// - `delegate`: The account delegated permission to transfer asset. - /// - /// Emits `ApprovalCancelled` on success. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn force_cancel_approval( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - owner: ::Source, - delegate: ::Source, - ) -> DispatchResultWithPostInfo { - T::ForceOrigin::try_origin(origin) - .map(|_| ()) - .or_else(|origin| -> DispatchResultWithPostInfo { - let origin = ensure_signed(origin)?; - let d = Currency::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &d.admin, Error::::NoPermission); - Ok(()) - })?; - - let owner = T::Lookup::lookup(owner)?; - let delegate = T::Lookup::lookup(delegate)?; - - let key = ApprovalKey { owner, delegate }; - let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; - T::Currency::unreserve(&key.owner, approval.deposit); - - Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); - Ok(()) - } - - /// Transfer some asset balance from a previously delegated account to some third-party - /// account. - /// - /// Origin must be Signed and there must be an approval in place by the `owner` to the - /// signer. - /// - /// If the entire amount approved for transfer is transferred, then any deposit previously - /// reserved by `approve_transfer` is unreserved. - /// - /// - `id`: The identifier of the asset. - /// - `owner`: The account which previously approved for a transfer of at least `amount` and - /// from which the asset balance will be withdrawn. - /// - `destination`: The account to which the asset balance of `amount` will be transferred. - /// - `amount`: The amount of assets to transfer. - /// - /// Emits `TransferredApproved` on success. - /// - /// Weight: `O(1)` - #[pallet::weight(5_000_000)] - pub(super) fn transfer_approved( - origin: OriginFor, - #[pallet::compact] id: T::CurrencyId, - owner: ::Source, - destination: ::Source, - #[pallet::compact] amount: T::Balance, - ) -> DispatchResultWithPostInfo { - let delegate = ensure_signed(origin)?; - let owner = T::Lookup::lookup(owner)?; - let destination = T::Lookup::lookup(destination)?; - - let key = ApprovalKey { owner, delegate }; - Approvals::::try_mutate_exists(id, &key, |maybe_approved| -> DispatchResultWithPostInfo { - let mut approved = maybe_approved.take().ok_or(Error::::Unapproved)?; - let remaining = approved.amount.checked_sub(&amount).ok_or(Error::::Unapproved)?; - - let f = TransferFlags { - keep_alive: false, - best_effort: false, - burn_dust: false - }; - Self::do_transfer(id, &key.owner, &destination, amount, None, f)?; - - if remaining.is_zero() { - T::Currency::unreserve(&key.owner, approved.deposit); - } else { - approved.amount = remaining; - *maybe_approved = Some(approved); - } - Ok(()) - })?; - Ok(()) - } - } -} - -impl Pallet { - pub fn account_id() -> T::AccountId { - T::ModuleId::get().into_account() - } -} diff --git a/pallets/webb-tokens/src/traits.rs b/pallets/webb-tokens/src/traits.rs deleted file mode 100644 index 95cd6a0e..00000000 --- a/pallets/webb-tokens/src/traits.rs +++ /dev/null @@ -1,6 +0,0 @@ -use frame_support::dispatch; - -pub trait ExtendedTokenSystem { - fn issue(account_id: AccountId, currency_id: CurrencyId, size: Balance) - -> Result<(), dispatch::DispatchError>; -} diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 144bad77..f820604f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -27,6 +27,7 @@ static_assertions = "1.1.0" merkle = { package = "pallet-merkle", version = "3.0.0", default-features = false, path = "../pallets/merkle" } mixer = { package = "pallet-mixer", version = "3.0.0", default-features = false, path = "../pallets/mixer" } +tokens = { package = "pallet-tokens", version = "3.0.0", default-features = false, path = "../pallets/tokens" } # Substrate dependencies frame-benchmarking = { default-features = false, optional = true, version = "3.0.0" } @@ -44,7 +45,7 @@ pallet-contracts-rpc-runtime-api = { default-features = false, version = "3.0.0" pallet-evm = { git = "https://github.com/paritytech/frontier", default-features = false } pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier" } fp-rpc = { default-features = false, git = "https://github.com/paritytech/frontier" } -pallet-evm-precompile-simple = { version = "3.0", git = "https://github.com/paritytech/frontier", default-features = false } +pallet-evm-precompile-simple = { version = "1.0.0", git = "https://github.com/paritytech/frontier", default-features = false } pallet-grandpa = { default-features = false, version = "3.0.0" } pallet-randomness-collective-flip = { default-features = false, version = "3.0.0" } @@ -64,7 +65,6 @@ sp-std = { default-features = false, version = "3.0.0" } sp-transaction-pool = { default-features = false, version = "3.0.0" } sp-version = { default-features = false, version = "3.0.0" } -orml-tokens = { version = "0.4.0", default-features = false } orml-currencies = { version = "0.4.0", default-features = false } orml-traits = { version = "0.4.0", default-features = false } @@ -117,4 +117,5 @@ std = [ "sp-version/std", "merkle/std", "mixer/std", + "tokens/std", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 11a0b6d5..45579e62 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -363,16 +363,29 @@ parameter_type_with_key! { parameter_types! { pub const NativeCurrencyId: CurrencyId = 0; + pub const CurrencyDeposit: u64 = 1; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; } -impl orml_tokens::Config for Runtime { + +impl tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; type CurrencyId = CurrencyId; type Event = Event; + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; type ExistentialDeposits = ExistentialDepositMap; type OnDust = (); type WeightInfo = (); + type Extra = (); } impl orml_currencies::Config for Runtime { @@ -499,7 +512,7 @@ construct_runtime!( Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: orml_tokens::{Module, Storage, Event}, + Tokens: tokens::{Module, Storage, Event}, Mixer: mixer::{Module, Call, Storage, Event}, Merkle: merkle::{Module, Call, Storage, Event}, } From 6da72d4a88564065fddf5f41ba6873cc69eb0c3f Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 12 Apr 2021 01:14:40 +0300 Subject: [PATCH 04/14] Pallets compile, node doesn't --- Cargo.lock | 2 +- node/src/service.rs | 528 ++++++++++++-------------- node/src/service_frontier.rs | 444 ++++++++++++++++++++++ pallets/merkle/Cargo.toml | 3 +- pallets/merkle/src/mock.rs | 7 +- pallets/mixer/src/lib.rs | 29 +- pallets/mixer/src/mock.rs | 75 ++-- pallets/mixer/src/tests.rs | 12 +- pallets/tokens/src/basic_currency.rs | 177 +++++++++ pallets/tokens/src/lib.rs | 393 ++++++++++++++++---- pallets/tokens/src/mock.rs | 16 +- pallets/tokens/src/tests.rs | 530 +++++++++++++++++++++++++++ pallets/tokens/src/traits.rs | 2 + pallets/tokens/src/types.rs | 9 +- runtime/Cargo.toml | 22 +- runtime/src/lib.rs | 164 +++++---- 16 files changed, 1906 insertions(+), 507 deletions(-) create mode 100644 node/src/service_frontier.rs create mode 100644 pallets/tokens/src/basic_currency.rs diff --git a/Cargo.lock b/Cargo.lock index 92dc72c3..3f942a18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10452,7 +10452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", + "rand 0.3.23", "static_assertions", ] diff --git a/node/src/service.rs b/node/src/service.rs index 7043d22f..197a495b 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,27 +1,18 @@ -//! Service and ServiceFactory implementation. Specialized wrapper over -//! substrate service. +//! Service and ServiceFactory implementation. Specialized wrapper over substrate service. - -use fc_mapping_sync::MappingSyncWorker; -use sc_service::BasePath; -use fc_rpc::EthTask; -use fc_rpc_core::types::{FilterPool, PendingTransactions}; -use fc_consensus::FrontierBlockImport; -use futures::{StreamExt}; -use node_template_runtime::{self, opaque::Block, RuntimeApi}; +use std::sync::Arc; +use std::time::Duration; use sc_client_api::{ExecutorProvider, RemoteBackend}; +use node_template_runtime::{self, opaque::Block, RuntimeApi}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sp_inherents::InherentDataProviders; use sc_executor::native_executor_instance; pub use sc_executor::NativeExecutor; -use sc_finality_grandpa::SharedVoterState; -use sc_telemetry::TelemetrySpan; -use sc_client_api::BlockchainEvents; - -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; -use sp_inherents::InherentDataProviders; - -use sc_cli::SubstrateCli; -use std::{sync::{Mutex, Arc}, time::Duration, collections::{HashMap, BTreeMap}}; +use sc_consensus_aura::{ImportQueueParams, StartAuraParams, SlotProportion}; +use sc_finality_grandpa::SharedVoterState; +use sc_keystore::LocalKeystore; +use sc_telemetry::{Telemetry, TelemetryWorker}; // Our native executor instance. native_executor_instance!( @@ -31,56 +22,53 @@ native_executor_instance!( frame_benchmarking::benchmarking::HostFunctions, ); -pub enum ConsensusResult { - Aura( +type FullClient = sc_service::TFullClient; +type FullBackend = sc_service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; + +pub fn new_partial(config: &Configuration) -> Result, + sc_transaction_pool::FullPool, + ( sc_consensus_aura::AuraBlockImport< Block, FullClient, - FrontierBlockImport< - Block, - sc_finality_grandpa::GrandpaBlockImport, - FullClient - >, + sc_finality_grandpa::GrandpaBlockImport, AuraPair >, - sc_finality_grandpa::LinkHalf - ), -} - -type FullClient = sc_service::TFullClient; -type FullBackend = sc_service::TFullBackend; -type FullSelectChain = sc_consensus::LongestChain; - -pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { - let config_dir = config.base_path.as_ref() - .map(|base_path| base_path.config_dir(config.chain_spec.id())) - .unwrap_or_else(|| { - BasePath::from_project("", "", &crate::cli::Cli::executable_name()) - .config_dir(config.chain_spec.id()) - }); - let database_dir = config_dir.join("frontier").join("db"); - - Ok(Arc::new(fc_db::Backend::::new(&fc_db::DatabaseSettings { - source: fc_db::DatabaseSettingsSrc::RocksDb { - path: database_dir, - cache_size: 0, - } - })?)) -} - -pub fn new_partial(config: &Configuration) -> Result< - sc_service::PartialComponents< - FullClient, FullBackend, FullSelectChain, - sp_consensus::import_queue::BasicQueue>, - sc_transaction_pool::FullPool, - (ConsensusResult, PendingTransactions, Option, Arc>), + sc_finality_grandpa::LinkHalf, + Option, + ) >, ServiceError> { - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + if config.keystore_remote.is_some() { + return Err(ServiceError::Other( + format!("Remote Keystores are not supported."))) + } + let inherent_data_providers = InherentDataProviders::new(); + + let telemetry = config.telemetry_endpoints.clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::(&config)?; + sc_service::new_full_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; let client = Arc::new(client); + let telemetry = telemetry + .map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = sc_transaction_pool::BasicPool::new_full( @@ -91,57 +79,78 @@ pub fn new_partial(config: &Configuration) -> Result< client.clone(), ); - let pending_transactions: PendingTransactions - = Some(Arc::new(Mutex::new(HashMap::new()))); - - let filter_pool: Option - = Some(Arc::new(Mutex::new(BTreeMap::new()))); - - let frontier_backend = open_frontier_backend(config)?; - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( - client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), - )?; - - let frontier_block_import = FrontierBlockImport::new( - grandpa_block_import.clone(), client.clone(), - frontier_backend.clone(), - ); + &(client.clone() as Arc<_>), + select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), + )?; let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( - frontier_block_import, client.clone(), + grandpa_block_import.clone(), client.clone(), ); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import.clone(), - Some(Box::new(grandpa_block_import.clone())), - client.clone(), - inherent_data_providers.clone(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: aura_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + inherent_data_providers: inherent_data_providers.clone(), + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, )?; Ok(sc_service::PartialComponents { - client, backend, task_manager, import_queue, keystore_container, - select_chain, transaction_pool, inherent_data_providers, - other: (ConsensusResult::Aura(aura_block_import, grandpa_link), pending_transactions, filter_pool, frontier_backend) + client, + backend, + task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + inherent_data_providers, + other: (aura_block_import, grandpa_link, telemetry), }) } -/// Creates a full service from the configuration. -pub fn new_full_base( - config: Configuration, - enable_dev_signer: bool, -) -> Result { +fn remote_keystore(_url: &String) -> Result, &'static str> { + // FIXME: here would the concrete keystore be built, + // must return a concrete type (NOT `LocalKeystore`) that + // implements `CryptoStore` and `SyncCryptoStore` + Err("Remote Keystore not supported.") +} + +/// Builds a new service for a full client. +pub fn new_full(mut config: Configuration) -> Result { let sc_service::PartialComponents { - client, backend, mut task_manager, import_queue, keystore_container, - select_chain, transaction_pool, inherent_data_providers, - other: (consensus_result, pending_transactions, filter_pool, frontier_backend), + client, + backend, + mut task_manager, + import_queue, + mut keystore_container, + select_chain, + transaction_pool, + inherent_data_providers, + other: (block_import, grandpa_link, mut telemetry), } = new_partial(&config)?; + if let Some(url) = &config.keystore_remote { + match remote_keystore(url) { + Ok(k) => keystore_container.set_remote_keystore(k), + Err(e) => { + return Err(ServiceError::Other( + format!("Error hooking up remote keystore for {}: {}", url, e))) + } + }; + } + + config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); + let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, @@ -155,7 +164,7 @@ pub fn new_full_base( if config.offchain_worker.enabled { sc_service::build_offchain_workers( - &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), + &config, task_manager.spawn_handle(), client.clone(), network.clone(), ); } @@ -165,206 +174,149 @@ pub fn new_full_base( let name = config.network.node_name.clone(); let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); - let is_authority = role.is_authority(); - let subscription_task_executor = sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()); - - let g_link = match consensus_result { - ConsensusResult::Aura(ref _aura_link, ref grandpa_link) => { - grandpa_link - } - }; let rpc_extensions_builder = { - let justification_stream = g_link.justification_stream(); - let shared_authority_set = g_link.shared_authority_set().clone(); - let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); - let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( - backend.clone(), - Some(shared_authority_set.clone()), - ); - let client = client.clone(); let pool = transaction_pool.clone(); - let network = network.clone(); - let pending = pending_transactions.clone(); - let filter_pool = filter_pool.clone(); - let frontier_backend = frontier_backend.clone(); - let select_chain = select_chain.clone(); Box::new(move |deny_unsafe, _| { let deps = crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe, - is_authority, - enable_dev_signer, - network: network.clone(), - pending_transactions: pending.clone(), - filter_pool: filter_pool.clone(), - backend: frontier_backend.clone(), - select_chain: select_chain.clone(), - grandpa: crate::rpc::GrandpaDeps { - shared_voter_state: shared_voter_state.clone(), - shared_authority_set: shared_authority_set.clone(), - justification_stream: justification_stream.clone(), - subscription_executor: subscription_task_executor.clone(), - finality_provider: finality_proof_provider.clone(), - }, }; - crate::rpc::create_full( - deps, - subscription_task_executor.clone() - ) + + crate::rpc::create_full(deps) }) }; - task_manager.spawn_essential_handle().spawn( - "frontier-mapping-sync-worker", - MappingSyncWorker::new( - client.import_notification_stream(), - Duration::new(6, 0), - client.clone(), - backend.clone(), - frontier_backend.clone(), - ).for_each(|()| futures::future::ready(())) - ); + let _rpc_handlers = sc_service::spawn_tasks( + sc_service::SpawnTasksParams { + network: network.clone(), + client: client.clone(), + keystore: keystore_container.sync_keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_extensions_builder, + on_demand: None, + remote_blockchain: None, + backend, + network_status_sinks, + system_rpc_tx, + config, + telemetry: telemetry.as_mut(), + }, + )?; - let telemetry_span = TelemetrySpan::new(); - let _telemetry_span_entered = telemetry_span.enter(); + if role.is_authority() { + let proposer_factory = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool, + prometheus_registry.as_ref(), + telemetry.as_ref().map(|x| x.handle()), + ); - let (_rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(sc_service::SpawnTasksParams { - network: network.clone(), - client: client.clone(), - keystore: keystore_container.sync_keystore(), - task_manager: &mut task_manager, - transaction_pool: transaction_pool.clone(), - rpc_extensions_builder: rpc_extensions_builder, - on_demand: None, - remote_blockchain: None, - backend, network_status_sinks, system_rpc_tx, config, telemetry_span: Some(telemetry_span.clone()), - })?; + let can_author_with = + sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - // Spawn Frontier EthFilterApi maintenance task. - if let Some(filter_pool) = filter_pool { - // Each filter is allowed to stay in the pool for 100 blocks. - const FILTER_RETAIN_THRESHOLD: u64 = 100; - task_manager.spawn_essential_handle().spawn( - "frontier-filter-pool", - EthTask::filter_pool_task( - Arc::clone(&client), - filter_pool, - FILTER_RETAIN_THRESHOLD, - ) - ); + let aura = sc_consensus_aura::start_aura::( + StartAuraParams { + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + client: client.clone(), + select_chain, + block_import, + proposer_factory, + inherent_data_providers: inherent_data_providers.clone(), + force_authoring, + backoff_authoring_blocks, + keystore: keystore_container.sync_keystore(), + can_author_with, + sync_oracle: network.clone(), + block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, + )?; + + // the AURA authoring task is considered essential, i.e. if it + // fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking("aura", aura); } - // Spawn Frontier pending transactions maintenance task (as essential, otherwise we leak). - if let Some(pending_transactions) = pending_transactions { - const TRANSACTION_RETAIN_THRESHOLD: u64 = 5; - task_manager.spawn_essential_handle().spawn( - "frontier-pending-transactions", - EthTask::pending_transaction_task( - Arc::clone(&client), - pending_transactions, - TRANSACTION_RETAIN_THRESHOLD, - ) - ); - } + // if the node isn't actively participating in consensus then it doesn't + // need a keystore, regardless of which protocol we use below. + let keystore = if role.is_authority() { + Some(keystore_container.sync_keystore()) + } else { + None + }; - match consensus_result { - ConsensusResult::Aura(aura_block_import, grandpa_link) => { - if role.is_authority() { - let proposer = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - ); - - let can_author_with = - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - client.clone(), - select_chain, - aura_block_import, - proposer, - network.clone(), - inherent_data_providers.clone(), - force_authoring, - backoff_authoring_blocks, - keystore_container.sync_keystore(), - can_author_with, - )?; - - // the AURA authoring task is considered essential, i.e. if it - // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura", aura); - - // if the node isn't actively participating in consensus then it doesn't - // need a keystore, regardless of which protocol we use below. - let keystore = if role.is_authority() { - Some(keystore_container.sync_keystore()) - } else { - None - }; - - let grandpa_config = sc_finality_grandpa::Config { - // FIXME #1578 make this available through chainspec - gossip_duration: Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore, - is_authority: role.is_authority(), - }; - - if enable_grandpa { - // start the full GRANDPA voter - // NOTE: non-authorities could run the GRANDPA observer protocol, but at - // this point the full voter should provide better guarantees of block - // and vote data availability than the observer. The observer has not - // been tested extensively yet and having most nodes in a network run it - // could lead to finality stalls. - let grandpa_config = sc_finality_grandpa::GrandpaParams { - config: grandpa_config, - link: grandpa_link, - network, - telemetry_on_connect: telemetry_connection_notifier.map(|x| x.on_connect_stream()), - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), - prometheus_registry, - shared_voter_state: SharedVoterState::empty(), - }; - - // the GRANDPA voter task is considered infallible, i.e. - // if it fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking( - "grandpa-voter", - sc_finality_grandpa::run_grandpa_voter(grandpa_config)? - ); - } - } - } + let grandpa_config = sc_finality_grandpa::Config { + // FIXME #1578 make this available through chainspec + gossip_duration: Duration::from_millis(333), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_authority(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }; + + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: non-authorities could run the GRANDPA observer protocol, but at + // this point the full voter should provide better guarantees of block + // and vote data availability than the observer. The observer has not + // been tested extensively yet and having most nodes in a network run it + // could lead to finality stalls. + let grandpa_config = sc_finality_grandpa::GrandpaParams { + config: grandpa_config, + link: grandpa_link, + network, + voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + prometheus_registry, + shared_voter_state: SharedVoterState::empty(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }; + + // the GRANDPA voter task is considered infallible, i.e. + // if it fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking( + "grandpa-voter", + sc_finality_grandpa::run_grandpa_voter(grandpa_config)? + ); } network_starter.start_network(); Ok(task_manager) } -/// Builds a new service for a full client. -pub fn new_full(config: Configuration, enable_dev_signer: bool) --> Result { - new_full_base(config, enable_dev_signer) -} +/// Builds a new service for a light client. +pub fn new_light(mut config: Configuration) -> Result { + let telemetry = config.telemetry_endpoints.clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; -pub fn new_light_base(config: Configuration) -> Result { let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::(&config)?; + sc_service::new_light_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; + + let mut telemetry = telemetry + .map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); - let select_chain = sc_consensus::LongestChain::new(backend.clone()); + config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); - let telemetry_span = TelemetrySpan::new(); - let _telemetry_span_entered = telemetry_span.enter(); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( config.transaction_pool.clone(), @@ -378,27 +330,28 @@ pub fn new_light_base(config: Configuration) -> Result), select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), )?; - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, + let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( grandpa_block_import.clone(), - Some(Box::new(grandpa_block_import)), client.clone(), - InherentDataProviders::new(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::NeverCanAuthor, - )?; - - let light_deps = crate::rpc::LightDeps { - remote_blockchain: backend.remote_blockchain(), - fetcher: on_demand.clone(), - client: client.clone(), - pool: transaction_pool.clone(), - }; + ); - let rpc_extensions = crate::rpc::create_light(light_deps); + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: aura_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + inherent_data_providers: InherentDataProviders::new(), + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::NeverCanAuthor, + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, + )?; let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -413,7 +366,7 @@ pub fn new_light_base(config: Configuration) -> Result Result Result Result { - new_light_base(config) -} diff --git a/node/src/service_frontier.rs b/node/src/service_frontier.rs new file mode 100644 index 00000000..7043d22f --- /dev/null +++ b/node/src/service_frontier.rs @@ -0,0 +1,444 @@ +//! Service and ServiceFactory implementation. Specialized wrapper over +//! substrate service. + + +use fc_mapping_sync::MappingSyncWorker; +use sc_service::BasePath; +use fc_rpc::EthTask; +use fc_rpc_core::types::{FilterPool, PendingTransactions}; +use fc_consensus::FrontierBlockImport; +use futures::{StreamExt}; +use node_template_runtime::{self, opaque::Block, RuntimeApi}; +use sc_client_api::{ExecutorProvider, RemoteBackend}; +use sc_executor::native_executor_instance; +pub use sc_executor::NativeExecutor; +use sc_finality_grandpa::SharedVoterState; +use sc_telemetry::TelemetrySpan; +use sc_client_api::BlockchainEvents; + +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; +use sp_inherents::InherentDataProviders; + +use sc_cli::SubstrateCli; +use std::{sync::{Mutex, Arc}, time::Duration, collections::{HashMap, BTreeMap}}; + +// Our native executor instance. +native_executor_instance!( + pub Executor, + node_template_runtime::api::dispatch, + node_template_runtime::native_version, + frame_benchmarking::benchmarking::HostFunctions, +); + +pub enum ConsensusResult { + Aura( + sc_consensus_aura::AuraBlockImport< + Block, + FullClient, + FrontierBlockImport< + Block, + sc_finality_grandpa::GrandpaBlockImport, + FullClient + >, + AuraPair + >, + sc_finality_grandpa::LinkHalf + ), +} + +type FullClient = sc_service::TFullClient; +type FullBackend = sc_service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; + +pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { + let config_dir = config.base_path.as_ref() + .map(|base_path| base_path.config_dir(config.chain_spec.id())) + .unwrap_or_else(|| { + BasePath::from_project("", "", &crate::cli::Cli::executable_name()) + .config_dir(config.chain_spec.id()) + }); + let database_dir = config_dir.join("frontier").join("db"); + + Ok(Arc::new(fc_db::Backend::::new(&fc_db::DatabaseSettings { + source: fc_db::DatabaseSettingsSrc::RocksDb { + path: database_dir, + cache_size: 0, + } + })?)) +} + +pub fn new_partial(config: &Configuration) -> Result< + sc_service::PartialComponents< + FullClient, FullBackend, FullSelectChain, + sp_consensus::import_queue::BasicQueue>, + sc_transaction_pool::FullPool, + (ConsensusResult, PendingTransactions, Option, Arc>), +>, ServiceError> { + let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + + let (client, backend, keystore_container, task_manager) = + sc_service::new_full_parts::(&config)?; + let client = Arc::new(client); + + let select_chain = sc_consensus::LongestChain::new(backend.clone()); + + let transaction_pool = sc_transaction_pool::BasicPool::new_full( + config.transaction_pool.clone(), + config.role.is_authority().into(), + config.prometheus_registry(), + task_manager.spawn_handle(), + client.clone(), + ); + + let pending_transactions: PendingTransactions + = Some(Arc::new(Mutex::new(HashMap::new()))); + + let filter_pool: Option + = Some(Arc::new(Mutex::new(BTreeMap::new()))); + + let frontier_backend = open_frontier_backend(config)?; + + let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), + )?; + + let frontier_block_import = FrontierBlockImport::new( + grandpa_block_import.clone(), + client.clone(), + frontier_backend.clone(), + ); + + let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( + frontier_block_import, client.clone(), + ); + + let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( + sc_consensus_aura::slot_duration(&*client)?, + aura_block_import.clone(), + Some(Box::new(grandpa_block_import.clone())), + client.clone(), + inherent_data_providers.clone(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + )?; + + Ok(sc_service::PartialComponents { + client, backend, task_manager, import_queue, keystore_container, + select_chain, transaction_pool, inherent_data_providers, + other: (ConsensusResult::Aura(aura_block_import, grandpa_link), pending_transactions, filter_pool, frontier_backend) + }) +} + +/// Creates a full service from the configuration. +pub fn new_full_base( + config: Configuration, + enable_dev_signer: bool, +) -> Result { + let sc_service::PartialComponents { + client, backend, mut task_manager, import_queue, keystore_container, + select_chain, transaction_pool, inherent_data_providers, + other: (consensus_result, pending_transactions, filter_pool, frontier_backend), + } = new_partial(&config)?; + + let (network, network_status_sinks, system_rpc_tx, network_starter) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + on_demand: None, + block_announce_validator_builder: None, + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), + ); + } + + let role = config.role.clone(); + let force_authoring = config.force_authoring; + let backoff_authoring_blocks: Option<()> = None; + let name = config.network.node_name.clone(); + let enable_grandpa = !config.disable_grandpa; + let prometheus_registry = config.prometheus_registry().cloned(); + let is_authority = role.is_authority(); + let subscription_task_executor = sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()); + + let g_link = match consensus_result { + ConsensusResult::Aura(ref _aura_link, ref grandpa_link) => { + grandpa_link + } + }; + + let rpc_extensions_builder = { + let justification_stream = g_link.justification_stream(); + let shared_authority_set = g_link.shared_authority_set().clone(); + let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); + let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( + backend.clone(), + Some(shared_authority_set.clone()), + ); + + let client = client.clone(); + let pool = transaction_pool.clone(); + let network = network.clone(); + let pending = pending_transactions.clone(); + let filter_pool = filter_pool.clone(); + let frontier_backend = frontier_backend.clone(); + let select_chain = select_chain.clone(); + + Box::new(move |deny_unsafe, _| { + let deps = crate::rpc::FullDeps { + client: client.clone(), + pool: pool.clone(), + deny_unsafe, + is_authority, + enable_dev_signer, + network: network.clone(), + pending_transactions: pending.clone(), + filter_pool: filter_pool.clone(), + backend: frontier_backend.clone(), + select_chain: select_chain.clone(), + grandpa: crate::rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + justification_stream: justification_stream.clone(), + subscription_executor: subscription_task_executor.clone(), + finality_provider: finality_proof_provider.clone(), + }, + }; + crate::rpc::create_full( + deps, + subscription_task_executor.clone() + ) + }) + }; + + task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + MappingSyncWorker::new( + client.import_notification_stream(), + Duration::new(6, 0), + client.clone(), + backend.clone(), + frontier_backend.clone(), + ).for_each(|()| futures::future::ready(())) + ); + + let telemetry_span = TelemetrySpan::new(); + let _telemetry_span_entered = telemetry_span.enter(); + + let (_rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(sc_service::SpawnTasksParams { + network: network.clone(), + client: client.clone(), + keystore: keystore_container.sync_keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_extensions_builder: rpc_extensions_builder, + on_demand: None, + remote_blockchain: None, + backend, network_status_sinks, system_rpc_tx, config, telemetry_span: Some(telemetry_span.clone()), + })?; + + // Spawn Frontier EthFilterApi maintenance task. + if let Some(filter_pool) = filter_pool { + // Each filter is allowed to stay in the pool for 100 blocks. + const FILTER_RETAIN_THRESHOLD: u64 = 100; + task_manager.spawn_essential_handle().spawn( + "frontier-filter-pool", + EthTask::filter_pool_task( + Arc::clone(&client), + filter_pool, + FILTER_RETAIN_THRESHOLD, + ) + ); + } + + // Spawn Frontier pending transactions maintenance task (as essential, otherwise we leak). + if let Some(pending_transactions) = pending_transactions { + const TRANSACTION_RETAIN_THRESHOLD: u64 = 5; + task_manager.spawn_essential_handle().spawn( + "frontier-pending-transactions", + EthTask::pending_transaction_task( + Arc::clone(&client), + pending_transactions, + TRANSACTION_RETAIN_THRESHOLD, + ) + ); + } + + match consensus_result { + ConsensusResult::Aura(aura_block_import, grandpa_link) => { + if role.is_authority() { + let proposer = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + prometheus_registry.as_ref(), + ); + + let can_author_with = + sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); + let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _, _>( + sc_consensus_aura::slot_duration(&*client)?, + client.clone(), + select_chain, + aura_block_import, + proposer, + network.clone(), + inherent_data_providers.clone(), + force_authoring, + backoff_authoring_blocks, + keystore_container.sync_keystore(), + can_author_with, + )?; + + // the AURA authoring task is considered essential, i.e. if it + // fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking("aura", aura); + + // if the node isn't actively participating in consensus then it doesn't + // need a keystore, regardless of which protocol we use below. + let keystore = if role.is_authority() { + Some(keystore_container.sync_keystore()) + } else { + None + }; + + let grandpa_config = sc_finality_grandpa::Config { + // FIXME #1578 make this available through chainspec + gossip_duration: Duration::from_millis(333), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_authority(), + }; + + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: non-authorities could run the GRANDPA observer protocol, but at + // this point the full voter should provide better guarantees of block + // and vote data availability than the observer. The observer has not + // been tested extensively yet and having most nodes in a network run it + // could lead to finality stalls. + let grandpa_config = sc_finality_grandpa::GrandpaParams { + config: grandpa_config, + link: grandpa_link, + network, + telemetry_on_connect: telemetry_connection_notifier.map(|x| x.on_connect_stream()), + voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + prometheus_registry, + shared_voter_state: SharedVoterState::empty(), + }; + + // the GRANDPA voter task is considered infallible, i.e. + // if it fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking( + "grandpa-voter", + sc_finality_grandpa::run_grandpa_voter(grandpa_config)? + ); + } + } + } + } + + network_starter.start_network(); + Ok(task_manager) +} + +/// Builds a new service for a full client. +pub fn new_full(config: Configuration, enable_dev_signer: bool) +-> Result { + new_full_base(config, enable_dev_signer) +} + +pub fn new_light_base(config: Configuration) -> Result { + let (client, backend, keystore_container, mut task_manager, on_demand) = + sc_service::new_light_parts::(&config)?; + + let select_chain = sc_consensus::LongestChain::new(backend.clone()); + + let telemetry_span = TelemetrySpan::new(); + let _telemetry_span_entered = telemetry_span.enter(); + + let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( + config.transaction_pool.clone(), + config.prometheus_registry(), + task_manager.spawn_handle(), + client.clone(), + on_demand.clone(), + )); + + let (grandpa_block_import, _) = sc_finality_grandpa::block_import( + client.clone(), + &(client.clone() as Arc<_>), + select_chain.clone(), + )?; + + let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( + sc_consensus_aura::slot_duration(&*client)?, + grandpa_block_import.clone(), + Some(Box::new(grandpa_block_import)), + client.clone(), + InherentDataProviders::new(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + sp_consensus::NeverCanAuthor, + )?; + + let light_deps = crate::rpc::LightDeps { + remote_blockchain: backend.remote_blockchain(), + fetcher: on_demand.clone(), + client: client.clone(), + pool: transaction_pool.clone(), + }; + + let rpc_extensions = crate::rpc::create_light(light_deps); + + let (network, network_status_sinks, system_rpc_tx, network_starter) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + on_demand: Some(on_demand.clone()), + block_announce_validator_builder: None, + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), + ); + } + + sc_service::spawn_tasks(sc_service::SpawnTasksParams { + remote_blockchain: Some(backend.remote_blockchain()), + transaction_pool, + task_manager: &mut task_manager, + on_demand: Some(on_demand), + rpc_extensions_builder: Box::new(sc_service::NoopRpcExtensionBuilder(rpc_extensions)), + config, + client, + keystore: keystore_container.sync_keystore(), + backend, + network, + network_status_sinks, + system_rpc_tx, + telemetry_span: Some(telemetry_span.clone()), + })?; + + network_starter.start_network(); + + Ok(task_manager) +} + +/// Builds a new service for a light client. +pub fn new_light(config: Configuration) -> Result { + new_light_base(config) +} diff --git a/pallets/merkle/Cargo.toml b/pallets/merkle/Cargo.toml index 7bb40888..736352de 100644 --- a/pallets/merkle/Cargo.toml +++ b/pallets/merkle/Cargo.toml @@ -18,7 +18,7 @@ sp-std = { default-features = false, version = "3.0.0" } sp-runtime = { default-features = false, version = "3.0.0" } merlin = { version = "2.0.0", default-features = false } sha2 = { version = "0.9.1", default-features = false } -rand_core = { version = "0.5", default-features = false, features = ["alloc", "getrandom"] } +rand_core = { version = "0.5", default-features = false, features = ["alloc", "getrandom"], optional = true} serde = { version = "1.0.101", optional = true, features = ["derive"] } sp-io = { default-features = false, version = "3.0.0" } frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } @@ -46,6 +46,7 @@ sp-core = { default-features = false, version = "3.0.0" } [features] default = ["std"] std = [ + "rand_core", "serde", "sp-runtime/std", "sp-io/std", diff --git a/pallets/merkle/src/mock.rs b/pallets/merkle/src/mock.rs index 1e236054..0c388f6a 100644 --- a/pallets/merkle/src/mock.rs +++ b/pallets/merkle/src/mock.rs @@ -22,9 +22,9 @@ construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - MerkleTrees: pallet_merkle::{Module, Call, Storage, Event}, + System: system::{Pallet, Call, Config, Storage, Event}, + Balances: balances::{Pallet, Call, Storage, Config, Event}, + MerkleTrees: pallet_merkle::{Pallet, Call, Storage, Event}, } ); @@ -58,6 +58,7 @@ impl frame_system::Config for Test { type SS58Prefix = Prefix; type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } parameter_types! { diff --git a/pallets/mixer/src/lib.rs b/pallets/mixer/src/lib.rs index 1143fd83..94810baa 100644 --- a/pallets/mixer/src/lib.rs +++ b/pallets/mixer/src/lib.rs @@ -57,19 +57,18 @@ pub mod weights; pub mod traits; use codec::{Decode, Encode}; -use frame_support::{debug, dispatch, ensure, traits::Get, weights::Weight}; +use frame_support::{dispatch, ensure, traits::Get, weights::Weight, PalletId}; use frame_system::ensure_signed; use merkle::{ utils::{ keys::{Commitment, ScalarData}, permissions::ensure_admin, }, - Tree as TreeTrait, Module as MerkleModule, + Tree as TreeTrait, Pallet as MerklePallet, }; use orml_traits::MultiCurrency; use sp_runtime::{ traits::{AccountIdConversion, Zero}, - ModuleId, }; use sp_std::prelude::*; use traits::ExtendedMixer; @@ -83,13 +82,13 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use sp_runtime::DispatchResultWithInfo; + /// The pallet's configuration trait. #[pallet::config] - pub trait Config: frame_system::Config + merkle::Config + orml_tokens::Config + orml_currencies::Config { + pub trait Config: frame_system::Config + merkle::Config + orml_currencies::Config { #[pallet::constant] - type ModuleId: Get; + type PalletId: Get; /// The overarching event type. type Event: IsType<::Event> + From>; /// Currency type for taking deposits @@ -116,7 +115,7 @@ pub mod pallet { #[pallet::getter(fn initialised)] pub type Initialised = StorageValue<_, bool, ValueQuery>; - /// The map of mixer treess to their metadata + /// The map of mixer trees to their metadata #[pallet::storage] #[pallet::getter(fn mixer_trees)] pub type MixerTrees = StorageMap<_, Blake2_128Concat, T::TreeId, MixerInfo, ValueQuery>; @@ -211,17 +210,17 @@ pub mod pallet { // this block) if none happened, carry over previous Merkle roots for the cache. let mixer_ids = MixerTreeIds::::get(); for i in 0..mixer_ids.len() { - let cached_roots = >::cached_roots(_n, mixer_ids[i]); + let cached_roots = >::cached_roots(_n, mixer_ids[i]); // if there are no cached roots, carry forward the current root if cached_roots.len() == 0 { - let _ = >::add_root_to_cache(mixer_ids[i], _n); + let _ = >::add_root_to_cache(mixer_ids[i], _n); } } } else { match Self::initialize() { Ok(_) => {} Err(e) => { - debug::native::error!("Error initialising: {:?}", e); + // frame_support::debug::native::error!("Error initialising: {:?}", e); } } } @@ -250,7 +249,7 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; ensure!(Self::initialised(), Error::::NotInitialised); - ensure!(!>::stopped(mixer_id), Error::::MixerStopped); + ensure!(!>::stopped(mixer_id), Error::::MixerStopped); // get mixer info, should always exist if the module is initialized let mut mixer_info = Self::get_mixer(mixer_id)?; // ensure the sender has enough balance to cover deposit @@ -303,7 +302,7 @@ pub mod pallet { let sender = ensure_signed(origin)?; ensure!(Self::initialised(), Error::::NotInitialised); ensure!( - !>::stopped(withdraw_proof.mixer_id), + !>::stopped(withdraw_proof.mixer_id), Error::::MixerStopped ); let recipient = withdraw_proof.recipient.unwrap_or(sender.clone()); @@ -516,9 +515,9 @@ impl MixerInfo { } } -impl Module { +impl Pallet { pub fn account_id() -> T::AccountId { - T::ModuleId::get().into_account() + T::PalletId::get().into_account() } pub fn get_mixer(mixer_id: T::TreeId) -> Result, dispatch::DispatchError> { @@ -563,7 +562,7 @@ impl Module { impl ExtendedMixer, BalanceOf> for Pallet { fn create_new( - account_id: T::AccountId, + _account_id: T::AccountId, currency_id: CurrencyIdOf, size: BalanceOf, ) -> Result<(), dispatch::DispatchError> { diff --git a/pallets/mixer/src/mock.rs b/pallets/mixer/src/mock.rs index 2af72f88..01c6ec8b 100644 --- a/pallets/mixer/src/mock.rs +++ b/pallets/mixer/src/mock.rs @@ -1,16 +1,16 @@ use super::*; use crate as pallet_mixer; use frame_benchmarking::whitelisted_caller; -use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; +use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; use merkle::weights::Weights as MerkleWeights; use orml_currencies::BasicCurrencyAdapter; -use orml_traits::parameter_type_with_key; + use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - ModuleId, Perbill, + Perbill, }; use weights::Weights; @@ -30,12 +30,12 @@ construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - MerkleTrees: merkle::{Module, Call, Storage, Event}, - Mixer: pallet_mixer::{Module, Call, Storage, Event}, - Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: orml_tokens::{Module, Storage, Event, Config}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: balances::{Pallet, Call, Storage, Config, Event}, + MerkleTrees: merkle::{Pallet, Call, Storage, Event}, + Mixer: pallet_mixer::{Pallet, Call, Storage, Event}, + Currencies: orml_currencies::{Pallet, Storage, Event}, + Tokens: tokens::{Pallet, Storage, Event}, } ); @@ -69,6 +69,7 @@ impl frame_system::Config for Test { type PalletInfo = PalletInfo; type SS58Prefix = Prefix; type SystemWeightInfo = (); + type OnSetCode = (); type Version = (); } @@ -91,26 +92,35 @@ impl balances::Config for Test { type WeightInfo = (); } -parameter_type_with_key! { - pub ExistentialDepositMap: |k: CurrencyId| -> Balance { - match k { - _ => 2, - } - }; +parameter_types! { + pub const NativeCurrencyId: CurrencyId = 0; } parameter_types! { - pub const NativeCurrencyId: CurrencyId = 0; + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); + pub const CurrencyDeposit: u64 = 0; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; } -impl orml_tokens::Config for Test { - type Amount = Amount; +impl tokens::Config for Test { + type PalletId = TokensPalletId; + type Event = Event; type Balance = Balance; + type Amount = i128; type CurrencyId = CurrencyId; - type Event = Event; - type ExistentialDeposits = ExistentialDepositMap; + type NativeCurrency = BasicCurrencyAdapter; + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; type OnDust = (); type WeightInfo = (); + type Extra = (); } impl orml_currencies::Config for Test { @@ -130,7 +140,7 @@ impl merkle::Config for Test { } parameter_types! { - pub const MixerModuleId: ModuleId = ModuleId(*b"py/mixer"); + pub const MixerPalletId: PalletId = PalletId(*b"py/mixer"); pub const DefaultAdmin: u64 = 4; pub MixerSizes: Vec = [1_000, 10_000, 100_000, 1_000_000].to_vec(); } @@ -142,37 +152,38 @@ impl Config for Test { type Event = Event; type Tree = MerkleTrees; type MixerSizes = MixerSizes; - type ModuleId = MixerModuleId; + type PalletId = MixerPalletId; type NativeCurrencyId = NativeCurrencyId; type WeightInfo = Weights; } +pub type TokenPallet = tokens::Pallet; pub type MixerCall = pallet_mixer::Call; // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { use balances::GenesisConfig as BalancesConfig; - use orml_tokens::GenesisConfig as TokensConfig; + // use tokens::GenesisConfig as TokensConfig; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); BalancesConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![ - (0, 1_000_000_000), - (1, 1_000_000_000), - (2, 1_000_000_000), + (0, 1_000_000_000_000_000_000), + (1, 1_000_000_000_000_000_000), + (2, 1_000_000_000_000_000_000), (whitelisted_caller(), 1_000_000_000), ], } .assimilate_storage(&mut t) .unwrap(); - let token_currency_id: CurrencyId = 1; - TokensConfig:: { - endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], - } - .assimilate_storage(&mut t) - .unwrap(); + let _token_currency_id: CurrencyId = 1; + // TokensConfig:: { + // endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], + // } + // .assimilate_storage(&mut t) + // .unwrap(); t.into() } diff --git a/pallets/mixer/src/tests.rs b/pallets/mixer/src/tests.rs index 34657f49..ade87ccb 100644 --- a/pallets/mixer/src/tests.rs +++ b/pallets/mixer/src/tests.rs @@ -23,6 +23,8 @@ use merkle::{ }; use merlin::Transcript; use sp_runtime::{traits::BadOrigin, DispatchError}; +use crate::mock::TokenPallet; +use tokens::ExtendedTokenSystem; fn default_hasher(num_gens: usize) -> Poseidon { let width = 6; @@ -337,9 +339,17 @@ fn should_not_have_cache_once_cache_length_exceeded() { fn should_make_mixer_with_non_native_token() { new_test_ext().execute_with(|| { let currency_id = 1; + assert_ok!(>::create( + currency_id, + 1, // owner + 1, // admin + 1 // min_balance + )); + + assert_ok!(>::mint(1, 0, 10000000)); assert_ok!(Mixer::initialize()); assert_ok!(>::create_new( - 4, + 1, currency_id, 1_000 )); diff --git a/pallets/tokens/src/basic_currency.rs b/pallets/tokens/src/basic_currency.rs new file mode 100644 index 00000000..cac05179 --- /dev/null +++ b/pallets/tokens/src/basic_currency.rs @@ -0,0 +1,177 @@ +use super::*; +use sp_std::{ + convert::{TryFrom, TryInto}, + fmt::Debug, + marker, result, +}; +use codec::Codec; +use orml_traits::{ + arithmetic::{Signed, SimpleArithmetic}, + BalanceStatus, BasicCurrency, BasicCurrencyExtended, BasicLockableCurrency, BasicReservableCurrency, + LockIdentifier +}; +use sp_runtime::{ + traits::{CheckedSub, MaybeSerializeDeserialize}, + DispatchError, DispatchResult, +}; +use frame_support::{ + traits::{ + Currency as PalletCurrency, ExistenceRequirement, LockableCurrency as PalletLockableCurrency, + ReservableCurrency as PalletReservableCurrency, WithdrawReasons, + }, +}; + +/// Adapt other currency traits implementation to `BasicCurrency`. +pub struct BasicCurrencyAdapter(marker::PhantomData<(T, Currency, Amount, Moment)>); + +type PalletBalanceOf = >::Balance; + +// Adapt `frame_support::traits::Currency` +impl BasicCurrency + for BasicCurrencyAdapter +where + Currency: PalletCurrency, + T: Config, +{ + type Balance = PalletBalanceOf; + + fn minimum_balance() -> Self::Balance { + Currency::minimum_balance() + } + + fn total_issuance() -> Self::Balance { + Currency::total_issuance() + } + + fn total_balance(who: &AccountId) -> Self::Balance { + Currency::total_balance(who) + } + + fn free_balance(who: &AccountId) -> Self::Balance { + Currency::free_balance(who) + } + + fn ensure_can_withdraw(who: &AccountId, amount: Self::Balance) -> DispatchResult { + let new_balance = Self::free_balance(who) + .checked_sub(&amount) + .ok_or(Error::::BalanceLow)?; + + Currency::ensure_can_withdraw(who, amount, WithdrawReasons::all(), new_balance) + } + + fn transfer(from: &AccountId, to: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::transfer(from, to, amount, ExistenceRequirement::AllowDeath) + } + + fn deposit(who: &AccountId, amount: Self::Balance) -> DispatchResult { + let _ = Currency::deposit_creating(who, amount); + Ok(()) + } + + fn withdraw(who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::withdraw(who, amount, WithdrawReasons::all(), ExistenceRequirement::AllowDeath).map(|_| ()) + } + + fn can_slash(who: &AccountId, amount: Self::Balance) -> bool { + Currency::can_slash(who, amount) + } + + fn slash(who: &AccountId, amount: Self::Balance) -> Self::Balance { + let (_, gap) = Currency::slash(who, amount); + gap + } +} + +// Adapt `frame_support::traits::Currency` +impl BasicCurrencyExtended + for BasicCurrencyAdapter +where + Amount: Signed + + TryInto> + + TryFrom> + + SimpleArithmetic + + Codec + + Copy + + MaybeSerializeDeserialize + + Debug + + Default, + Currency: PalletCurrency, + T: Config, +{ + type Amount = Amount; + + fn update_balance(who: &AccountId, by_amount: Self::Amount) -> DispatchResult { + let by_balance = by_amount + .abs() + .try_into() + .map_err(|_| Error::::AmountIntoBalanceFailed)?; + if by_amount.is_positive() { + Self::deposit(who, by_balance) + } else { + Self::withdraw(who, by_balance) + } + } +} + +// Adapt `frame_support::traits::LockableCurrency` +impl BasicLockableCurrency + for BasicCurrencyAdapter +where + Currency: PalletLockableCurrency, + T: Config, +{ + type Moment = Moment; + + fn set_lock(lock_id: LockIdentifier, who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::set_lock(lock_id, who, amount, WithdrawReasons::all()); + Ok(()) + } + + fn extend_lock(lock_id: LockIdentifier, who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::extend_lock(lock_id, who, amount, WithdrawReasons::all()); + Ok(()) + } + + fn remove_lock(lock_id: LockIdentifier, who: &AccountId) -> DispatchResult { + Currency::remove_lock(lock_id, who); + Ok(()) + } +} + +// Adapt `frame_support::traits::ReservableCurrency` +impl BasicReservableCurrency + for BasicCurrencyAdapter +where + Currency: PalletReservableCurrency, + T: Config, +{ + fn can_reserve(who: &AccountId, value: Self::Balance) -> bool { + Currency::can_reserve(who, value) + } + + fn slash_reserved(who: &AccountId, value: Self::Balance) -> Self::Balance { + let (_, gap) = Currency::slash_reserved(who, value); + gap + } + + fn reserved_balance(who: &AccountId) -> Self::Balance { + Currency::reserved_balance(who) + } + + fn reserve(who: &AccountId, value: Self::Balance) -> DispatchResult { + Currency::reserve(who, value) + } + + fn unreserve(who: &AccountId, value: Self::Balance) -> Self::Balance { + Currency::unreserve(who, value) + } + + fn repatriate_reserved( + slashed: &AccountId, + beneficiary: &AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> result::Result { + Currency::repatriate_reserved(slashed, beneficiary, value, status) + } +} \ No newline at end of file diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs index b378b04a..67b398b9 100644 --- a/pallets/tokens/src/lib.rs +++ b/pallets/tokens/src/lib.rs @@ -17,6 +17,7 @@ pub mod mock; #[cfg(test)] mod tests; +mod basic_currency; mod traits; pub use traits::*; mod types; @@ -54,6 +55,7 @@ use frame_support::{ use orml_traits::{ account::MergeAccount, arithmetic::{self, Signed}, + BasicCurrencyExtended, BasicLockableCurrency, BasicReservableCurrency, BalanceStatus, LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, MultiReservableCurrency, OnDust, }; @@ -96,6 +98,11 @@ pub mod pallet { /// The currency ID type type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize + Ord; + /// The native currency system + type NativeCurrency: BasicCurrencyExtended + + BasicLockableCurrency + + BasicReservableCurrency; + /// The origin which may forcibly create or destroy an asset or otherwise alter privileged /// attributes. type ForceOrigin: EnsureOrigin; @@ -136,6 +143,14 @@ pub mod pallet { Issued(T::CurrencyId, T::AccountId, T::Balance), /// Some assets were destroyed. \[asset_id, owner, balance\] Burned(T::CurrencyId, T::AccountId, T::Balance), + /// Some account `who` was frozen. \[asset_id, who\] + Frozen(T::CurrencyId, T::AccountId), + /// Some account `who` was thawed. \[asset_id, who\] + Thawed(T::CurrencyId, T::AccountId), + /// Some asset `asset_id` was frozen. \[asset_id\] + TokenFrozen(T::CurrencyId), + /// Some asset `asset_id` was thawed. \[asset_id\] + TokenThawed(T::CurrencyId), /// The management team changed \[asset_id, issuer, admin, freezer\] TeamChanged(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId), /// The owner changed \[asset_id, owner\] @@ -187,12 +202,16 @@ pub mod pallet { BalanceLow, /// Balance should be non-zero. BalanceZero, + /// Amount to be transferred is below minimum existential deposit + BelowMinimum, /// The signing account has no permission to do the operation. NoPermission, /// The given currency ID is unknown. Unknown, /// The origin account is frozen. Frozen, + /// The token is frozen + TokenIsFrozen, /// The currency ID is already taken. InUse, /// Invalid witness data given. @@ -209,6 +228,8 @@ pub mod pallet { Unapproved, /// The source account would not survive the transfer and it needs to stay alive. WouldDie, + /// Invalid amount, + InvalidAmount } #[pallet::storage] @@ -339,22 +360,14 @@ pub mod pallet { ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); let deposit = T::CurrencyDeposit::get(); - >::reserve(id, &owner, deposit)?; - - Token::::insert(id, TokenDetails { - owner: owner.clone(), - issuer: admin.clone(), - admin: admin.clone(), - freezer: admin.clone(), - supply: Zero::zero(), - deposit, - min_balance, - is_sufficient: false, - accounts: 0, - sufficients: 0, - approvals: 0, - is_frozen: false, - }); + T::NativeCurrency::reserve(&owner, deposit)?; + + >::create( + id, + owner.clone(), + admin.clone(), + min_balance + )?; Self::deposit_event(Event::Created(id, owner, admin)); Ok(()) } @@ -385,7 +398,6 @@ pub mod pallet { origin: OriginFor, id: T::CurrencyId, owner: ::Source, - is_sufficient: bool, min_balance: T::Balance, ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; @@ -402,9 +414,6 @@ pub mod pallet { supply: Zero::zero(), deposit: Zero::zero(), min_balance, - is_sufficient, - accounts: 0, - sufficients: 0, approvals: 0, is_frozen: false, }); @@ -430,7 +439,6 @@ pub mod pallet { pub(super) fn destroy( origin: OriginFor, id: T::CurrencyId, - witness: DestroyWitness, ) -> DispatchResult { let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { Ok(_) => None, @@ -441,20 +449,14 @@ pub mod pallet { if let Some(check_owner) = maybe_check_owner { ensure!(details.owner == check_owner, Error::::NoPermission); } - ensure!(details.accounts == witness.accounts, Error::::BadWitness); - ensure!(details.sufficients == witness.sufficients, Error::::BadWitness); - ensure!(details.approvals == witness.approvals, Error::::BadWitness); - for (who, v) in Accounts::::drain_prefix(id) { - Self::dead_account(id, &who, &mut details); + for (who, _v) in Accounts::::drain_prefix(id) { + Self::dead_account(&who, &mut details); AccountCurrencies::::remove(who, id); } - debug_assert_eq!(details.accounts, 0); - debug_assert_eq!(details.sufficients, 0); let metadata = Metadata::::take(&id); - >::unreserve( - id, + T::NativeCurrency::unreserve( &details.owner, details.deposit.saturating_add(metadata.deposit) ); @@ -486,9 +488,14 @@ pub mod pallet { beneficiary: ::Source, amount: T::Balance ) -> DispatchResult { - // TODO: Make this callable by the admin - let _ = ensure_signed(origin)?; + let sender = ensure_signed(origin)?; let beneficiary = T::Lookup::lookup(beneficiary)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(sender == details.issuer, Error::::NoPermission); + ensure!( + Self::total_balance(id, &beneficiary).saturating_add(amount) >= details.min_balance, + Error::::BelowMinimum + ); >::mint(id, beneficiary.clone(), amount)?; Self::deposit_event(Event::Issued(id, beneficiary, amount)); Ok(()) @@ -516,14 +523,127 @@ pub mod pallet { who: ::Source, amount: T::Balance ) -> DispatchResult { - // TODO: Make this callable by the admin - let _ = ensure_signed(origin)?; + let sender = ensure_signed(origin)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(sender == details.admin, Error::::NoPermission); let who = T::Lookup::lookup(who)?; >::burn(id, who.clone(), amount)?; Self::deposit_event(Event::Burned(id, who, amount)); Ok(()) } + /// Disallow further unprivileged transfers from an account. + /// + /// Origin must be Signed and the sender should be the Freezer of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `who`: The account to be frozen. + /// + /// Emits `Frozen`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn freeze( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.freezer, Error::::NoPermission); + let who = T::Lookup::lookup(who)?; + ensure!(Accounts::::contains_key(id, &who), Error::::BalanceZero); + + Accounts::::mutate(id, &who, |a| a.is_frozen = true); + + Self::deposit_event(Event::::Frozen(id, who)); + Ok(()) + } + + /// Allow unprivileged transfers from an account again. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `who`: The account to be unfrozen. + /// + /// Emits `Thawed`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn thaw( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &details.admin, Error::::NoPermission); + let who = T::Lookup::lookup(who)?; + ensure!(Accounts::::contains_key(id, &who), Error::::BalanceZero); + + Accounts::::mutate(id, &who, |a| a.is_frozen = false); + + Self::deposit_event(Event::::Thawed(id, who)); + Ok(()) + } + + /// Disallow further unprivileged transfers for the asset class. + /// + /// Origin must be Signed and the sender should be the Freezer of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// + /// Emits `Frozen`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn freeze_asset( + origin: OriginFor, + id: T::CurrencyId + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let d = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &d.freezer, Error::::NoPermission); + + d.is_frozen = true; + + Self::deposit_event(Event::::TokenFrozen(id)); + Ok(()) + }) + } + + /// Allow unprivileged transfers for the asset again. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// + /// Emits `Thawed`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn thaw_asset( + origin: OriginFor, + id: T::CurrencyId + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let d = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &d.admin, Error::::NoPermission); + + d.is_frozen = false; + + Self::deposit_event(Event::::TokenThawed(id)); + Ok(()) + }) + } + /// Change the Owner of an asset. /// /// Origin must be Signed and the sender should be the Owner of the asset `id`. @@ -552,8 +672,7 @@ pub mod pallet { let deposit = details.deposit + metadata_deposit; // Move the deposit to the new owner. - >::repatriate_reserved( - id, + T::NativeCurrency::repatriate_reserved( &details.owner, &owner, deposit, @@ -646,9 +765,9 @@ pub mod pallet { .saturating_add(T::MetadataDepositBase::get()); if new_deposit > old_deposit { - >::reserve(id, &origin, new_deposit - old_deposit)?; + T::NativeCurrency::reserve(&origin, new_deposit - old_deposit)?; } else { - >::unreserve(id, &origin, old_deposit - new_deposit); + T::NativeCurrency::unreserve(&origin, old_deposit - new_deposit); } *metadata = Some(TokenMetadata { @@ -687,7 +806,7 @@ pub mod pallet { Metadata::::try_mutate_exists(id, |metadata| { let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; - >::unreserve(id, &d.owner, deposit); + T::NativeCurrency::unreserve(&d.owner, deposit); Self::deposit_event(Event::MetadataCleared(id)); Ok(()) }) @@ -758,7 +877,7 @@ pub mod pallet { let d = Token::::get(id).ok_or(Error::::Unknown)?; Metadata::::try_mutate_exists(id, |metadata| { let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; - >::unreserve(id, &d.owner, deposit); + T::NativeCurrency::unreserve(&d.owner, deposit); Self::deposit_event(Event::MetadataCleared(id)); Ok(()) }) @@ -775,11 +894,6 @@ pub mod pallet { /// - `freezer`: The new Freezer of this asset. /// - `min_balance`: The minimum balance of this new asset that any single account must /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient - /// value to account for the state bloat associated with its balance storage. If set to - /// `true`, then non-zero balances may be stored without a `consumer` reference (and thus - /// an ED in the Balances pallet or whatever else is used to control user-account state - /// growth). /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin /// instructions. /// @@ -795,7 +909,6 @@ pub mod pallet { admin: ::Source, freezer: ::Source, min_balance: T::Balance, - is_sufficient: bool, is_frozen: bool, ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; @@ -807,7 +920,6 @@ pub mod pallet { asset.admin = T::Lookup::lookup(admin)?; asset.freezer = T::Lookup::lookup(freezer)?; asset.min_balance = min_balance; - asset.is_sufficient = is_sufficient; asset.is_frozen = is_frozen; *maybe_asset = Some(asset); @@ -851,7 +963,7 @@ pub mod pallet { let mut approved = maybe_approved.take().unwrap_or_default(); let deposit_required = T::ApprovalDeposit::get(); if approved.deposit < deposit_required { - >::reserve(id, &key.owner, deposit_required - approved.deposit)?; + T::NativeCurrency::reserve(&key.owner, deposit_required - approved.deposit)?; approved.deposit = deposit_required; } approved.amount = approved.amount.saturating_add(amount); @@ -886,7 +998,7 @@ pub mod pallet { let delegate = T::Lookup::lookup(delegate)?; let key = ApprovalKey { owner, delegate }; let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; - >::unreserve(id, &key.owner, approval.deposit); + T::NativeCurrency::unreserve(&key.owner, approval.deposit); Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); Ok(()) @@ -926,7 +1038,7 @@ pub mod pallet { let key = ApprovalKey { owner, delegate }; let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; - >::unreserve(id, &key.owner, approval.deposit); + T::NativeCurrency::unreserve(&key.owner, approval.deposit); Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); Ok(()) @@ -970,7 +1082,7 @@ pub mod pallet { >::transfer(id, &key.owner, &destination, amount)?; if remaining.is_zero() { - >::unreserve(id, &key.owner, approved.deposit); + T::NativeCurrency::unreserve(&key.owner, approved.deposit); } else { approved.amount = remaining; *maybe_approved = Some(approved); @@ -987,15 +1099,19 @@ pub mod pallet { #[pallet::weight(5_000_000)] pub fn transfer( origin: OriginFor, + id: T::CurrencyId, dest: ::Source, - currency_id: T::CurrencyId, amount: T::Balance, ) -> DispatchResult { let from = ensure_signed(origin)?; let to = T::Lookup::lookup(dest)?; - >::transfer(currency_id, &from, &to, amount)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); - Self::deposit_event(Event::Transferred(currency_id, from, to, amount)); + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); Ok(().into()) } @@ -1006,21 +1122,109 @@ pub mod pallet { #[pallet::weight(5_000_000)] pub fn transfer_all( origin: OriginFor, + id: T::CurrencyId, dest: ::Source, - currency_id: T::CurrencyId, ) -> DispatchResult { let from = ensure_signed(origin)?; let to = T::Lookup::lookup(dest)?; - let balance = >::free_balance(currency_id, &from); - >::transfer(currency_id, &from, &to, balance)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); + + let balance = >::free_balance(id, &from); + >::transfer(id, &from, &to, balance)?; + + Self::deposit_event(Event::Transferred(id, from, to, balance)); + Ok(().into()) + } + + /// Move some assets from the sender account to another, keeping the sender account alive. + /// + /// Origin must be Signed. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `target`: The account to be credited. + /// - `amount`: The amount by which the sender's balance of assets should be reduced and + /// `target`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the sender balance above zero but below + /// the minimum balance. Must be greater than zero. + /// + /// Emits `Transferred` with the actual amount transferred. If this takes the source balance + /// to below the minimum for the asset, then the amount transferred is increased to take it + /// to zero. + /// + /// Weight: `O(1)` + /// Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status + /// of sender; Account pre-existence of `target`. + #[pallet::weight(5_000_000)] + pub(super) fn transfer_keep_alive( + origin: OriginFor, + id: T::CurrencyId, + target: ::Source, + amount: T::Balance + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(target)?; + let balance = >::free_balance(id, &from); + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); + // Check balance to ensure account is kept alive + ensure!(balance - amount >= details.min_balance, Error::::WouldDie); + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); - Self::deposit_event(Event::Transferred(currency_id, from, to, balance)); Ok(().into()) } + + /// Move some assets from one account to another. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `source`: The account to be debited. + /// - `dest`: The account to be credited. + /// - `amount`: The amount by which the `source`'s balance of assets should be reduced and + /// `dest`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the `source` balance above zero but + /// below the minimum balance. Must be greater than zero. + /// + /// Emits `Transferred` with the actual amount transferred. If this takes the source balance + /// to below the minimum for the asset, then the amount transferred is increased to take it + /// to zero. + /// + /// Weight: `O(1)` + /// Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status + /// of `source`; Account pre-existence of `dest`. + #[pallet::weight(T::WeightInfo::force_transfer())] + pub(super) fn force_transfer( + origin: OriginFor, + id: T::CurrencyId, + source: ::Source, + dest: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let from = T::Lookup::lookup(source)?; + let to = T::Lookup::lookup(dest)?; + + let details = Token::::get(id).ok_or(Error::::Unknown)?; + // Check admin rights. + ensure!(&origin == &details.admin, Error::::NoPermission); + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); + Ok(()) + } } } impl Pallet { + fn total_supply(currency_id: T::CurrencyId) -> T::Balance { + Self::total_issuance(currency_id) + } + /// Check whether account_id is a module account pub(crate) fn is_module_account_id(account_id: &T::AccountId) -> bool { PalletId::try_from_account(account_id).is_some() @@ -1146,12 +1350,10 @@ impl Pallet { } pub(crate) fn dead_account( - currency_id: T::CurrencyId, who: &T::AccountId, d: &mut TokenDetails, ) { frame_system::Pallet::::dec_consumers(who); - d.accounts = d.accounts.saturating_sub(1); } } @@ -1208,12 +1410,17 @@ impl MultiCurrency for Pallet { if amount.is_zero() || from == to { return Ok(()); } + Self::ensure_can_withdraw(currency_id, from, amount)?; let from_balance = Self::free_balance(currency_id, from); let to_balance = Self::free_balance(currency_id, to) .checked_add(&amount) .ok_or(Error::::BalanceOverflow)?; + + let details = Token::::get(currency_id).ok_or(Error::::Unknown)?; + ensure!(to_balance >= details.min_balance, Error::::BelowMinimum); + // Cannot underflow because ensure_can_withdraw check Self::set_free_balance(currency_id, from, from_balance - amount); Self::set_free_balance(currency_id, to, to_balance); @@ -1758,12 +1965,66 @@ impl MergeAccount for Pallet { } impl ExtendedTokenSystem for Pallet { - fn mint(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) - -> Result<(), DispatchError> { - Self::deposit(currency_id, &account_id, amount) + fn create(currency_id: T::CurrencyId, owner: T::AccountId, admin: T::AccountId, min_balance: T::Balance) -> Result<(), DispatchError> { + Token::::insert(currency_id, TokenDetails { + owner: owner.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), + supply: Zero::zero(), + deposit: T::CurrencyDeposit::get(), + min_balance, + approvals: 0, + is_frozen: false, + }); + + Ok(()) + } + + fn mint(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) -> Result<(), DispatchError> { + Self::deposit(currency_id, &account_id, amount)?; + Ok(()) + } + + /// Burns a balance from an account. Will burn into reserved balance as well. + /// Deducts total burned amount from the token supply. Note, the total burned + /// amount might be less than the target burn amount if the user has less balance + /// than what is being burnt. + fn burn(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) -> Result<(), DispatchError> { + ensure!(!amount.is_zero(), Error::::InvalidAmount); + + let account = Self::accounts(currency_id, account_id.clone()); + let free_burn_amount = account.free.min(amount); + // Cannot underflow becuase free_burn_amount can never be greater than amount + let mut remaining_burn = amount - free_burn_amount; + + // slash free balance + if !free_burn_amount.is_zero() { + // Cannot underflow becuase free_burn_amount can never be greater than + // account.free + Self::set_free_balance(currency_id, &account_id, account.free - free_burn_amount); } - fn burn(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) - -> Result<(), DispatchError> { - Self::withdraw(currency_id, &account_id, amount) + + // burn reserved balance + if !remaining_burn.is_zero() { + let reserved_burn_amount = account.reserved.min(remaining_burn); + // Cannot underflow due to above line + remaining_burn -= reserved_burn_amount; + Self::set_reserved_balance(currency_id, &account_id, account.reserved - reserved_burn_amount); } + + // Cannot underflow because the burn value cannot be greater than total + // issuance + >::mutate(currency_id, |v| *v -= amount - remaining_burn); + Ok(()) + } +} + +pub struct BurnDust(marker::PhantomData); +impl OnDust for BurnDust { + fn on_dust(who: &T::AccountId, currency_id: T::CurrencyId, amount: T::Balance) { + // burn the dust, ignore the result, + // if failed will leave some dust which still could be recycled. + let _ = Pallet::::withdraw(currency_id, who, amount); + } } \ No newline at end of file diff --git a/pallets/tokens/src/mock.rs b/pallets/tokens/src/mock.rs index 9a0d2733..df3b2de0 100644 --- a/pallets/tokens/src/mock.rs +++ b/pallets/tokens/src/mock.rs @@ -3,7 +3,7 @@ use crate as tokens; use frame_benchmarking::whitelisted_caller; use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; -use orml_currencies::BasicCurrencyAdapter; +use basic_currency::BasicCurrencyAdapter; use sp_core::H256; use sp_runtime::{ @@ -31,7 +31,6 @@ construct_runtime!( System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: balances::{Pallet, Call, Storage, Config, Event}, Tokens: tokens::{Pallet, Call, Storage, Event}, - Currencies: orml_currencies::{Pallet, Storage, Event}, } ); @@ -92,14 +91,6 @@ parameter_types! { pub const NativeCurrencyId: CurrencyId = 0; } -impl orml_currencies::Config for Test { - type Event = Event; - type GetNativeCurrencyId = NativeCurrencyId; - type MultiCurrency = TokenModule; - type NativeCurrency = BasicCurrencyAdapter; - type WeightInfo = (); -} - parameter_types! { pub const TokensPalletId: PalletId = PalletId(*b"py/token"); pub const CurrencyDeposit: u64 = 1; @@ -115,19 +106,18 @@ impl Config for Test { type Balance = Balance; type Amount = i128; type CurrencyId = CurrencyId; + type NativeCurrency = BasicCurrencyAdapter; type ForceOrigin = frame_system::EnsureRoot; type CurrencyDeposit = CurrencyDeposit; type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; - type OnDust = (); + type OnDust = BurnDust; type WeightInfo = (); type Extra = (); } -type TokenModule = Pallet; - // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { use balances::GenesisConfig as BalancesConfig; diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index e69de29b..07b186e3 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -0,0 +1,530 @@ +// This file is part of Substrate. + +// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests for Tokens pallet. + +use super::*; +use crate::{Error, mock::*}; +use frame_support::{assert_ok, assert_noop, traits::Currency}; +use balances::Error as BalancesError; + +#[test] +fn basic_minting_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 100)); + assert_eq!(Tokens::free_balance(0, &2), 100); + }); +} + +#[test] +fn approval_lifecycle_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Balances::reserved_balance(&1), 1); + assert_ok!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 40)); + assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); + assert_eq!(Tokens::free_balance(0, &1), 60); + assert_eq!(Tokens::free_balance(0, &3), 40); + assert_eq!(Balances::reserved_balance(&1), 0); + }); +} + +#[test] +fn approval_deposits_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 10, 1)); + assert_ok!(Tokens::mint(Origin::signed(10), 0, 1, 100)); + let e = BalancesError::::InsufficientBalance; + assert_noop!(Tokens::approve_transfer(Origin::signed(10), 0, 2, 50), e); + + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Balances::reserved_balance(&1), 1); + + assert_ok!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 50)); + assert_eq!(Balances::reserved_balance(&1), 0); + + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); + assert_eq!(Balances::reserved_balance(&1), 0); + }); +} + +#[test] +fn cannot_transfer_more_than_approved() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + let e = Error::::Unapproved; + assert_noop!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 51), e); + }); +} + +#[test] +fn cannot_transfer_more_than_exists() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 101)); + let e = Error::::BalanceLow; + assert_noop!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 101), e); + }); +} + +#[test] +fn cancel_approval_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_noop!(Tokens::cancel_approval(Origin::signed(1), 1, 2), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(2), 0, 2), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(1), 0, 3), Error::::Unknown); + assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); + assert_noop!(Tokens::cancel_approval(Origin::signed(1), 0, 2), Error::::Unknown); + }); +} + +#[test] +fn force_cancel_approval_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + let e = Error::::NoPermission; + assert_noop!(Tokens::force_cancel_approval(Origin::signed(2), 0, 1, 2), e); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 1, 1, 2), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 2, 2), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 3), Error::::Unknown); + assert_ok!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 2)); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 2), Error::::Unknown); + }); +} + +#[test] +fn lifecycle_should_work() { + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&1, 100); + assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); + assert_eq!(Balances::reserved_balance(&1), 1); + assert!(Token::::contains_key(0)); + + assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&1), 4); + assert!(Metadata::::contains_key(0)); + + Balances::make_free_balance_be(&10, 100); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 10, 100)); + Balances::make_free_balance_be(&20, 100); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 20, 100)); + assert_eq!(Accounts::::iter_prefix(0).count(), 2); + + assert_ok!(Tokens::destroy(Origin::signed(1), 0)); + assert_eq!(Balances::reserved_balance(&1), 0); + + assert!(!Token::::contains_key(0)); + assert!(!Metadata::::contains_key(0)); + assert_eq!(Accounts::::iter_prefix(0).count(), 0); + + assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); + assert_eq!(Balances::reserved_balance(&1), 1); + assert!(Token::::contains_key(0)); + + assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&1), 4); + assert!(Metadata::::contains_key(0)); + + assert_ok!(Tokens::mint(Origin::signed(1), 0, 10, 100)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 20, 100)); + assert_eq!(Accounts::::iter_prefix(0).count(), 2); + + assert_ok!(Tokens::destroy(Origin::root(), 0)); + assert_eq!(Balances::reserved_balance(&1), 0); + + assert!(!Token::::contains_key(0)); + assert!(!Metadata::::contains_key(0)); + assert_eq!(Accounts::::iter_prefix(0).count(), 0); + }); +} + +#[test] +fn min_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 10)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); + + // Cannot create a new account with a balance that is below minimum... + assert_noop!(Tokens::mint(Origin::signed(1), 0, 2, 9), Error::::BelowMinimum); + assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 9), Error::::BelowMinimum); + assert_noop!(Tokens::force_transfer(Origin::signed(1), 0, 1, 2, 9), Error::::BelowMinimum); + + // When deducting from an account to below minimum, it should be reaped. + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 91)); + assert!(Tokens::free_balance(0, &1).is_zero()); + assert_eq!(Tokens::free_balance(0, &2), 91); + assert_eq!(Tokens::total_issuance(0), 91); + assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::force_transfer(Origin::signed(1), 0, 2, 1, 91)); + assert!(Tokens::free_balance(0, &2).is_zero()); + assert_eq!(Tokens::free_balance(0, &1), 91); + assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, 91)); + assert!(Tokens::free_balance(0, &1).is_zero()); + assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 0); + }); +} + +#[test] +fn querying_total_supply_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Tokens::free_balance(0, &1), 50); + assert_eq!(Tokens::free_balance(0, &2), 50); + assert_ok!(Tokens::transfer(Origin::signed(2), 0, 3, 31)); + assert_eq!(Tokens::free_balance(0, &1), 50); + assert_eq!(Tokens::free_balance(0, &2), 19); + assert_eq!(Tokens::free_balance(0, &3), 31); + assert_ok!(Tokens::burn(Origin::signed(1), 0, 3, u64::max_value())); + assert_eq!(Tokens::total_issuance(0), 69); + }); +} + +#[test] +fn transferring_amount_below_available_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Tokens::free_balance(0, &1), 50); + assert_eq!(Tokens::free_balance(0, &2), 50); + }); +} + +#[test] +fn transferring_enough_to_kill_source_when_keep_alive_should_fail() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 10)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_noop!(Tokens::transfer_keep_alive(Origin::signed(1), 0, 2, 91), Error::::WouldDie); + assert_ok!(Tokens::transfer_keep_alive(Origin::signed(1), 0, 2, 90)); + assert_eq!(Tokens::free_balance(0, &1), 10); + assert_eq!(Tokens::free_balance(0, &2), 90); + }); +} + +#[test] +fn transferring_frozen_user_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::freeze(Origin::signed(1), 0, 1)); + assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 50), Error::::Frozen); + assert_ok!(Tokens::thaw(Origin::signed(1), 0, 1)); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + }); +} + +#[test] +fn transferring_frozen_asset_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::freeze_asset(Origin::signed(1), 0)); + assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 50), Error::::TokenIsFrozen); + assert_ok!(Tokens::thaw_asset(Origin::signed(1), 0)); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + }); +} + +#[test] +fn origin_guards_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_noop!(Tokens::transfer_ownership(Origin::signed(2), 0, 2), Error::::NoPermission); + assert_noop!(Tokens::set_team(Origin::signed(2), 0, 2, 2, 2), Error::::NoPermission); + assert_noop!(Tokens::freeze(Origin::signed(2), 0, 1), Error::::NoPermission); + assert_noop!(Tokens::thaw(Origin::signed(2), 0, 2), Error::::NoPermission); + assert_noop!(Tokens::mint(Origin::signed(2), 0, 2, 100), Error::::NoPermission); + assert_noop!(Tokens::burn(Origin::signed(2), 0, 1, 100), Error::::NoPermission); + assert_noop!(Tokens::force_transfer(Origin::signed(2), 0, 1, 2, 100), Error::::NoPermission); + assert_noop!(Tokens::destroy(Origin::signed(2), 0), Error::::NoPermission); + }); +} + +#[test] +fn transfer_owner_should_work() { + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&1, 100); + Balances::make_free_balance_be(&2, 100); + assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); + + assert_eq!(Balances::reserved_balance(&1), 1); + + assert_ok!(Tokens::transfer_ownership(Origin::signed(1), 0, 2)); + assert_eq!(Balances::reserved_balance(&2), 1); + assert_eq!(Balances::reserved_balance(&1), 0); + + assert_noop!(Tokens::transfer_ownership(Origin::signed(1), 0, 1), Error::::NoPermission); + + // Set metadata now and make sure that deposit gets transferred back. + assert_ok!(Tokens::set_metadata(Origin::signed(2), 0, vec![0u8; 10], vec![0u8; 10], 12)); + assert_ok!(Tokens::transfer_ownership(Origin::signed(2), 0, 1)); + assert_eq!(Balances::reserved_balance(&1), 22); + assert_eq!(Balances::reserved_balance(&2), 0); + }); +} + +#[test] +fn set_team_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::set_team(Origin::signed(1), 0, 2, 3, 4)); + + assert_ok!(Tokens::mint(Origin::signed(2), 0, 2, 100)); + assert_ok!(Tokens::freeze(Origin::signed(4), 0, 2)); + assert_ok!(Tokens::thaw(Origin::signed(3), 0, 2)); + assert_ok!(Tokens::force_transfer(Origin::signed(3), 0, 2, 3, 100)); + assert_ok!(Tokens::burn(Origin::signed(3), 0, 3, 100)); + }); +} + +#[test] +fn transferring_to_frozen_account_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_eq!(Tokens::free_balance(0, &2), 100); + assert_ok!(Tokens::freeze(Origin::signed(1), 0, 2)); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Tokens::free_balance(0, &2), 150); + }); +} + +#[test] +fn transferring_amount_more_than_available_balance_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Tokens::free_balance(0, &1), 50); + assert_eq!(Tokens::free_balance(0, &2), 50); + assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, u64::max_value())); + assert_eq!(Tokens::free_balance(0, &1), 0); + assert_noop!(Tokens::transfer(Origin::signed(2), 0, 1, 51), Error::::BalanceLow); + }); +} + +#[test] +fn transferring_less_than_one_unit_is_fine() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 0)); + }); +} + +#[test] +fn transferring_more_units_than_total_supply_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 101), Error::::BalanceLow); + }); +} + +#[test] +fn burning_asset_balance_with_positive_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, u64::max_value())); + assert_eq!(Tokens::free_balance(0, &1), 0); + }); +} + +#[test] +fn burning_asset_balance_with_zero_balance_does_nothing() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Tokens::free_balance(0, &1), 100); + assert_eq!(Tokens::free_balance(0, &2), 0); + assert_ok!(Tokens::burn(Origin::signed(1), 0, 2, u64::max_value())); + assert_eq!(Tokens::free_balance(0, &2), 0); + assert_eq!(Tokens::total_supply(0), 100); + }); +} + +#[test] +fn set_metadata_should_work() { + new_test_ext().execute_with(|| { + // Cannot add metadata to unknown asset + assert_noop!( + Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 10], 12), + Error::::Unknown, + ); + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + // Cannot add metadata to unowned asset + assert_noop!( + Tokens::set_metadata(Origin::signed(2), 0, vec![0u8; 10], vec![0u8; 10], 12), + Error::::NoPermission, + ); + + // Cannot add oversized metadata + assert_noop!( + Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 100], vec![0u8; 10], 12), + Error::::BadMetadata, + ); + assert_noop!( + Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 100], 12), + Error::::BadMetadata, + ); + + // Successfully add metadata and take deposit + Balances::make_free_balance_be(&1, 30); + assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 10], 12)); + assert_eq!(Balances::free_balance(&1), 9); + + // Update deposit + assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 5], 12)); + assert_eq!(Balances::free_balance(&1), 14); + assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 15], 12)); + assert_eq!(Balances::free_balance(&1), 4); + + // Cannot over-reserve + assert_noop!( + Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 20], vec![0u8; 20], 12), + BalancesError::::InsufficientBalance, + ); + + // Clear Metadata + assert!(Metadata::::contains_key(0)); + assert_noop!(Tokens::clear_metadata(Origin::signed(2), 0), Error::::NoPermission); + assert_noop!(Tokens::clear_metadata(Origin::signed(1), 1), Error::::Unknown); + assert_ok!(Tokens::clear_metadata(Origin::signed(1), 0)); + assert!(!Metadata::::contains_key(0)); + }); +} + +#[test] +fn force_metadata_should_work() { + new_test_ext().execute_with(|| { + //force set metadata works + assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; 10], vec![0u8; 10], 8, false)); + assert!(Metadata::::contains_key(0)); + + //overwrites existing metadata + let asset_original_metadata = Metadata::::get(0); + assert_ok!(Tokens::force_set_metadata(Origin::root(), 0, vec![1u8; 10], vec![1u8; 10], 8, false)); + assert_ne!(Metadata::::get(0), asset_original_metadata); + + //attempt to set metadata for non-existent asset class + assert_noop!( + Tokens::force_set_metadata(Origin::root(), 1, vec![0u8; 10], vec![0u8; 10], 8, false), + Error::::Unknown + ); + + //string length limit check + let limit = StringLimit::get() as usize; + assert_noop!( + Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; limit + 1], vec![0u8; 10], 8, false), + Error::::BadMetadata + ); + assert_noop!( + Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; 10], vec![0u8; limit + 1], 8, false), + Error::::BadMetadata + ); + + //force clear metadata works + assert!(Metadata::::contains_key(0)); + assert_ok!(Tokens::force_clear_metadata(Origin::root(), 0)); + assert!(!Metadata::::contains_key(0)); + + //Error handles clearing non-existent asset class + assert_noop!(Tokens::force_clear_metadata(Origin::root(), 1), Error::::Unknown); + }); +} + +#[test] +fn force_asset_status_should_work(){ + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&1, 10); + Balances::make_free_balance_be(&2, 10); + assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 30)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 50)); + assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 150)); + + //force asset status to change min_balance > balance + assert_ok!(Tokens::force_asset_status(Origin::root(), 0, 1, 1, 1, 1, 100, false)); + assert_eq!(Tokens::free_balance(0, &1), 50); + + //account can NOT receive Tokens for balance < min_balance + assert_noop!(Tokens::transfer(Origin::signed(2), 0, 1, 1), Error::::BelowMinimum); + assert_eq!(Tokens::free_balance(0, &1), 50); + + //account can send tokens for balance < min_balance + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Tokens::free_balance(0, &1), 0); + assert_eq!(Tokens::free_balance(0, &2), 200); + assert_eq!(Tokens::total_supply(0), 200); + + //won't create new account with balance below min_balance + assert_noop!(Tokens::transfer(Origin::signed(2), 0, 3, 50), Error::::BelowMinimum); + + //force asset status will not execute for non-existent class + assert_noop!( + Tokens::force_asset_status(Origin::root(), 1, 1, 1, 1, 1, 90, false), + Error::::Unknown + ); + + //account drains to completion when funds dip below min_balance + assert_ok!(Tokens::force_asset_status(Origin::root(), 0, 1, 1, 1, 1, 110, false)); + assert_ok!(Tokens::transfer(Origin::signed(2), 0, 1, 110)); + assert_eq!(Tokens::free_balance(0, &1), 110); + assert_eq!(Tokens::free_balance(0, &2), 0); + assert_eq!(Tokens::total_supply(0), 110); + }); +} diff --git a/pallets/tokens/src/traits.rs b/pallets/tokens/src/traits.rs index b0927903..591f156f 100644 --- a/pallets/tokens/src/traits.rs +++ b/pallets/tokens/src/traits.rs @@ -1,6 +1,8 @@ use frame_support::dispatch; pub trait ExtendedTokenSystem { + fn create(currency: CurrencyId, owner: AccountId, admin: AccountId, min_balance: Balance) + -> Result<(), dispatch::DispatchError>; fn mint(currency_id: CurrencyId, account_id: AccountId, amount: Balance) -> Result<(), dispatch::DispatchError>; fn burn(currency_id: CurrencyId, account_id: AccountId, amount: Balance) diff --git a/pallets/tokens/src/types.rs b/pallets/tokens/src/types.rs index 44bafc84..03862bc8 100644 --- a/pallets/tokens/src/types.rs +++ b/pallets/tokens/src/types.rs @@ -19,13 +19,6 @@ pub struct TokenDetails< pub(super) deposit: Balance, /// The ED for virtual accounts. pub(super) min_balance: Balance, - /// If `true`, then any account with this currency is given a provider reference. Otherwise, it - /// requires a consumer reference. - pub(super) is_sufficient: bool, - /// The total number of accounts. - pub(super) accounts: u32, - /// The total number of accounts for which we have placed a self-sufficient reference. - pub(super) sufficients: u32, /// The total number of approvals. pub(super) approvals: u32, /// Whether the currency is frozen for non-admin transfers. @@ -113,6 +106,8 @@ pub struct AccountData { pub reserved: Balance, /// The amount that `free` may not drop below when withdrawing. pub frozen: Balance, + /// The flag representing if the entire account is frozen + pub is_frozen: bool, } impl AccountData { diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index f820604f..6e5ade48 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -42,10 +42,10 @@ pallet-contracts = { default-features = false, version = "3.0.0" } pallet-contracts-primitives = { default-features = false, version = "3.0.0" } pallet-contracts-rpc-runtime-api = { default-features = false, version = "3.0.0" } -pallet-evm = { git = "https://github.com/paritytech/frontier", default-features = false } -pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier" } -fp-rpc = { default-features = false, git = "https://github.com/paritytech/frontier" } -pallet-evm-precompile-simple = { version = "1.0.0", git = "https://github.com/paritytech/frontier", default-features = false } +pallet-evm = { git = "https://github.com/paritytech/frontier", default-features = false, optional = true } +pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier", optional = true} +fp-rpc = { default-features = false, git = "https://github.com/paritytech/frontier", optional = true} +pallet-evm-precompile-simple = { version = "1.0.0", git = "https://github.com/paritytech/frontier", default-features = false, optional = true} pallet-grandpa = { default-features = false, version = "3.0.0" } pallet-randomness-collective-flip = { default-features = false, version = "3.0.0" } @@ -69,7 +69,7 @@ orml-currencies = { version = "0.4.0", default-features = false } orml-traits = { version = "0.4.0", default-features = false } [features] -default = ["std"] +default = ["std", "frontier"] runtime-benchmarks = [ "hex-literal", "frame-benchmarking", @@ -82,6 +82,14 @@ runtime-benchmarks = [ "mixer/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] + +frontier = [ + "fp-rpc/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-precompile-simple/std", +] + std = [ "codec/std", "serde", @@ -89,15 +97,11 @@ std = [ "frame-support/std", "frame-system/std", "frame-system-rpc-runtime-api/std", - "fp-rpc/std", "pallet-aura/std", "pallet-balances/std", "pallet-contracts/std", "pallet-contracts-primitives/std", "pallet-contracts-rpc-runtime-api/std", - "pallet-ethereum/std", - "pallet-evm/std", - "pallet-evm-precompile-simple/std", "pallet-grandpa/std", "pallet-randomness-collective-flip/std", "pallet-sudo/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 45579e62..d657bfb1 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,11 +17,12 @@ use sp_core::{ crypto::{AccountId32, KeyTypeId}, OpaqueMetadata, H160, H256, U256, }; +use sp_inherents::{InherentData, CheckInherentsResult}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, NumberFor, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedPointNumber, ModuleId, MultiSignature, Perbill, Perquintill, + ApplyExtrinsicResult, FixedPointNumber, MultiSignature, Perbill, Perquintill, }; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -31,7 +32,7 @@ use static_assertions::const_assert; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, parameter_types, pallet_prelude::PhantomData, + construct_runtime, parameter_types, pallet_prelude::PhantomData, PalletId, traits::{Currency, Imbalance, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, Randomness, U128CurrencyToVote}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, @@ -43,20 +44,29 @@ pub use frame_system::limits::{BlockLength, BlockWeights}; pub use pallet_balances::Call as BalancesCall; use pallet_contracts::weights::WeightInfo; pub use pallet_timestamp::Call as TimestampCall; +use sp_consensus_aura::SlotDuration; use orml_currencies::BasicCurrencyAdapter; use orml_traits::parameter_type_with_key; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; +#[cfg(feature = "frontier")] use pallet_ethereum::TransactionStatus; +#[cfg(feature = "frontier")] use pallet_evm::{ Account as EVMAccount, FeeCalculator, Runner, }; -use sp_runtime::ConsensusEngineId; -use frame_support::traits::FindAuthor; +#[cfg(feature = "frontier")] use pallet_evm::HashedAddressMapping; +#[cfg(feature = "frontier")] use pallet_evm::EnsureAddressTruncated; + +#[cfg(feature = "frontier")] +use sp_runtime::ConsensusEngineId; +#[cfg(feature = "frontier")] +use frame_support::traits::FindAuthor; +#[cfg(feature = "frontier")] use sp_core::crypto::Public; pub mod currency { @@ -139,8 +149,8 @@ pub mod opaque { } pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("node-template"), - impl_name: create_runtime_str!("node-template"), + spec_name: create_runtime_str!("webb-node"), + impl_name: create_runtime_str!("webb-node"), authoring_version: 1, spec_version: 1, impl_version: 1, @@ -227,6 +237,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = Prefix; type SystemWeightInfo = frame_system::weights::SubstrateWeight; type Version = Version; + type OnSetCode = (); } impl pallet_aura::Config for Runtime { @@ -274,14 +285,14 @@ impl pallet_balances::Config for Runtime { } parameter_types! { - pub const TombstoneDeposit: Balance = deposit( + pub TombstoneDeposit: Balance = deposit( 1, - sp_std::mem::size_of::>() as u32 + >::contract_info_size(), ); - pub const DepositPerContract: Balance = TombstoneDeposit::get(); + pub DepositPerContract: Balance = TombstoneDeposit::get(); pub const DepositPerStorageByte: Balance = deposit(0, 1); pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS); + pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); pub const SurchargeReward: Balance = 150 * MILLICENTS; pub const SignedClaimHandicap: u32 = 2; pub const MaxDepth: u32 = 32; @@ -299,26 +310,26 @@ parameter_types! { } impl pallet_contracts::Config for Runtime { - type ChainExtension = (); + type Time = Timestamp; + type Randomness = RandomnessCollectiveFlip; type Currency = Balances; - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; + type Event = Event; + type RentPayment = (); + type SignedClaimHandicap = SignedClaimHandicap; + type TombstoneDeposit = TombstoneDeposit; type DepositPerContract = DepositPerContract; type DepositPerStorageByte = DepositPerStorageByte; type DepositPerStorageItem = DepositPerStorageItem; - type Event = Event; - type MaxCodeSize = MaxCodeSize; - type MaxDepth = MaxDepth; - type MaxValueSize = MaxValueSize; - type Randomness = RandomnessCollectiveFlip; type RentFraction = RentFraction; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; type SurchargeReward = SurchargeReward; - type Time = Timestamp; - type TombstoneDeposit = TombstoneDeposit; - type WeightInfo = pallet_contracts::weights::SubstrateWeight; + type MaxDepth = MaxDepth; + type MaxValueSize = MaxValueSize; type WeightPrice = pallet_transaction_payment::Module; + type WeightInfo = pallet_contracts::weights::SubstrateWeight; + type ChainExtension = (); + type DeletionQueueDepth = DeletionQueueDepth; + type DeletionWeightLimit = DeletionWeightLimit; + type MaxCodeSize = MaxCodeSize; } parameter_types! { @@ -353,15 +364,8 @@ impl merkle::Config for Runtime { type WeightInfo = MerkleWeights; } -parameter_type_with_key! { - pub ExistentialDepositMap: |k: CurrencyId| -> Balance { - match k { - _ => 2, - } - }; -} - parameter_types! { + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); pub const NativeCurrencyId: CurrencyId = 0; pub const CurrencyDeposit: u64 = 1; pub const ApprovalDeposit: u64 = 1; @@ -372,17 +376,17 @@ parameter_types! { impl tokens::Config for Runtime { + type PalletId = TokensPalletId; type Amount = Amount; type Balance = Balance; type CurrencyId = CurrencyId; type Event = Event; - type ForceOrigin = frame_system::EnsureRoot; + type ForceOrigin = frame_system::EnsureRoot; type CurrencyDeposit = CurrencyDeposit; type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; - type ExistentialDeposits = ExistentialDepositMap; type OnDust = (); type WeightInfo = (); type Extra = (); @@ -397,7 +401,7 @@ impl orml_currencies::Config for Runtime { } parameter_types! { - pub const MixerModuleId: ModuleId = ModuleId(*b"py/mixer"); + pub const MixerPalletId: PalletId = PalletId(*b"py/mixer"); pub const MinimumDepositLength: BlockNumber = 10 * 60 * 24 * 28; pub const DefaultAdminKey: AccountId32 = AccountId32::new([0; 32]); pub MixerSizes: Vec = [ @@ -415,7 +419,7 @@ impl mixer::Config for Runtime { type Event = Event; type Tree = Merkle; type MixerSizes = MixerSizes; - type ModuleId = MixerModuleId; + type PalletId = MixerPalletId; type NativeCurrencyId = NativeCurrencyId; type WeightInfo = MixerWeights; } @@ -424,14 +428,18 @@ impl mixer::Config for Runtime { /// EVM execution over compiled WASM (on 4.4Ghz CPU). /// Given the 500ms Weight, from which 75% only are used for transactions, /// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000. +#[cfg(feature = "frontier")] pub const GAS_PER_SECOND: u64 = 40_000_000; /// Approximate ratio of the amount of Weight per Gas. /// u64 works for approximations because Weight is a very small unit compared to gas. +#[cfg(feature = "frontier")] pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; +#[cfg(feature = "frontier")] pub struct AnonGasWeightMapping; +#[cfg(feature = "frontier")] impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { fn gas_to_weight(gas: u64) -> Weight { gas.saturating_mul(WEIGHT_PER_GAS) @@ -441,12 +449,27 @@ impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { } } +#[cfg(feature = "frontier")] +/// Fixed gas price of `1`. +pub struct FixedGasPrice; + +#[cfg(feature = "frontier")] +impl FeeCalculator for FixedGasPrice { + fn min_gas_price() -> U256 { + // Gas price is always one token per gas. + 1.into() + } +} + +#[cfg(feature = "frontier")] parameter_types! { pub const ChainId: u64 = 42; + pub BlockGasLimit: U256 = U256::from(u32::max_value()); } +#[cfg(feature = "frontier")] impl pallet_evm::Config for Runtime { - type FeeCalculator = (); + type FeeCalculator = FixedGasPrice; type GasWeightMapping = AnonGasWeightMapping; type CallOrigin = EnsureAddressTruncated; type WithdrawOrigin = EnsureAddressTruncated; @@ -459,11 +482,16 @@ impl pallet_evm::Config for Runtime { pallet_evm_precompile_simple::Sha256, pallet_evm_precompile_simple::Ripemd160, pallet_evm_precompile_simple::Identity, + pallet_evm_precompile_simple::ECRecoverPublicKey, + // pallet_evm_precompile_sha3fips::Sha3FIPS256, + // pallet_evm_precompile_sha3fips::Sha3FIPS512, ); type ChainId = ChainId; + type BlockGasLimit = BlockGasLimit; type OnChargeTransaction = (); } +#[cfg(feature = "frontier")] pub struct EthereumFindAuthor(PhantomData); impl> FindAuthor for EthereumFindAuthor { @@ -478,16 +506,11 @@ impl> FindAuthor for EthereumFindAuthor } } -parameter_types! { - pub BlockGasLimit: U256 - = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WEIGHT_PER_GAS); -} - +#[cfg(feature = "frontier")] impl pallet_ethereum::Config for Runtime { type Event = Event; type FindAuthor = EthereumFindAuthor; type StateRoot = pallet_ethereum::IntermediateStateRoot; - type BlockGasLimit = BlockGasLimit; } // Create the runtime by composing the FRAME pallets that were previously @@ -498,34 +521,39 @@ construct_runtime!( NodeBlock = opaque::Block, UncheckedExtrinsic = UncheckedExtrinsic { - System: frame_system::{Module, Call, Config, Storage, Event}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, - Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, - Aura: pallet_aura::{Module, Config}, - Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event}, - Balances: pallet_balances::{Module, Call, Storage, Config, Event}, - Contracts: pallet_contracts::{Module, Call, Config, Storage, Event}, - EVM: pallet_evm::{Module, Config, Call, Storage, Event}, - Ethereum: pallet_ethereum::{Module, Call, Storage, Event, Config, ValidateUnsigned}, - - TransactionPayment: pallet_transaction_payment::{Module, Storage}, - Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, - - Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: tokens::{Module, Storage, Event}, - Mixer: mixer::{Module, Call, Storage, Event}, - Merkle: merkle::{Module, Call, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage}, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + Aura: pallet_aura::{Pallet, Config}, + Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Contracts: pallet_contracts::{Pallet, Call, Config, Storage, Event}, + + #[cfg(feature = "frontier")] + EVM: pallet_evm::{Pallet, Config, Call, Storage, Event}, + #[cfg(feature = "frontier")] + Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, ValidateUnsigned}, + + TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, + + Currencies: orml_currencies::{Pallet, Storage, Event}, + Tokens: tokens::{Pallet, Storage, Event}, + Mixer: mixer::{Pallet, Call, Storage, Event}, + Merkle: merkle::{Pallet, Call, Storage, Event}, } ); pub struct TransactionConverter; +#[cfg(feature = "frontier")] impl fp_rpc::ConvertTransaction for TransactionConverter { fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()) } } +#[cfg(feature = "frontier")] impl fp_rpc::ConvertTransaction for TransactionConverter { fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic { let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); @@ -569,7 +597,7 @@ impl_runtime_apis! { } fn execute_block(block: Block) { - Executive::execute_block(block) + Executive::execute_block(block); } fn initialize_block(header: &::Header) { @@ -592,19 +620,16 @@ impl_runtime_apis! { Executive::finalize_block() } - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { + fn inherent_extrinsics(data: InherentData) -> Vec<::Extrinsic> { data.create_extrinsics() } - fn check_inherents( - block: Block, - data: sp_inherents::InherentData, - ) -> sp_inherents::CheckInherentsResult { + fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { data.check_extrinsics(&block) } fn random_seed() -> ::Hash { - RandomnessCollectiveFlip::random_seed() + RandomnessCollectiveFlip::random_seed().0 } } @@ -624,8 +649,8 @@ impl_runtime_apis! { } impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> u64 { - Aura::slot_duration() + fn slot_duration() -> SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) } fn authorities() -> Vec { @@ -704,6 +729,7 @@ impl_runtime_apis! { } } + #[cfg(feature = "frontier")] impl fp_rpc::EthereumRuntimeRPCApi for Runtime { fn chain_id() -> u64 { ::ChainId::get() @@ -833,7 +859,7 @@ impl_runtime_apis! { ) -> Result, sp_runtime::RuntimeString> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - use frame_system_benchmarking::Module as SystemBench; + use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime {} let whitelist: Vec = vec![ From 843e39451e09445bddca9bf07e66994426d849d2 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 12 Apr 2021 01:37:44 +0300 Subject: [PATCH 05/14] [wip] comment out frontier for now --- Cargo.lock | 2282 ++++++------------------------------- node/Cargo.toml | 18 +- node/src/chain_spec.rs | 23 +- node/src/rpc.rs | 36 +- pallets/merkle/Cargo.toml | 3 +- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 460 ++++---- 7 files changed, 595 insertions(+), 2229 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0c2a4ef..e5a82477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1561,118 +1561,6 @@ dependencies = [ "instant", ] -[[package]] -name = "fc-consensus" -version = "1.0.0" -source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" -dependencies = [ - "derive_more", - "fc-db", - "fp-consensus", - "fp-rpc", - "futures 0.3.13", - "log", - "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - -[[package]] -name = "fc-db" -version = "1.0.0" -source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" -dependencies = [ - "kvdb", - "kvdb-rocksdb", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - -[[package]] -name = "fc-mapping-sync" -version = "1.0.0" -source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" -dependencies = [ - "fc-consensus", - "fc-db", - "fp-consensus", - "fp-rpc", - "futures 0.3.13", - "futures-timer 3.0.2", - "log", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - -[[package]] -name = "fc-rpc" -version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" -dependencies = [ - "ethereum", - "ethereum-types", - "evm", - "fc-consensus", - "fc-db", - "fc-rpc-core", - "fp-consensus", - "fp-evm", - "fp-rpc", - "fp-storage", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 14.2.0", - "jsonrpc-derive 14.2.2", - "jsonrpc-pubsub 15.1.0", - "libsecp256k1", - "log", - "pallet-ethereum", - "pallet-evm", - "parity-scale-codec 2.1.0", - "rand 0.7.3", - "rlp", - "rustc-hex", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sha3 0.8.2", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - -[[package]] -name = "fc-rpc-core" -version = "1.0.0" -source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" -dependencies = [ - "ethereum-types", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 14.2.0", - "jsonrpc-derive 14.2.2", - "jsonrpc-pubsub 15.1.0", - "rustc-hex", - "serde", - "serde_json", -] - [[package]] name = "fdlimit" version = "0.2.1" @@ -1744,14 +1632,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", -] - [[package]] name = "fork-tree" version = "3.0.0" @@ -1877,9 +1757,9 @@ dependencies = [ "handlebars", "parity-scale-codec 2.1.0", "sc-cli", - "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-db", + "sc-executor", + "sc-service", "serde", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -2762,22 +2642,6 @@ dependencies = [ "libc", ] -[[package]] -name = "if-watch" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b8538953a3f0d0d3868f0a706eb4273535e10d72acb5c82c1c23ae48835c85" -dependencies = [ - "async-io", - "futures 0.3.13", - "futures-lite", - "if-addrs", - "ipnet", - "libc", - "log", - "winapi 0.3.9", -] - [[package]] name = "if-watch" version = "0.2.0" @@ -2957,22 +2821,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpc-client-transports" -version = "14.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ec" -dependencies = [ - "failure", - "futures 0.1.31", - "jsonrpc-core 14.2.0", - "jsonrpc-pubsub 14.2.0", - "log", - "serde", - "serde_json", - "url 1.7.2", -] - [[package]] name = "jsonrpc-client-transports" version = "15.1.0" @@ -2981,27 +2829,14 @@ checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", "futures 0.1.31", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "serde", "serde_json", "url 1.7.2", ] -[[package]] -name = "jsonrpc-core" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" -dependencies = [ - "futures 0.1.31", - "log", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "jsonrpc-core" version = "15.1.0" @@ -3015,34 +2850,13 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonrpc-core-client" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" -dependencies = [ - "jsonrpc-client-transports 14.2.1", -] - [[package]] name = "jsonrpc-core-client" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" dependencies = [ - "jsonrpc-client-transports 15.1.0", -] - -[[package]] -name = "jsonrpc-derive" -version = "14.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" -dependencies = [ - "proc-macro-crate 0.1.5", - "proc-macro2", - "quote", - "syn", + "jsonrpc-client-transports", ] [[package]] @@ -3064,7 +2878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ "hyper 0.12.36", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "net2", @@ -3078,7 +2892,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-tokio-ipc", @@ -3086,26 +2900,13 @@ dependencies = [ "tokio-service", ] -[[package]] -name = "jsonrpc-pubsub" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" -dependencies = [ - "jsonrpc-core 14.2.0", - "log", - "parking_lot 0.10.2", - "rand 0.7.3", - "serde", -] - [[package]] name = "jsonrpc-pubsub" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "log", "parking_lot 0.10.2", "rand 0.7.3", @@ -3120,7 +2921,7 @@ checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" dependencies = [ "bytes 0.4.12", "globset", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "lazy_static", "log", "tokio 0.1.22", @@ -3134,7 +2935,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-ws", @@ -3249,44 +3050,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" -[[package]] -name = "libp2p" -version = "0.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc225a49973cf9ab10d0cdd6a4b8f0cda299df9b760824bbb623f15f8f0c95a" -dependencies = [ - "atomic", - "bytes 1.0.1", - "futures 0.3.13", - "lazy_static", - "libp2p-core 0.27.1", - "libp2p-deflate 0.27.1", - "libp2p-dns 0.27.0", - "libp2p-floodsub 0.27.0", - "libp2p-gossipsub 0.28.0", - "libp2p-identify 0.27.0", - "libp2p-kad 0.28.1", - "libp2p-mdns 0.28.1", - "libp2p-mplex 0.27.1", - "libp2p-noise 0.29.0", - "libp2p-ping 0.27.0", - "libp2p-plaintext 0.27.1", - "libp2p-pnet", - "libp2p-request-response 0.9.1", - "libp2p-swarm 0.27.2", - "libp2p-swarm-derive", - "libp2p-tcp 0.27.1", - "libp2p-uds 0.27.0", - "libp2p-wasm-ext 0.27.0", - "libp2p-websocket 0.28.0", - "libp2p-yamux 0.30.1", - "parity-multiaddr", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "smallvec 1.6.1", - "wasm-timer", -] - [[package]] name = "libp2p" version = "0.36.0" @@ -3297,28 +3060,28 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.13", "lazy_static", - "libp2p-core 0.28.1", - "libp2p-deflate 0.28.0", - "libp2p-dns 0.28.1", - "libp2p-floodsub 0.28.0", - "libp2p-gossipsub 0.29.0", - "libp2p-identify 0.28.0", - "libp2p-kad 0.29.0", - "libp2p-mdns 0.29.0", - "libp2p-mplex 0.28.0", - "libp2p-noise 0.30.0", - "libp2p-ping 0.28.0", - "libp2p-plaintext 0.28.0", + "libp2p-core", + "libp2p-deflate", + "libp2p-dns", + "libp2p-floodsub", + "libp2p-gossipsub", + "libp2p-identify", + "libp2p-kad", + "libp2p-mdns", + "libp2p-mplex", + "libp2p-noise", + "libp2p-ping", + "libp2p-plaintext", "libp2p-pnet", "libp2p-relay", - "libp2p-request-response 0.10.0", - "libp2p-swarm 0.28.0", + "libp2p-request-response", + "libp2p-swarm", "libp2p-swarm-derive", - "libp2p-tcp 0.28.0", - "libp2p-uds 0.28.0", - "libp2p-wasm-ext 0.28.1", - "libp2p-websocket 0.29.0", - "libp2p-yamux 0.31.0", + "libp2p-tcp", + "libp2p-uds", + "libp2p-wasm-ext", + "libp2p-websocket", + "libp2p-yamux", "parity-multiaddr", "parking_lot 0.11.1", "pin-project 1.0.6", @@ -3326,40 +3089,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p-core" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" -dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures 0.3.13", - "futures-timer 3.0.2", - "lazy_static", - "libsecp256k1", - "log", - "multihash", - "multistream-select", - "parity-multiaddr", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "prost", - "prost-build", - "rand 0.7.3", - "ring", - "rw-stream-sink", - "sha2 0.9.3", - "smallvec 1.6.1", - "thiserror", - "unsigned-varint 0.7.0", - "void", - "zeroize", -] - [[package]] name = "libp2p-core" version = "0.28.1" @@ -3394,17 +3123,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-deflate" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345" -dependencies = [ - "flate2", - "futures 0.3.13", - "libp2p-core 0.27.1", -] - [[package]] name = "libp2p-deflate" version = "0.28.0" @@ -3413,18 +3131,7 @@ checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" dependencies = [ "flate2", "futures 0.3.13", - "libp2p-core 0.28.1", -] - -[[package]] -name = "libp2p-dns" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" -dependencies = [ - "futures 0.3.13", - "libp2p-core 0.27.1", - "log", + "libp2p-core", ] [[package]] @@ -3435,30 +3142,12 @@ checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" dependencies = [ "async-std-resolver", "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "log", "smallvec 1.6.1", "trust-dns-resolver", ] -[[package]] -name = "libp2p-floodsub" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c63dfa06581b24b1d12bf9815b43689a784424be217d6545c800c7c75a207f" -dependencies = [ - "cuckoofilter", - "fnv", - "futures 0.3.13", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec 1.6.1", -] - [[package]] name = "libp2p-floodsub" version = "0.28.0" @@ -3468,39 +3157,13 @@ dependencies = [ "cuckoofilter", "fnv", "futures 0.3.13", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec 1.6.1", -] - -[[package]] -name = "libp2p-gossipsub" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502dc5fcbfec4aa1c63ef3f7307ffe20e90c1a1387bf23ed0bec087f2dde58a1" -dependencies = [ - "asynchronous-codec 0.6.0", - "base64 0.13.0", - "byteorder", - "bytes 1.0.1", - "fnv", - "futures 0.3.13", - "hex_fmt", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", + "libp2p-core", + "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "regex", - "sha2 0.9.3", "smallvec 1.6.1", - "unsigned-varint 0.7.0", - "wasm-timer", ] [[package]] @@ -3516,8 +3179,8 @@ dependencies = [ "fnv", "futures 0.3.13", "hex_fmt", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "prost", "prost-build", @@ -3531,13 +3194,13 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" +checksum = "f88ebc841d744979176ab4b8b294a3e655a7ba4ef26a905d073a52b49ed4dff5" dependencies = [ "futures 0.3.13", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", + "libp2p-core", + "libp2p-swarm", "log", "prost", "prost-build", @@ -3545,48 +3208,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p-identify" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88ebc841d744979176ab4b8b294a3e655a7ba4ef26a905d073a52b49ed4dff5" -dependencies = [ - "futures 0.3.13", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", - "log", - "prost", - "prost-build", - "smallvec 1.6.1", - "wasm-timer", -] - -[[package]] -name = "libp2p-kad" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3da6c9acbcc05f93235d201d7d45ef4e8b88a45d8836f98becd8b4d443f066" -dependencies = [ - "arrayvec 0.5.2", - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "either", - "fnv", - "futures 0.3.13", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.9.3", - "smallvec 1.6.1", - "uint", - "unsigned-varint 0.7.0", - "void", - "wasm-timer", -] - [[package]] name = "libp2p-kad" version = "0.29.0" @@ -3599,8 +3220,8 @@ dependencies = [ "either", "fnv", "futures 0.3.13", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "prost", "prost-build", @@ -3613,27 +3234,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p-mdns" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9e6374814d1b118d97ccabdfc975c8910bd16dc38a8bc058eeb08bf2080fe1" -dependencies = [ - "async-io", - "data-encoding", - "dns-parser", - "futures 0.3.13", - "if-watch 0.1.8", - "lazy_static", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", - "log", - "rand 0.7.3", - "smallvec 1.6.1", - "socket2 0.3.19", - "void", -] - [[package]] name = "libp2p-mdns" version = "0.29.0" @@ -3644,10 +3244,10 @@ dependencies = [ "data-encoding", "dns-parser", "futures 0.3.13", - "if-watch 0.2.0", + "if-watch", "lazy_static", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "rand 0.8.3", "smallvec 1.6.1", @@ -3655,24 +3255,6 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-mplex" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350ce8b3923594aedabd5d6e3f875d058435052a29c3f32df378bc70d10be464" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures 0.3.13", - "libp2p-core 0.27.1", - "log", - "nohash-hasher", - "parking_lot 0.11.1", - "rand 0.7.3", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", -] - [[package]] name = "libp2p-mplex" version = "0.28.0" @@ -3682,7 +3264,7 @@ dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -3691,28 +3273,6 @@ dependencies = [ "unsigned-varint 0.7.0", ] -[[package]] -name = "libp2p-noise" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aca322b52a0c5136142a7c3971446fb1e9964923a526c9cc6ef3b7c94e57778" -dependencies = [ - "bytes 1.0.1", - "curve25519-dalek 3.0.2", - "futures 0.3.13", - "lazy_static", - "libp2p-core 0.27.1", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.9.3", - "snow", - "static_assertions", - "x25519-dalek", - "zeroize", -] - [[package]] name = "libp2p-noise" version = "0.30.0" @@ -3723,7 +3283,7 @@ dependencies = [ "curve25519-dalek 3.0.2", "futures 0.3.13", "lazy_static", - "libp2p-core 0.28.1", + "libp2p-core", "log", "prost", "prost-build", @@ -3735,21 +3295,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-ping" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3813276d0708c8db0f500d8beda1bda9ad955723b9cb272c41f4727256f73c" -dependencies = [ - "futures 0.3.13", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", - "log", - "rand 0.7.3", - "void", - "wasm-timer", -] - [[package]] name = "libp2p-ping" version = "0.28.0" @@ -3757,31 +3302,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea10fc5209260915ea65b78f612d7ff78a29ab288e7aa3250796866af861c45" dependencies = [ "futures 0.3.13", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "rand 0.7.3", "void", "wasm-timer", ] -[[package]] -name = "libp2p-plaintext" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d58defcadb646ae4b033e130b48d87410bf76394dc3335496cae99dac803e61" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures 0.3.13", - "libp2p-core 0.27.1", - "log", - "prost", - "prost-build", - "unsigned-varint 0.7.0", - "void", -] - [[package]] name = "libp2p-plaintext" version = "0.28.0" @@ -3791,7 +3319,7 @@ dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "log", "prost", "prost-build", @@ -3823,8 +3351,8 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.13", "futures-timer 3.0.2", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "pin-project 1.0.6", "prost", @@ -3836,26 +3364,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p-request-response" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e5552827c33d8326502682da73a0ba4bfa40c1b55b216af3c303f32169dd89" -dependencies = [ - "async-trait", - "bytes 1.0.1", - "futures 0.3.13", - "libp2p-core 0.27.1", - "libp2p-swarm 0.27.2", - "log", - "lru", - "minicbor 0.7.2", - "rand 0.7.3", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", - "wasm-timer", -] - [[package]] name = "libp2p-request-response" version = "0.10.0" @@ -3865,33 +3373,17 @@ dependencies = [ "async-trait", "bytes 1.0.1", "futures 0.3.13", - "libp2p-core 0.28.1", - "libp2p-swarm 0.28.0", + "libp2p-core", + "libp2p-swarm", "log", "lru", - "minicbor 0.8.0", + "minicbor", "rand 0.7.3", "smallvec 1.6.1", "unsigned-varint 0.7.0", "wasm-timer", ] -[[package]] -name = "libp2p-swarm" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" -dependencies = [ - "either", - "futures 0.3.13", - "libp2p-core 0.27.1", - "log", - "rand 0.7.3", - "smallvec 1.6.1", - "void", - "wasm-timer", -] - [[package]] name = "libp2p-swarm" version = "0.28.0" @@ -3900,7 +3392,7 @@ checksum = "75c26980cadd7c25d89071cb23e1f7f5df4863128cc91d83c6ddc72338cecafa" dependencies = [ "either", "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "log", "rand 0.7.3", "smallvec 1.6.1", @@ -3918,23 +3410,6 @@ dependencies = [ "syn", ] -[[package]] -name = "libp2p-tcp" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" -dependencies = [ - "async-io", - "futures 0.3.13", - "futures-timer 3.0.2", - "if-watch 0.1.8", - "ipnet", - "libc", - "libp2p-core 0.27.1", - "log", - "socket2 0.3.19", -] - [[package]] name = "libp2p-tcp" version = "0.28.0" @@ -3944,26 +3419,14 @@ dependencies = [ "async-io", "futures 0.3.13", "futures-timer 3.0.2", - "if-watch 0.2.0", + "if-watch", "ipnet", "libc", - "libp2p-core 0.28.1", + "libp2p-core", "log", "socket2 0.4.0", ] -[[package]] -name = "libp2p-uds" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ac51ce419f60be966e02103c17f67ff5dc4422ba83ba54d251d6c62a4ed487" -dependencies = [ - "async-std", - "futures 0.3.13", - "libp2p-core 0.27.1", - "log", -] - [[package]] name = "libp2p-uds" version = "0.28.0" @@ -3972,24 +3435,10 @@ checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" dependencies = [ "async-std", "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "log", ] -[[package]] -name = "libp2p-wasm-ext" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6149c46cb76935c80bc8be6ec6e3ebd5f5e1679765a255fb34331d54610f15dd" -dependencies = [ - "futures 0.3.13", - "js-sys", - "libp2p-core 0.27.1", - "parity-send-wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "libp2p-wasm-ext" version = "0.28.1" @@ -3998,30 +3447,12 @@ checksum = "cef45d61e43c313531b5e903e4e8415212ff6338e0c54c47da5b9b412b5760de" dependencies = [ "futures 0.3.13", "js-sys", - "libp2p-core 0.28.1", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-websocket" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b1c6a3431045da8b925ed83384e4c5163e14b990572307fca9c507435d4d22" -dependencies = [ - "either", - "futures 0.3.13", - "futures-rustls", - "libp2p-core 0.27.1", - "log", - "quicksink", - "rw-stream-sink", - "soketto", - "url 2.2.1", - "webpki-roots", -] - [[package]] name = "libp2p-websocket" version = "0.29.0" @@ -4031,7 +3462,7 @@ dependencies = [ "either", "futures 0.3.13", "futures-rustls", - "libp2p-core 0.28.1", + "libp2p-core", "log", "quicksink", "rw-stream-sink", @@ -4040,19 +3471,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "libp2p-yamux" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4819358c542a86ff95f6ae691efb4b94ddaf477079b01a686f5705b79bfc232a" -dependencies = [ - "futures 0.3.13", - "libp2p-core 0.27.1", - "parking_lot 0.11.1", - "thiserror", - "yamux", -] - [[package]] name = "libp2p-yamux" version = "0.31.0" @@ -4060,7 +3478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d6144cc94143fb0a8dd1e7c2fbcc32a2808168bcd1d69920635424d5993b7b" dependencies = [ "futures 0.3.13", - "libp2p-core 0.28.1", + "libp2p-core", "parking_lot 0.11.1", "thiserror", "yamux", @@ -4298,15 +3716,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "minicbor" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b2c73f9640fccab53947e2b3474d5071fcbc8f82cac51ddf6c8041a30a9ea" -dependencies = [ - "minicbor-derive", -] - [[package]] name = "minicbor" version = "0.8.0" @@ -4549,52 +3958,43 @@ dependencies = [ name = "node-template" version = "3.0.0" dependencies = [ - "fc-consensus", - "fc-db", - "fc-mapping-sync", - "fc-rpc", - "fc-rpc-core", - "fp-consensus", - "fp-rpc", "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-benchmarking-cli", "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "node-template-runtime", "pallet-contracts-rpc", - "pallet-ethereum", - "pallet-evm", "pallet-merkle", "pallet-merkle-rpc", "pallet-transaction-payment-rpc", "sc-basic-authorship", - "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-chain-spec", "sc-cli", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-consensus", "sc-consensus-aura", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor", + "sc-finality-grandpa", "sc-finality-grandpa-rpc", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-keystore", + "sc-network", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-telemetry", + "sc-transaction-pool", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", "sp-consensus-aura", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", "structopt", "substrate-build-script-utils", "substrate-frame-rpc-system", @@ -4635,15 +4035,15 @@ dependencies = [ "parity-scale-codec 2.1.0", "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", "sp-consensus-aura", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "static_assertions", "substrate-wasm-builder-runner", @@ -4876,7 +4276,7 @@ dependencies = [ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", "parity-scale-codec 2.1.0", - "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-authorship", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -4960,17 +4360,17 @@ name = "pallet-contracts-rpc" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", "parity-scale-codec 2.1.0", "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] @@ -5066,9 +4466,9 @@ dependencies = [ "serde", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] @@ -5089,6 +4489,7 @@ dependencies = [ "rand_core 0.5.1", "serde", "sha2 0.9.3", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -5100,16 +4501,16 @@ dependencies = [ name = "pallet-merkle-rpc" version = "3.0.0" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-merkle", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-rpc", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -5164,7 +4565,7 @@ dependencies = [ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -5261,15 +4662,15 @@ name = "pallet-transaction-payment-rpc" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec 2.1.0", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] @@ -6455,34 +5856,18 @@ dependencies = [ "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-client-api", "sc-proposer-metrics", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-telemetry", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-block-builder" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-transaction-pool", + "substrate-prometheus-endpoint", ] [[package]] @@ -6491,37 +5876,16 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-chain-spec" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.1.0", - "sc-chain-spec-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde", - "serde_json", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-chain-spec" version = "3.0.0" @@ -6529,16 +5893,16 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec 2.1.0", - "sc-chain-spec-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-chain-spec-derive", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-finality-grandpa", + "sc-network", + "sc-telemetry", "serde", "serde_json", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-chain-spec", + "sp-consensus-babe", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] @@ -6546,7 +5910,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -6555,47 +5919,36 @@ dependencies = [ ] [[package]] -name = "sc-chain-spec-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sc-cli" -version = "0.9.0" +name = "sc-cli" +version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "chrono", "fdlimit", "futures 0.3.13", "hex", - "libp2p 0.36.0", + "libp2p", "log", "names", "parity-scale-codec 2.1.0", "rand 0.7.3", "regex", "rpassword", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-service 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-keystore", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", "serde", "serde_json", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keyring", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", "thiserror", @@ -6603,40 +5956,6 @@ dependencies = [ "tokio 0.2.25", ] -[[package]] -name = "sc-client-api" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "fnv", - "futures 0.3.13", - "hash-db", - "kvdb", - "lazy_static", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-client-api" version = "3.0.0" @@ -6651,12 +5970,12 @@ dependencies = [ "log", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-database", "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -6664,41 +5983,11 @@ dependencies = [ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-client-db" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "blake2-rfc", - "hash-db", - "kvdb", - "kvdb-memorydb", - "kvdb-rocksdb", - "linked-hash-map", - "log", - "parity-db", - "parity-scale-codec 2.1.0", - "parity-util-mem", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-state-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint", ] [[package]] @@ -6717,29 +6006,18 @@ dependencies = [ "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-state-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-executor", + "sc-state-db", "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-database", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-consensus" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint", ] [[package]] @@ -6748,9 +6026,9 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sp-blockchain", + "sp-consensus", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] @@ -6765,17 +6043,17 @@ dependencies = [ "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-client-api", + "sc-consensus-slots", + "sc-telemetry", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", "sp-consensus-aura", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus-slots", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -6783,53 +6061,7 @@ dependencies = [ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-consensus-babe" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "futures 0.3.13", - "futures-timer 3.0.2", - "log", - "merlin", - "num-bigint", - "num-rational 0.2.4", - "num-traits", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "pdqselect", - "rand 0.7.3", - "retain_mut", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus-uncles 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "schnorrkel", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint", ] [[package]] @@ -6839,7 +6071,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "async-trait", "derive_more", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "fork-tree", "futures 0.3.13", "futures-timer 3.0.2", "log", @@ -6852,44 +6084,31 @@ dependencies = [ "pdqselect", "rand 0.7.3", "retain_mut", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-epochs 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus-uncles 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-consensus-uncles", + "sc-keystore", + "sc-telemetry", "schnorrkel", "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-babe 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-consensus-vrf", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-consensus-epochs" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint", ] [[package]] @@ -6897,40 +6116,14 @@ name = "sc-consensus-epochs" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "fork-tree", "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-consensus", + "sp-blockchain", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-consensus-slots" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "futures-timer 3.0.2", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", -] - [[package]] name = "sc-consensus-slots" version = "0.9.0" @@ -6941,14 +6134,14 @@ dependencies = [ "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-telemetry", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -6958,62 +6151,20 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sc-consensus-uncles" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "log", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-consensus-uncles" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sp-authorship", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-executor" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "lazy_static", - "libsecp256k1", - "log", - "parity-scale-codec 2.1.0", - "parity-wasm", - "parking_lot 0.11.1", - "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-executor-wasmi 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-tasks 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "wasmi", -] - [[package]] name = "sc-executor" version = "0.9.0" @@ -7026,8 +6177,8 @@ dependencies = [ "parity-scale-codec 2.1.0", "parity-wasm", "parking_lot 0.11.1", - "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor-wasmi 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor-common", + "sc-executor-wasmi", "sc-executor-wasmtime", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -7036,30 +6187,14 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-tasks 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-serializer", + "sp-tasks", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] -[[package]] -name = "sc-executor-common" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "parity-scale-codec 2.1.0", - "parity-wasm", - "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", - "wasmi", -] - [[package]] name = "sc-executor-common" version = "0.9.0" @@ -7069,29 +6204,14 @@ dependencies = [ "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.14.0", - "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-allocator", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-serializer 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-serializer", "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "wasmi", ] -[[package]] -name = "sc-executor-wasmi" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "log", - "parity-scale-codec 2.1.0", - "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "wasmi", -] - [[package]] name = "sc-executor-wasmi" version = "0.9.0" @@ -7099,8 +6219,8 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "log", "parity-scale-codec 2.1.0", - "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor-common", + "sp-allocator", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -7116,54 +6236,15 @@ dependencies = [ "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.14.0", - "sc-executor-common 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-executor-common", "scoped-tls", - "sp-allocator 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-allocator", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "dyn-clone", - "finality-grandpa", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "futures 0.3.13", - "futures-timer 3.0.2", - "linked-hash-map", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network-gossip 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde_json", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-finality-grandpa" version = "0.9.0" @@ -7173,7 +6254,7 @@ dependencies = [ "derive_more", "dyn-clone", "finality-grandpa", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "fork-tree", "futures 0.3.13", "futures-timer 3.0.2", "linked-hash-map", @@ -7182,26 +6263,26 @@ dependencies = [ "parking_lot 0.11.1", "pin-project 1.0.6", "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network-gossip 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-gossip", + "sc-telemetry", "serde_json", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-finality-grandpa 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-finality-grandpa", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", + "substrate-prometheus-endpoint", ] [[package]] @@ -7212,40 +6293,22 @@ dependencies = [ "derive_more", "finality-grandpa", "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", "log", "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-finality-grandpa 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-finality-grandpa", + "sc-rpc", "serde", "serde_json", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-informant" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "ansi_term 0.12.1", - "futures 0.3.13", - "log", - "parity-util-mem", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "wasm-timer", -] - [[package]] name = "sc-informant" version = "0.9.0" @@ -7255,19 +6318,19 @@ dependencies = [ "futures 0.3.13", "log", "parity-util-mem", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-network", + "sp-blockchain", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", + "sp-utils", "wasm-timer", ] [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", "derive_more", @@ -7278,53 +6341,14 @@ dependencies = [ "parking_lot 0.11.1", "rand 0.7.3", "serde_json", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "subtle 2.4.0", ] [[package]] -name = "sc-keystore" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" -dependencies = [ - "async-trait", - "derive_more", - "futures 0.3.13", - "futures-util", - "hex", - "merlin", - "parking_lot 0.11.1", - "rand 0.7.3", - "serde_json", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "subtle 2.4.0", -] - -[[package]] -name = "sc-light" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "hash-db", - "lazy_static", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - -[[package]] -name = "sc-light" +name = "sc-light" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ @@ -7332,69 +6356,16 @@ dependencies = [ "lazy_static", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-executor", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-network" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "async-std", - "async-trait", - "asynchronous-codec 0.5.0", - "bitflags", - "bs58", - "bytes 1.0.1", - "cid", - "derive_more", - "either", - "erased-serde", - "fnv", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "futures 0.3.13", - "futures-timer 3.0.2", - "hex", - "ip_network", - "libp2p 0.35.1", - "linked-hash-map", - "linked_hash_set", - "log", - "lru", - "nohash-hasher", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "prost", - "prost-build", - "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-peerset 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde", - "serde_json", - "smallvec 1.6.1", - "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", - "unsigned-varint 0.6.0", - "void", - "wasm-timer", - "zeroize", -] - [[package]] name = "sc-network" version = "0.9.0" @@ -7411,12 +6382,12 @@ dependencies = [ "either", "erased-serde", "fnv", - "fork-tree 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "fork-tree", "futures 0.3.13", "futures-timer 3.0.2", "hex", "ip_network", - "libp2p 0.36.0", + "libp2p", "linked-hash-map", "linked_hash_set", "log", @@ -7428,19 +6399,19 @@ dependencies = [ "prost", "prost-build", "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-peerset 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-client-api", + "sc-peerset", "serde", "serde_json", "smallvec 1.6.1", "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", + "substrate-prometheus-endpoint", "thiserror", "unsigned-varint 0.6.0", "void", @@ -7448,22 +6419,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sc-network-gossip" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "futures-timer 3.0.2", - "libp2p 0.35.1", - "log", - "lru", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "wasm-timer", -] - [[package]] name = "sc-network-gossip" version = "0.9.0" @@ -7471,44 +6426,16 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", - "libp2p 0.36.0", + "libp2p", "log", "lru", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-network", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint", "tracing", "wasm-timer", ] -[[package]] -name = "sc-offchain" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures 0.3.13", - "futures-timer 3.0.2", - "hex", - "hyper 0.13.10", - "hyper-rustls", - "log", - "num_cpus", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "rand 0.7.3", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "threadpool", -] - [[package]] name = "sc-offchain" version = "3.0.0" @@ -7526,40 +6453,27 @@ dependencies = [ "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "rand 0.7.3", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-keystore", + "sc-network", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "threadpool", ] -[[package]] -name = "sc-peerset" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "libp2p 0.35.1", - "log", - "serde_json", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "wasm-timer", -] - [[package]] name = "sc-peerset" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.3.13", - "libp2p 0.36.0", + "libp2p", "log", "serde_json", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "wasm-timer", ] @@ -7569,41 +6483,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-rpc" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde_json", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-prometheus-endpoint", ] [[package]] @@ -7613,57 +6493,33 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "futures 0.3.13", "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-client-api", + "sc-executor", + "sc-keystore", + "sc-rpc-api", + "sc-tracing", "serde_json", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", + "sp-chain-spec", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-offchain", + "sp-rpc", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-rpc-api" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", - "jsonrpc-pubsub 15.1.0", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "serde", - "serde_json", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-rpc-api" version = "0.9.0" @@ -7671,120 +6527,39 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "derive_more", "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", "log", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "serde", "serde_json", - "sp-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-chain-spec", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-rpc", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sc-rpc-server" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.1.31", - "jsonrpc-core 15.1.0", - "jsonrpc-http-server", - "jsonrpc-ipc-server", - "jsonrpc-pubsub 15.1.0", - "jsonrpc-ws-server", - "log", - "serde", - "serde_json", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sc-rpc-server" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.1.31", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-pubsub", "jsonrpc-ws-server", "log", "serde", "serde_json", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "sc-service" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "directories", - "exit-future", - "futures 0.1.31", - "futures 0.3.13", - "futures-timer 3.0.2", - "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", - "lazy_static", - "log", - "parity-scale-codec 2.1.0", - "parity-util-mem", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-informant 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-light 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-rpc-server 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde", - "serde_json", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "tempfile", - "thiserror", - "tracing", - "tracing-futures", - "wasm-timer", + "substrate-prometheus-endpoint", ] [[package]] @@ -7799,8 +6574,8 @@ dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "lazy_static", "log", "parity-scale-codec 2.1.0", @@ -7808,42 +6583,42 @@ dependencies = [ "parking_lot 0.11.1", "pin-project 1.0.6", "rand 0.7.3", - "sc-block-builder 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-chain-spec 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-client-db 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-executor 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-informant 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-keystore 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-light 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-network 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-offchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc-server 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-telemetry 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-light", + "sc-network", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", "serde", "serde_json", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-session 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint", "tempfile", "thiserror", "tracing", @@ -7851,21 +6626,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "sc-state-db" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "log", - "parity-scale-codec 2.1.0", - "parity-util-mem", - "parity-util-mem-derive", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", -] - [[package]] name = "sc-state-db" version = "0.9.0" @@ -7876,31 +6636,11 @@ dependencies = [ "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] -[[package]] -name = "sc-telemetry" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "chrono", - "futures 0.3.13", - "libp2p 0.35.1", - "log", - "parking_lot 0.11.1", - "pin-project 1.0.6", - "rand 0.7.3", - "serde", - "serde_json", - "take_mut", - "thiserror", - "void", - "wasm-timer", -] - [[package]] name = "sc-telemetry" version = "3.0.0" @@ -7908,7 +6648,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "chrono", "futures 0.3.13", - "libp2p 0.36.0", + "libp2p", "log", "parking_lot 0.11.1", "pin-project 1.0.6", @@ -7921,33 +6661,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "sc-tracing" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "ansi_term 0.12.1", - "atty", - "erased-serde", - "lazy_static", - "log", - "once_cell", - "parking_lot 0.11.1", - "regex", - "rustc-hash", - "sc-tracing-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "serde", - "serde_json", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "sc-tracing" version = "3.0.0" @@ -7962,7 +6675,7 @@ dependencies = [ "parking_lot 0.11.1", "regex", "rustc-hash", - "sc-tracing-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-tracing-proc-macro", "serde", "serde_json", "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -7975,17 +6688,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "sc-tracing-proc-macro" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" @@ -7997,28 +6699,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sc-transaction-graph" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "futures 0.3.13", - "linked-hash-map", - "log", - "parity-util-mem", - "parking_lot 0.11.1", - "retain_mut", - "serde", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", - "wasm-timer", -] - [[package]] name = "sc-transaction-graph" version = "3.0.0" @@ -8027,42 +6707,16 @@ dependencies = [ "derive_more", "futures 0.3.13", "linked-hash-map", - "log", - "parity-util-mem", - "parking_lot 0.11.1", - "retain_mut", - "serde", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sc-transaction-pool" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "futures-diagnose", - "intervalier", - "log", - "parity-scale-codec 2.1.0", - "parity-util-mem", - "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sc-transaction-graph 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "log", + "parity-util-mem", + "parking_lot 0.11.1", + "retain_mut", + "serde", + "sp-blockchain", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", + "sp-utils", "thiserror", "wasm-timer", ] @@ -8079,16 +6733,16 @@ dependencies = [ "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-transaction-graph 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-transaction-graph", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-transaction-pool", + "sp-utils", + "substrate-prometheus-endpoint", "thiserror", "wasm-timer", ] @@ -8445,18 +7099,6 @@ dependencies = [ "sha-1 0.9.4", ] -[[package]] -name = "sp-allocator" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "log", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", -] - [[package]] name = "sp-allocator" version = "3.0.0" @@ -8578,17 +7220,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-authorship" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-authorship" version = "3.0.0" @@ -8600,18 +7231,6 @@ dependencies = [ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-block-builder" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-block-builder" version = "3.0.0" @@ -8624,24 +7243,6 @@ dependencies = [ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-blockchain" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "log", - "lru", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", -] - [[package]] name = "sp-blockchain" version = "3.0.0" @@ -8653,22 +7254,13 @@ dependencies = [ "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-database 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus", + "sp-database", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] -[[package]] -name = "sp-chain-spec" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "sp-chain-spec" version = "3.0.0" @@ -8678,32 +7270,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "sp-consensus" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "futures-timer 3.0.2", - "libp2p 0.35.1", - "log", - "parity-scale-codec 2.1.0", - "parking_lot 0.11.1", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", - "wasm-timer", -] - [[package]] name = "sp-consensus" version = "0.9.0" @@ -8712,7 +7278,7 @@ dependencies = [ "async-trait", "futures 0.3.13", "futures-timer 3.0.2", - "libp2p 0.36.0", + "libp2p", "log", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", @@ -8724,9 +7290,9 @@ dependencies = [ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-utils 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-utils", "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "substrate-prometheus-endpoint 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "substrate-prometheus-endpoint", "thiserror", "wasm-timer", ] @@ -8739,35 +7305,14 @@ dependencies = [ "parity-scale-codec 2.1.0", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus", + "sp-consensus-slots", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-consensus-babe" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "merlin", - "parity-scale-codec 2.1.0", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-consensus-babe" version = "0.9.0" @@ -8778,9 +7323,9 @@ dependencies = [ "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-slots 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-consensus-vrf 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus", + "sp-consensus-slots", + "sp-consensus-vrf", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -8789,16 +7334,6 @@ dependencies = [ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-consensus-slots" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-consensus-slots" version = "0.9.0" @@ -8809,18 +7344,6 @@ dependencies = [ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-consensus-vrf" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "schnorrkel", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-consensus-vrf" version = "0.9.0" @@ -8921,15 +7444,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sp-database" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "kvdb", - "parking_lot 0.11.1", -] - [[package]] name = "sp-database" version = "3.0.0" @@ -8981,23 +7495,6 @@ dependencies = [ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-finality-grandpa" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec 2.1.0", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-finality-grandpa" version = "3.0.0" @@ -9110,7 +7607,6 @@ dependencies = [ "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "schnorrkel", - "serde", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] @@ -9141,16 +7637,6 @@ dependencies = [ "zstd", ] -[[package]] -name = "sp-offchain" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-offchain" version = "3.0.0" @@ -9177,15 +7663,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "sp-rpc" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-rpc" version = "3.0.0" @@ -9308,15 +7785,6 @@ dependencies = [ "wasmi", ] -[[package]] -name = "sp-serializer" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "sp-serializer" version = "3.0.0" @@ -9326,19 +7794,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "sp-session" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "parity-scale-codec 2.1.0", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-session" version = "3.0.0" @@ -9458,19 +7913,6 @@ dependencies = [ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] -[[package]] -name = "sp-tasks" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "log", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", -] - [[package]] name = "sp-tasks" version = "3.0.0" @@ -9536,22 +7978,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "sp-transaction-pool" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "derive_more", - "futures 0.3.13", - "log", - "parity-scale-codec 2.1.0", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", - "thiserror", -] - [[package]] name = "sp-transaction-pool" version = "3.0.0" @@ -9563,7 +7989,7 @@ dependencies = [ "parity-scale-codec 2.1.0", "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-blockchain", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] @@ -9596,18 +8022,6 @@ dependencies = [ "trie-root", ] -[[package]] -name = "sp-utils" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "futures 0.3.13", - "futures-core", - "futures-timer 3.0.2", - "lazy_static", - "prometheus", -] - [[package]] name = "sp-utils" version = "3.0.0" @@ -9793,34 +8207,20 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "log", "parity-scale-codec 2.1.0", - "sc-client-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sc-rpc-api 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sc-client-api", + "sc-rpc-api", "serde", "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-blockchain 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-transaction-pool 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", -] - -[[package]] -name = "substrate-prometheus-endpoint" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" -dependencies = [ - "async-std", - "derive_more", - "futures-util", - "hyper 0.13.10", - "log", - "prometheus", - "tokio 0.2.25", + "sp-transaction-pool", ] [[package]] diff --git a/node/Cargo.toml b/node/Cargo.toml index 7cc4e40c..e58ed2b6 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -62,16 +62,16 @@ substrate-frame-rpc-system = { version = "3.0.0" } pallet-contracts-rpc = { version = "3.0.0" } -fc-consensus = { git = "https://github.com/paritytech/frontier" } -fp-consensus = { git = "https://github.com/paritytech/frontier" } -fc-rpc = { git = "https://github.com/paritytech/frontier" } -fp-rpc = { git = "https://github.com/paritytech/frontier" } -fc-rpc-core = { git = "https://github.com/paritytech/frontier" } -fc-db = { git = "https://github.com/paritytech/frontier" } -fc-mapping-sync = { git = "https://github.com/paritytech/frontier" } +# fc-consensus = { git = "https://github.com/paritytech/frontier" } +# fp-consensus = { git = "https://github.com/paritytech/frontier" } +# fc-rpc = { git = "https://github.com/paritytech/frontier" } +# fp-rpc = { git = "https://github.com/paritytech/frontier" } +# fc-rpc-core = { git = "https://github.com/paritytech/frontier" } +# fc-db = { git = "https://github.com/paritytech/frontier" } +# fc-mapping-sync = { git = "https://github.com/paritytech/frontier" } -pallet-evm = { git = "https://github.com/paritytech/frontier" } -pallet-ethereum = { git = "https://github.com/paritytech/frontier" } +# pallet-evm = { git = "https://github.com/paritytech/frontier" } +# pallet-ethereum = { git = "https://github.com/paritytech/frontier" } merkle = { package = "pallet-merkle", version = "3.0.0", path = "../pallets/merkle" } merkle-rpc = { package = "pallet-merkle-rpc", version = "3.0.0", path = "../pallets/merkle/rpc" } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 6c6995d1..77c1bf74 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,7 @@ use frame_benchmarking::whitelisted_caller; use node_template_runtime::{ - AccountId, AuraConfig, BalancesConfig, EVMConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig, + AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig, + // EVMConfig, SystemConfig, WASM_BINARY, }; use sc_service::ChainType; @@ -134,14 +135,14 @@ fn testnet_genesis( endowed_accounts: Vec, _enable_println: bool, ) -> GenesisConfig { - let alice_evm_account_id = H160::from_str("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a").unwrap(); - let mut evm_accounts = BTreeMap::new(); - evm_accounts.insert(alice_evm_account_id, pallet_evm::GenesisAccount { - nonce: 0.into(), - balance: U256::from(123456_123_000_000_000_000_000u128), - storage: BTreeMap::new(), - code: vec![], - }); + // let alice_evm_account_id = H160::from_str("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a").unwrap(); + // let mut evm_accounts = BTreeMap::new(); + // evm_accounts.insert(alice_evm_account_id, pallet_evm::GenesisAccount { + // nonce: 0.into(), + // balance: U256::from(123456_123_000_000_000_000_000u128), + // storage: BTreeMap::new(), + // code: vec![], + // }); GenesisConfig { frame_system: Some(SystemConfig { @@ -164,7 +165,7 @@ fn testnet_genesis( // Assign network admin rights. key: root_key, }), - pallet_evm: Some(EVMConfig { accounts: evm_accounts }), - pallet_ethereum: Some(Default::default()), + // pallet_evm: Some(EVMConfig { accounts: evm_accounts }), + // pallet_ethereum: Some(Default::default()), } } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index ffc64661..b24ead12 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -2,12 +2,12 @@ #![warn(missing_docs)] -use fc_rpc::{SchemaV1Override, StorageOverride}; -use fc_rpc_core::types::{FilterPool, PendingTransactions}; +// use fc_rpc::{SchemaV1Override, StorageOverride}; +// use fc_rpc_core::types::{FilterPool, PendingTransactions}; use jsonrpc_pubsub::manager::SubscriptionManager; use merkle_rpc::{MerkleApi, MerkleClient}; use node_template_runtime::{opaque::Block, AccountId, Balance, BlockNumber, Hash, Index}; -use pallet_ethereum::EthereumStorageSchema; +// use pallet_ethereum::EthereumStorageSchema; use sc_client_api::{ backend::{AuxStore, StorageProvider}, client::BlockchainEvents, @@ -67,12 +67,12 @@ pub struct FullDeps { pub enable_dev_signer: bool, /// Network service pub network: Arc>, - /// Ethereum pending transactions. - pub pending_transactions: PendingTransactions, - /// EthFilterApi pool. - pub filter_pool: Option, - /// Backend. - pub backend: Arc>, + // /// Ethereum pending transactions. + // pub pending_transactions: PendingTransactions, + // /// EthFilterApi pool. + // pub filter_pool: Option, + // /// Backend. + // pub backend: Arc>, /// Whether to deny unsafe calls pub deny_unsafe: DenyUnsafe, /// GRANDPA specific dependencies. @@ -93,7 +93,7 @@ where C::Api: pallet_contracts_rpc::ContractsRuntimeApi, C::Api: BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: fp_rpc::EthereumRuntimeRPCApi, + // C::Api: fp_rpc::EthereumRuntimeRPCApi, C::Api: BlockBuilder, C::Api: merkle::MerkleApi, P: TransactionPool + 'static, @@ -101,10 +101,10 @@ where B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::backend::StateBackend>, { - use fc_rpc::{ - EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, - EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, - }; + // use fc_rpc::{ + // EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, + // EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, + // }; use pallet_contracts_rpc::{Contracts, ContractsApi}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use substrate_frame_rpc_system::{FullSystem, SystemApi}; @@ -149,10 +149,10 @@ where signers.push(Box::new(EthDevSigner::new()) as Box); } let mut overrides = BTreeMap::new(); - overrides.insert( - EthereumStorageSchema::V1, - Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, - ); + // overrides.insert( + // EthereumStorageSchema::V1, + // Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, + // ); io.extend_with(EthApiServer::to_delegate(EthApi::new( client.clone(), pool.clone(), diff --git a/pallets/merkle/Cargo.toml b/pallets/merkle/Cargo.toml index 44f6ffb3..f88ee036 100644 --- a/pallets/merkle/Cargo.toml +++ b/pallets/merkle/Cargo.toml @@ -18,7 +18,7 @@ sp-std = { default-features = false, version = "3.0.0" } sp-runtime = { default-features = false, version = "3.0.0" } merlin = { version = "2.0.0", default-features = false } sha2 = { version = "0.9.1", default-features = false } -rand_core = { version = "0.5", default-features = false, features = ["alloc", "getrandom"], optional = true} +rand_core = { version = "0.5", default-features = false, features = ["alloc", "getrandom"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } sp-api = { default-features = false, version = "3.0.0" } sp-io = { default-features = false, version = "3.0.0" } @@ -47,7 +47,6 @@ sp-core = { default-features = false, version = "3.0.0" } [features] default = ["std"] std = [ - "rand_core", "serde", "sp-runtime/std", "sp-io/std", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index ae080a1d..eaf7eb3d 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -70,7 +70,7 @@ orml-currencies = { version = "0.4.0", default-features = false } orml-traits = { version = "0.4.0", default-features = false } [features] -default = ["std", "frontier"] +default = ["std"] runtime-benchmarks = [ "hex-literal", "frame-benchmarking", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 1ffc3ebc..1aff838b 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -50,29 +50,19 @@ use frame_support::traits::FindAuthor; use merkle::utils::keys::ScalarData; use orml_currencies::BasicCurrencyAdapter; use orml_traits::parameter_type_with_key; -use pallet_ethereum::TransactionStatus; -use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, FeeCalculator, HashedAddressMapping, Runner}; + +// use pallet_ethereum::TransactionStatus; +// use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, FeeCalculator, HashedAddressMapping, Runner}; use sp_core::crypto::Public; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; - -#[cfg(feature = "frontier")] -use pallet_ethereum::TransactionStatus; -#[cfg(feature = "frontier")] -use pallet_evm::{ - Account as EVMAccount, FeeCalculator, Runner, -}; -#[cfg(feature = "frontier")] -use pallet_evm::HashedAddressMapping; -#[cfg(feature = "frontier")] -use pallet_evm::EnsureAddressTruncated; - -#[cfg(feature = "frontier")] -use sp_runtime::ConsensusEngineId; -#[cfg(feature = "frontier")] -use frame_support::traits::FindAuthor; -#[cfg(feature = "frontier")] -use sp_core::crypto::Public; +// use pallet_ethereum::TransactionStatus +// use pallet_evm::{ +// Account as EVMAccount, FeeCalculator, Runner, +// } +// use pallet_evm::HashedAddressMapping +// use pallet_evm::EnsureAddressTruncated; +// use sp_runtime::ConsensusEngineId; pub mod currency { @@ -386,6 +376,7 @@ impl tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; type CurrencyId = CurrencyId; + type NativeCurrency = BasicCurrencyAdapter; type Event = Event; type ForceOrigin = frame_system::EnsureRoot; type CurrencyDeposit = CurrencyDeposit; @@ -430,101 +421,83 @@ impl mixer::Config for Runtime { type WeightInfo = MixerWeights; } -/// Current approximation of the gas/s consumption considering -/// EVM execution over compiled WASM (on 4.4Ghz CPU). -/// Given the 500ms Weight, from which 75% only are used for transactions, -/// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000. -#[cfg(feature = "frontier")] -pub const GAS_PER_SECOND: u64 = 40_000_000; - -/// Approximate ratio of the amount of Weight per Gas. -/// u64 works for approximations because Weight is a very small unit compared to gas. -#[cfg(feature = "frontier")] -pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; - -#[cfg(feature = "frontier")] -pub struct AnonGasWeightMapping; - -#[cfg(feature = "frontier")] -impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { - fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WEIGHT_PER_GAS) - } - - fn weight_to_gas(weight: Weight) -> u64 { - u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) - } -} - -#[cfg(feature = "frontier")] -/// Fixed gas price of `1`. -pub struct FixedGasPrice; - -#[cfg(feature = "frontier")] -impl FeeCalculator for FixedGasPrice { - fn min_gas_price() -> U256 { - // Gas price is always one token per gas. - 1.into() - } -} - -#[cfg(feature = "frontier")] -parameter_types! { - pub const ChainId: u64 = 42; - pub BlockGasLimit: U256 = U256::from(u32::max_value()); -} - -#[cfg(feature = "frontier")] -impl pallet_evm::Config for Runtime { - type FeeCalculator = FixedGasPrice; - type GasWeightMapping = AnonGasWeightMapping; - type CallOrigin = EnsureAddressTruncated; - type WithdrawOrigin = EnsureAddressTruncated; - type AddressMapping = HashedAddressMapping; - type CallOrigin = EnsureAddressTruncated; - type ChainId = ChainId; - type Currency = Balances; - type Event = Event; - type FeeCalculator = (); - type GasWeightMapping = AnonGasWeightMapping; - type OnChargeTransaction = (); - type Precompiles = ( - pallet_evm_precompile_simple::ECRecover, - pallet_evm_precompile_simple::Sha256, - pallet_evm_precompile_simple::Ripemd160, - pallet_evm_precompile_simple::Identity, - pallet_evm_precompile_simple::ECRecoverPublicKey, - // pallet_evm_precompile_sha3fips::Sha3FIPS256, - // pallet_evm_precompile_sha3fips::Sha3FIPS512, - ); - type ChainId = ChainId; - type BlockGasLimit = BlockGasLimit; - type OnChargeTransaction = (); - type Runner = pallet_evm::runner::stack::Runner; -} - -#[cfg(feature = "frontier")] -pub struct EthereumFindAuthor(PhantomData); -impl> FindAuthor for EthereumFindAuthor { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - -#[cfg(feature = "frontier")] -impl pallet_ethereum::Config for Runtime { - type BlockGasLimit = BlockGasLimit; - type Event = Event; - type FindAuthor = EthereumFindAuthor; - type StateRoot = pallet_ethereum::IntermediateStateRoot; -} +// /// Current approximation of the gas/s consumption considering +// /// EVM execution over compiled WASM (on 4.4Ghz CPU). +// /// Given the 500ms Weight, from which 75% only are used for transactions, +// /// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000 +// pub const GAS_PER_SECOND: u64 = 40_000_000; + +// /// Approximate ratio of the amount of Weight per Gas. +// /// u64 works for approximations because Weight is a very small unit compared to gas +// pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; +// pub struct AnonGasWeightMapping; +// impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { +// fn gas_to_weight(gas: u64) -> Weight { +// gas.saturating_mul(WEIGHT_PER_GAS) +// } + +// fn weight_to_gas(weight: Weight) -> u64 { +// u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) +// } +// } +// /// Fixed gas price of `1`. +// pub struct FixedGasPrice; +// impl FeeCalculator for FixedGasPrice { +// fn min_gas_price() -> U256 { +// // Gas price is always one token per gas. +// 1.into() +// } +// } +// parameter_types! { +// pub const ChainId: u64 = 42; +// pub BlockGasLimit: U256 = U256::from(u32::max_value()); +// } +// impl pallet_evm::Config for Runtime { +// type FeeCalculator = FixedGasPrice; +// type GasWeightMapping = AnonGasWeightMapping; +// type CallOrigin = EnsureAddressTruncated; +// type WithdrawOrigin = EnsureAddressTruncated; +// type AddressMapping = HashedAddressMapping; +// type CallOrigin = EnsureAddressTruncated; +// type ChainId = ChainId; +// type Currency = Balances; +// type Event = Event; +// type FeeCalculator = (); +// type GasWeightMapping = AnonGasWeightMapping; +// type OnChargeTransaction = (); +// type Precompiles = ( +// pallet_evm_precompile_simple::ECRecover, +// pallet_evm_precompile_simple::Sha256, +// pallet_evm_precompile_simple::Ripemd160, +// pallet_evm_precompile_simple::Identity, +// pallet_evm_precompile_simple::ECRecoverPublicKey, +// // pallet_evm_precompile_sha3fips::Sha3FIPS256, +// // pallet_evm_precompile_sha3fips::Sha3FIPS512, +// ); +// type ChainId = ChainId; +// type BlockGasLimit = BlockGasLimit; +// type OnChargeTransaction = (); +// type Runner = pallet_evm::runner::stack::Runner; +// } +// pub struct EthereumFindAuthor(PhantomData); +// impl> FindAuthor for EthereumFindAuthor { +// fn find_author<'a, I>(digests: I) -> Option +// where +// I: 'a + IntoIterator, +// { +// if let Some(author_index) = F::find_author(digests) { +// let authority_id = Aura::authorities()[author_index as usize].clone(); +// return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); +// } +// None +// } +// } +// impl pallet_ethereum::Config for Runtime { +// type BlockGasLimit = BlockGasLimit; +// type Event = Event; +// type FindAuthor = EthereumFindAuthor; +// type StateRoot = pallet_ethereum::IntermediateStateRoot; +// } // Create the runtime by composing the FRAME pallets that were previously // configured. @@ -542,10 +515,8 @@ construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, Contracts: pallet_contracts::{Pallet, Call, Config, Storage, Event}, - #[cfg(feature = "frontier")] - EVM: pallet_evm::{Pallet, Config, Call, Storage, Event}, - #[cfg(feature = "frontier")] - Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, ValidateUnsigned}, + // EVM: pallet_evm::{Pallet, Config, Call, Storage, Event}, + // Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, ValidateUnsigned}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, @@ -557,24 +528,20 @@ construct_runtime!( } ); -pub struct TransactionConverter; - -#[cfg(feature = "frontier")] -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()) - } -} - -#[cfg(feature = "frontier")] -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic { - let extrinsic = - UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid") - } -} +// pub struct TransactionConverter; +// impl fp_rpc::ConvertTransaction for TransactionConverter { +// fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { +// UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()) +// } +// } +// impl fp_rpc::ConvertTransaction for TransactionConverter { +// fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic { +// let extrinsic = +// UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); +// let encoded = extrinsic.encode(); +// opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid") +// } +// } /// The address format for describing accounts. pub type Address = AccountId; @@ -743,116 +710,115 @@ impl_runtime_apis! { } } - #[cfg(feature = "frontier")] - impl fp_rpc::EthereumRuntimeRPCApi for Runtime { - fn chain_id() -> u64 { - ::ChainId::get() - } - - fn account_basic(address: H160) -> EVMAccount { - EVM::account_basic(&address) - } - - fn gas_price() -> U256 { - ::FeeCalculator::min_gas_price() - } - - fn account_code_at(address: H160) -> Vec { - EVM::account_codes(address) - } - - fn author() -> H160 { - >::find_author() - } - - fn storage_at(address: H160, index: U256) -> H256 { - let mut tmp = [0u8; 32]; - index.to_big_endian(&mut tmp); - EVM::account_storages(address, H256::from_slice(&tmp[..])) - } - - fn call( - from: H160, - to: H160, - data: Vec, - value: U256, - gas_limit: U256, - gas_price: Option, - nonce: Option, - estimate: bool, - ) -> Result { - let config = if estimate { - let mut config = ::config().clone(); - config.estimate = true; - Some(config) - } else { - None - }; - - ::Runner::call( - from, - to, - data, - value, - gas_limit.low_u64(), - gas_price, - nonce, - config.as_ref().unwrap_or(::config()), - ).map_err(|err| err.into()) - } - - fn create( - from: H160, - data: Vec, - value: U256, - gas_limit: U256, - gas_price: Option, - nonce: Option, - estimate: bool, - ) -> Result { - let config = if estimate { - let mut config = ::config().clone(); - config.estimate = true; - Some(config) - } else { - None - }; - - ::Runner::create( - from, - data, - value, - gas_limit.low_u64(), - gas_price, - nonce, - config.as_ref().unwrap_or(::config()), - ).map_err(|err| err.into()) - } - - fn current_transaction_statuses() -> Option> { - Ethereum::current_transaction_statuses() - } - - fn current_block() -> Option { - Ethereum::current_block() - } - - fn current_receipts() -> Option> { - Ethereum::current_receipts() - } - - fn current_all() -> ( - Option, - Option>, - Option> - ) { - ( - Ethereum::current_block(), - Ethereum::current_receipts(), - Ethereum::current_transaction_statuses() - ) - } - } + // impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + // fn chain_id() -> u64 { + // ::ChainId::get() + // } + + // fn account_basic(address: H160) -> EVMAccount { + // EVM::account_basic(&address) + // } + + // fn gas_price() -> U256 { + // ::FeeCalculator::min_gas_price() + // } + + // fn account_code_at(address: H160) -> Vec { + // EVM::account_codes(address) + // } + + // fn author() -> H160 { + // >::find_author() + // } + + // fn storage_at(address: H160, index: U256) -> H256 { + // let mut tmp = [0u8; 32]; + // index.to_big_endian(&mut tmp); + // EVM::account_storages(address, H256::from_slice(&tmp[..])) + // } + + // fn call( + // from: H160, + // to: H160, + // data: Vec, + // value: U256, + // gas_limit: U256, + // gas_price: Option, + // nonce: Option, + // estimate: bool, + // ) -> Result { + // let config = if estimate { + // let mut config = ::config().clone(); + // config.estimate = true; + // Some(config) + // } else { + // None + // }; + + // ::Runner::call( + // from, + // to, + // data, + // value, + // gas_limit.low_u64(), + // gas_price, + // nonce, + // config.as_ref().unwrap_or(::config()), + // ).map_err(|err| err.into()) + // } + + // fn create( + // from: H160, + // data: Vec, + // value: U256, + // gas_limit: U256, + // gas_price: Option, + // nonce: Option, + // estimate: bool, + // ) -> Result { + // let config = if estimate { + // let mut config = ::config().clone(); + // config.estimate = true; + // Some(config) + // } else { + // None + // }; + + // ::Runner::create( + // from, + // data, + // value, + // gas_limit.low_u64(), + // gas_price, + // nonce, + // config.as_ref().unwrap_or(::config()), + // ).map_err(|err| err.into()) + // } + + // fn current_transaction_statuses() -> Option> { + // Ethereum::current_transaction_statuses() + // } + + // fn current_block() -> Option { + // Ethereum::current_block() + // } + + // fn current_receipts() -> Option> { + // Ethereum::current_receipts() + // } + + // fn current_all() -> ( + // Option, + // Option>, + // Option> + // ) { + // ( + // Ethereum::current_block(), + // Ethereum::current_receipts(), + // Ethereum::current_transaction_statuses() + // ) + // } + // } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, From 1fa0081cdf95eec65929a055c80314483d361d3e Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 12 Apr 2021 12:21:16 +0300 Subject: [PATCH 06/14] Comment out EVM/Frontier, get node compiling --- Cargo.lock | 183 ++++++++++++++++++++--------------------- node/src/chain_spec.rs | 22 ++--- node/src/command.rs | 5 +- node/src/rpc.rs | 84 +++++++++---------- node/src/service.rs | 30 ++++++- 5 files changed, 176 insertions(+), 148 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5a82477..5dd503e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -453,11 +453,10 @@ checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" [[package]] name = "bincode" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] @@ -677,9 +676,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -1006,9 +1005,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.3", @@ -1515,7 +1514,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", ] [[package]] @@ -1587,7 +1586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "num-traits", @@ -2043,9 +2042,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253" dependencies = [ "futures-channel", "futures-core", @@ -2058,9 +2057,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25" dependencies = [ "futures-core", "futures-sink", @@ -2068,9 +2067,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" +checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815" [[package]] name = "futures-cpupool" @@ -2089,7 +2088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "log", "parking_lot 0.9.0", @@ -2100,9 +2099,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" +checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d" dependencies = [ "futures-core", "futures-task", @@ -2112,9 +2111,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" +checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04" [[package]] name = "futures-lite" @@ -2133,9 +2132,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +checksum = "668c6733a182cd7deb4f1de7ba3bf2120823835b3bcfbeacf7d2c4a773c1bb8b" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -2156,15 +2155,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23" [[package]] name = "futures-task" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" +checksum = "ba7aa51095076f3ba6d9a1f702f74bd05ec65f555d70d2033d55ba8d69f581bc" [[package]] name = "futures-timer" @@ -2180,9 +2179,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025" dependencies = [ "futures 0.1.31", "futures-channel", @@ -2649,7 +2648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6d52908d4ea4ab2bc22474ba149bf1011c8e2c3ebc1ff593ae28ac44f494b6" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.14", "futures-lite", "if-addrs", "ipnet", @@ -2742,7 +2741,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 2.0.2", ] @@ -3058,7 +3057,7 @@ checksum = "fe5759b526f75102829c15e4d8566603b4bf502ed19b5f35920d98113873470d" dependencies = [ "atomic", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "libp2p-core", "libp2p-deflate", @@ -3100,7 +3099,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3130,7 +3129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" dependencies = [ "flate2", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", ] @@ -3141,7 +3140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" dependencies = [ "async-std-resolver", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "smallvec 1.6.1", @@ -3156,7 +3155,7 @@ checksum = "897645f99e9b396df256a6aa8ba8c4bc019ac6b7c62556f624b5feea9acc82bb" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3177,7 +3176,7 @@ dependencies = [ "byteorder", "bytes 1.0.1", "fnv", - "futures 0.3.13", + "futures 0.3.14", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -3198,7 +3197,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f88ebc841d744979176ab4b8b294a3e655a7ba4ef26a905d073a52b49ed4dff5" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3219,7 +3218,7 @@ dependencies = [ "bytes 1.0.1", "either", "fnv", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3243,7 +3242,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.13", + "futures 0.3.14", "if-watch", "lazy_static", "libp2p-core", @@ -3263,7 +3262,7 @@ checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "nohash-hasher", @@ -3281,7 +3280,7 @@ checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" dependencies = [ "bytes 1.0.1", "curve25519-dalek 3.0.2", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "libp2p-core", "log", @@ -3301,7 +3300,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea10fc5209260915ea65b78f612d7ff78a29ab288e7aa3250796866af861c45" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3318,7 +3317,7 @@ checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "prost", @@ -3333,7 +3332,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", "pin-project 1.0.6", "rand 0.7.3", @@ -3349,7 +3348,7 @@ checksum = "3ff268be6a9d6f3c6cca3b81bbab597b15217f9ad8787c6c40fc548c1af7cd24" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "libp2p-core", "libp2p-swarm", @@ -3372,7 +3371,7 @@ checksum = "725367dd2318c54c5ab1a6418592e5b01c63b0dedfbbfb8389220b2bcf691899" dependencies = [ "async-trait", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3391,7 +3390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c26980cadd7c25d89071cb23e1f7f5df4863128cc91d83c6ddc72338cecafa" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "rand 0.7.3", @@ -3417,7 +3416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "if-watch", "ipnet", @@ -3434,7 +3433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" dependencies = [ "async-std", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", ] @@ -3445,7 +3444,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef45d61e43c313531b5e903e4e8415212ff6338e0c54c47da5b9b412b5760de" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3460,7 +3459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "futures-rustls", "libp2p-core", "log", @@ -3477,7 +3476,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d6144cc94143fb0a8dd1e7c2fbcc32a2808168bcd1d69920635424d5993b7b" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -3882,7 +3881,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "log", "pin-project 1.0.6", "smallvec 1.6.1", @@ -3960,7 +3959,7 @@ version = "3.0.0" dependencies = [ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-benchmarking-cli", - "futures 0.3.13", + "futures 0.3.14", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -5818,7 +5817,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "pin-project 0.4.28", "static_assertions", ] @@ -5852,7 +5851,7 @@ name = "sc-basic-authorship" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", @@ -5925,7 +5924,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "chrono", "fdlimit", - "futures 0.3.13", + "futures 0.3.14", "hex", "libp2p", "log", @@ -5963,7 +5962,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "derive_more", "fnv", - "futures 0.3.13", + "futures 0.3.14", "hash-db", "kvdb", "lazy_static", @@ -6039,7 +6038,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", @@ -6072,7 +6071,7 @@ dependencies = [ "async-trait", "derive_more", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "merlin", @@ -6130,7 +6129,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "parity-scale-codec 2.1.0", @@ -6255,7 +6254,7 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "linked-hash-map", "log", @@ -6292,7 +6291,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.13", + "futures 0.3.14", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6315,7 +6314,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.13", + "futures 0.3.14", "log", "parity-util-mem", "sc-client-api", @@ -6334,7 +6333,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "futures-util", "hex", "merlin", @@ -6383,7 +6382,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "hex", "ip_network", @@ -6424,7 +6423,7 @@ name = "sc-network-gossip" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "libp2p", "log", @@ -6443,7 +6442,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "hex", "hyper 0.13.10", @@ -6469,7 +6468,7 @@ name = "sc-peerset" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p", "log", "serde_json", @@ -6491,7 +6490,7 @@ name = "sc-rpc" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -6526,7 +6525,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.14", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6571,7 +6570,7 @@ dependencies = [ "directories", "exit-future", "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", @@ -6647,7 +6646,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "chrono", - "futures 0.3.13", + "futures 0.3.14", "libp2p", "log", "parking_lot 0.11.1", @@ -6705,7 +6704,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.14", "linked-hash-map", "log", "parity-util-mem", @@ -6726,7 +6725,7 @@ name = "sc-transaction-pool" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-diagnose", "intervalier", "log", @@ -6810,9 +6809,9 @@ dependencies = [ [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -7092,7 +7091,7 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.13", + "futures 0.3.14", "httparse", "log", "rand 0.7.3", @@ -7248,7 +7247,7 @@ name = "sp-blockchain" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", "lru", "parity-scale-codec 2.1.0", @@ -7276,7 +7275,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "libp2p", "log", @@ -7366,7 +7365,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.13", + "futures 0.3.14", "hash-db", "hash256-std-hasher", "hex", @@ -7410,7 +7409,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.13", + "futures 0.3.14", "hash-db", "hash256-std-hasher", "hex", @@ -7541,7 +7540,7 @@ name = "sp-io" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "hash-db", "libsecp256k1", "log", @@ -7565,7 +7564,7 @@ name = "sp-io" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "hash-db", "libsecp256k1", "log", @@ -7602,7 +7601,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b313 dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "merlin", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", @@ -7618,7 +7617,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "merlin", "parity-scale-codec 2.1.0", "parking_lot 0.11.1", @@ -7984,7 +7983,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.14", "log", "parity-scale-codec 2.1.0", "serde", @@ -8027,7 +8026,7 @@ name = "sp-utils" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -8206,7 +8205,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.13", + "futures 0.3.14", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -8871,7 +8870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.3.23", + "rand 0.7.3", "static_assertions", ] @@ -9163,7 +9162,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -9589,7 +9588,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cc7bd8c983209ed5d527f44b01c41b7dc146fd960c61cf9e1d25399841dc271" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", "nohash-hasher", "parking_lot 0.11.1", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 77c1bf74..b4e65217 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -145,26 +145,26 @@ fn testnet_genesis( // }); GenesisConfig { - frame_system: Some(SystemConfig { + frame_system: SystemConfig { // Add Wasm runtime to storage. code: wasm_binary.to_vec(), changes_trie_config: Default::default(), - }), - pallet_balances: Some(BalancesConfig { + }, + pallet_balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), - }), - pallet_contracts: Some(Default::default()), - pallet_aura: Some(AuraConfig { + }, + pallet_contracts: Default::default(), + pallet_aura: AuraConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), - }), - pallet_grandpa: Some(GrandpaConfig { + }, + pallet_grandpa: GrandpaConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), - }), - pallet_sudo: Some(SudoConfig { + }, + pallet_sudo: SudoConfig { // Assign network admin rights. key: root_key, - }), + }, // pallet_evm: Some(EVMConfig { accounts: evm_accounts }), // pallet_ethereum: Some(Default::default()), } diff --git a/node/src/command.rs b/node/src/command.rs index 660ebb3f..38202b60 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -146,7 +146,10 @@ pub fn run() -> sc_cli::Result<()> { runner.run_node_until_exit(|config| async move { match config.role { Role::Light => service::new_light(config), - _ => service::new_full(config, cli.run.enable_dev_signer), + _ => service::new_full( + config, + // cli.run.enable_dev_signer + ), } .map_err(sc_cli::Error::Service) }) diff --git a/node/src/rpc.rs b/node/src/rpc.rs index b24ead12..eabb7035 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -63,8 +63,8 @@ pub struct FullDeps { pub select_chain: SC, /// The Node authority flag pub is_authority: bool, - /// Whether to enable dev signer - pub enable_dev_signer: bool, + // /// Whether to enable dev signer + // pub enable_dev_signer: bool, /// Network service pub network: Arc>, // /// Ethereum pending transactions. @@ -114,13 +114,13 @@ where client, pool, select_chain: _, - enable_dev_signer, + // enable_dev_signer, is_authority, network, - pending_transactions, + // pending_transactions, deny_unsafe, - filter_pool, - backend, + // filter_pool, + // backend, grandpa, } = deps; let GrandpaDeps { @@ -144,46 +144,46 @@ where client.clone(), ))); - let mut signers = Vec::new(); - if enable_dev_signer { - signers.push(Box::new(EthDevSigner::new()) as Box); - } - let mut overrides = BTreeMap::new(); + // let mut signers = Vec::new(); + // if enable_dev_signer { + // signers.push(Box::new(EthDevSigner::new()) as Box); + // } + // let mut overrides = BTreeMap::new(); // overrides.insert( // EthereumStorageSchema::V1, // Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, // ); - io.extend_with(EthApiServer::to_delegate(EthApi::new( - client.clone(), - pool.clone(), - node_template_runtime::TransactionConverter, - network.clone(), - pending_transactions.clone(), - signers, - overrides, - backend, - is_authority, - ))); - - if let Some(filter_pool) = filter_pool { - io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( - client.clone(), - filter_pool.clone(), - 500 as usize, // max stored filters - ))); - } - - io.extend_with(NetApiServer::to_delegate(NetApi::new(client.clone(), network.clone()))); - io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone()))); - io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new( - pool.clone(), - client.clone(), - network, - SubscriptionManager::::with_id_provider( - HexEncodedIdProvider::default(), - Arc::new(subscription_task_executor), - ), - ))); + // io.extend_with(EthApiServer::to_delegate(EthApi::new( + // client.clone(), + // pool.clone(), + // node_template_runtime::TransactionConverter, + // network.clone(), + // pending_transactions.clone(), + // signers, + // overrides, + // backend, + // is_authority, + // ))); + + // if let Some(filter_pool) = filter_pool { + // io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( + // client.clone(), + // filter_pool.clone(), + // 500 as usize, // max stored filters + // ))); + // } + + // io.extend_with(NetApiServer::to_delegate(NetApi::new(client.clone(), network.clone()))); + // io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone()))); + // io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new( + // pool.clone(), + // client.clone(), + // network, + // SubscriptionManager::::with_id_provider( + // HexEncodedIdProvider::default(), + // Arc::new(subscription_task_executor), + // ), + // ))); io.extend_with(MerkleApi::to_delegate(MerkleClient::new(client.clone()))); diff --git a/node/src/service.rs b/node/src/service.rs index 197a495b..4cfc4103 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -174,19 +174,45 @@ pub fn new_full(mut config: Configuration) -> Result let name = config.network.node_name.clone(); let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); + let is_authority = role.is_authority(); + let subscription_task_executor = sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()); let rpc_extensions_builder = { + let justification_stream = grandpa_link.justification_stream(); + let shared_authority_set = grandpa_link.shared_authority_set().clone(); + let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); + let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( + backend.clone(), + Some(shared_authority_set.clone()), + ); + let client = client.clone(); let pool = transaction_pool.clone(); + let network = network.clone(); + let select_chain = select_chain.clone(); Box::new(move |deny_unsafe, _| { let deps = crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe, + is_authority, + // enable_dev_signer, + network: network.clone(), + // pending_transactions: pending.clone(), + // filter_pool: filter_pool.clone(), + // backend: frontier_backend.clone(), + select_chain: select_chain.clone(), + grandpa: crate::rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + justification_stream: justification_stream.clone(), + subscription_executor: subscription_task_executor.clone(), + finality_provider: finality_proof_provider.clone(), + }, }; - crate::rpc::create_full(deps) + crate::rpc::create_full(deps, subscription_task_executor.clone()) }) }; @@ -224,7 +250,7 @@ pub fn new_full(mut config: Configuration) -> Result StartAuraParams { slot_duration: sc_consensus_aura::slot_duration(&*client)?, client: client.clone(), - select_chain, + select_chain: select_chain.clone(), block_import, proposer_factory, inherent_data_providers: inherent_data_providers.clone(), From 449e1cb0ff8ee76b4923c664e2af1af9b61ac3d1 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 12 Apr 2021 13:57:59 +0300 Subject: [PATCH 07/14] remove frontier service file from git --- node/src/service_frontier.rs | 444 ----------------------------------- 1 file changed, 444 deletions(-) delete mode 100644 node/src/service_frontier.rs diff --git a/node/src/service_frontier.rs b/node/src/service_frontier.rs deleted file mode 100644 index 7043d22f..00000000 --- a/node/src/service_frontier.rs +++ /dev/null @@ -1,444 +0,0 @@ -//! Service and ServiceFactory implementation. Specialized wrapper over -//! substrate service. - - -use fc_mapping_sync::MappingSyncWorker; -use sc_service::BasePath; -use fc_rpc::EthTask; -use fc_rpc_core::types::{FilterPool, PendingTransactions}; -use fc_consensus::FrontierBlockImport; -use futures::{StreamExt}; -use node_template_runtime::{self, opaque::Block, RuntimeApi}; -use sc_client_api::{ExecutorProvider, RemoteBackend}; -use sc_executor::native_executor_instance; -pub use sc_executor::NativeExecutor; -use sc_finality_grandpa::SharedVoterState; -use sc_telemetry::TelemetrySpan; -use sc_client_api::BlockchainEvents; - -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; -use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; -use sp_inherents::InherentDataProviders; - -use sc_cli::SubstrateCli; -use std::{sync::{Mutex, Arc}, time::Duration, collections::{HashMap, BTreeMap}}; - -// Our native executor instance. -native_executor_instance!( - pub Executor, - node_template_runtime::api::dispatch, - node_template_runtime::native_version, - frame_benchmarking::benchmarking::HostFunctions, -); - -pub enum ConsensusResult { - Aura( - sc_consensus_aura::AuraBlockImport< - Block, - FullClient, - FrontierBlockImport< - Block, - sc_finality_grandpa::GrandpaBlockImport, - FullClient - >, - AuraPair - >, - sc_finality_grandpa::LinkHalf - ), -} - -type FullClient = sc_service::TFullClient; -type FullBackend = sc_service::TFullBackend; -type FullSelectChain = sc_consensus::LongestChain; - -pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { - let config_dir = config.base_path.as_ref() - .map(|base_path| base_path.config_dir(config.chain_spec.id())) - .unwrap_or_else(|| { - BasePath::from_project("", "", &crate::cli::Cli::executable_name()) - .config_dir(config.chain_spec.id()) - }); - let database_dir = config_dir.join("frontier").join("db"); - - Ok(Arc::new(fc_db::Backend::::new(&fc_db::DatabaseSettings { - source: fc_db::DatabaseSettingsSrc::RocksDb { - path: database_dir, - cache_size: 0, - } - })?)) -} - -pub fn new_partial(config: &Configuration) -> Result< - sc_service::PartialComponents< - FullClient, FullBackend, FullSelectChain, - sp_consensus::import_queue::BasicQueue>, - sc_transaction_pool::FullPool, - (ConsensusResult, PendingTransactions, Option, Arc>), ->, ServiceError> { - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); - - let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::(&config)?; - let client = Arc::new(client); - - let select_chain = sc_consensus::LongestChain::new(backend.clone()); - - let transaction_pool = sc_transaction_pool::BasicPool::new_full( - config.transaction_pool.clone(), - config.role.is_authority().into(), - config.prometheus_registry(), - task_manager.spawn_handle(), - client.clone(), - ); - - let pending_transactions: PendingTransactions - = Some(Arc::new(Mutex::new(HashMap::new()))); - - let filter_pool: Option - = Some(Arc::new(Mutex::new(BTreeMap::new()))); - - let frontier_backend = open_frontier_backend(config)?; - - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( - client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), - )?; - - let frontier_block_import = FrontierBlockImport::new( - grandpa_block_import.clone(), - client.clone(), - frontier_backend.clone(), - ); - - let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( - frontier_block_import, client.clone(), - ); - - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import.clone(), - Some(Box::new(grandpa_block_import.clone())), - client.clone(), - inherent_data_providers.clone(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), - )?; - - Ok(sc_service::PartialComponents { - client, backend, task_manager, import_queue, keystore_container, - select_chain, transaction_pool, inherent_data_providers, - other: (ConsensusResult::Aura(aura_block_import, grandpa_link), pending_transactions, filter_pool, frontier_backend) - }) -} - -/// Creates a full service from the configuration. -pub fn new_full_base( - config: Configuration, - enable_dev_signer: bool, -) -> Result { - let sc_service::PartialComponents { - client, backend, mut task_manager, import_queue, keystore_container, - select_chain, transaction_pool, inherent_data_providers, - other: (consensus_result, pending_transactions, filter_pool, frontier_backend), - } = new_partial(&config)?; - - let (network, network_status_sinks, system_rpc_tx, network_starter) = - sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue, - on_demand: None, - block_announce_validator_builder: None, - })?; - - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), - ); - } - - let role = config.role.clone(); - let force_authoring = config.force_authoring; - let backoff_authoring_blocks: Option<()> = None; - let name = config.network.node_name.clone(); - let enable_grandpa = !config.disable_grandpa; - let prometheus_registry = config.prometheus_registry().cloned(); - let is_authority = role.is_authority(); - let subscription_task_executor = sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()); - - let g_link = match consensus_result { - ConsensusResult::Aura(ref _aura_link, ref grandpa_link) => { - grandpa_link - } - }; - - let rpc_extensions_builder = { - let justification_stream = g_link.justification_stream(); - let shared_authority_set = g_link.shared_authority_set().clone(); - let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); - let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( - backend.clone(), - Some(shared_authority_set.clone()), - ); - - let client = client.clone(); - let pool = transaction_pool.clone(); - let network = network.clone(); - let pending = pending_transactions.clone(); - let filter_pool = filter_pool.clone(); - let frontier_backend = frontier_backend.clone(); - let select_chain = select_chain.clone(); - - Box::new(move |deny_unsafe, _| { - let deps = crate::rpc::FullDeps { - client: client.clone(), - pool: pool.clone(), - deny_unsafe, - is_authority, - enable_dev_signer, - network: network.clone(), - pending_transactions: pending.clone(), - filter_pool: filter_pool.clone(), - backend: frontier_backend.clone(), - select_chain: select_chain.clone(), - grandpa: crate::rpc::GrandpaDeps { - shared_voter_state: shared_voter_state.clone(), - shared_authority_set: shared_authority_set.clone(), - justification_stream: justification_stream.clone(), - subscription_executor: subscription_task_executor.clone(), - finality_provider: finality_proof_provider.clone(), - }, - }; - crate::rpc::create_full( - deps, - subscription_task_executor.clone() - ) - }) - }; - - task_manager.spawn_essential_handle().spawn( - "frontier-mapping-sync-worker", - MappingSyncWorker::new( - client.import_notification_stream(), - Duration::new(6, 0), - client.clone(), - backend.clone(), - frontier_backend.clone(), - ).for_each(|()| futures::future::ready(())) - ); - - let telemetry_span = TelemetrySpan::new(); - let _telemetry_span_entered = telemetry_span.enter(); - - let (_rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(sc_service::SpawnTasksParams { - network: network.clone(), - client: client.clone(), - keystore: keystore_container.sync_keystore(), - task_manager: &mut task_manager, - transaction_pool: transaction_pool.clone(), - rpc_extensions_builder: rpc_extensions_builder, - on_demand: None, - remote_blockchain: None, - backend, network_status_sinks, system_rpc_tx, config, telemetry_span: Some(telemetry_span.clone()), - })?; - - // Spawn Frontier EthFilterApi maintenance task. - if let Some(filter_pool) = filter_pool { - // Each filter is allowed to stay in the pool for 100 blocks. - const FILTER_RETAIN_THRESHOLD: u64 = 100; - task_manager.spawn_essential_handle().spawn( - "frontier-filter-pool", - EthTask::filter_pool_task( - Arc::clone(&client), - filter_pool, - FILTER_RETAIN_THRESHOLD, - ) - ); - } - - // Spawn Frontier pending transactions maintenance task (as essential, otherwise we leak). - if let Some(pending_transactions) = pending_transactions { - const TRANSACTION_RETAIN_THRESHOLD: u64 = 5; - task_manager.spawn_essential_handle().spawn( - "frontier-pending-transactions", - EthTask::pending_transaction_task( - Arc::clone(&client), - pending_transactions, - TRANSACTION_RETAIN_THRESHOLD, - ) - ); - } - - match consensus_result { - ConsensusResult::Aura(aura_block_import, grandpa_link) => { - if role.is_authority() { - let proposer = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - ); - - let can_author_with = - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - client.clone(), - select_chain, - aura_block_import, - proposer, - network.clone(), - inherent_data_providers.clone(), - force_authoring, - backoff_authoring_blocks, - keystore_container.sync_keystore(), - can_author_with, - )?; - - // the AURA authoring task is considered essential, i.e. if it - // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura", aura); - - // if the node isn't actively participating in consensus then it doesn't - // need a keystore, regardless of which protocol we use below. - let keystore = if role.is_authority() { - Some(keystore_container.sync_keystore()) - } else { - None - }; - - let grandpa_config = sc_finality_grandpa::Config { - // FIXME #1578 make this available through chainspec - gossip_duration: Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore, - is_authority: role.is_authority(), - }; - - if enable_grandpa { - // start the full GRANDPA voter - // NOTE: non-authorities could run the GRANDPA observer protocol, but at - // this point the full voter should provide better guarantees of block - // and vote data availability than the observer. The observer has not - // been tested extensively yet and having most nodes in a network run it - // could lead to finality stalls. - let grandpa_config = sc_finality_grandpa::GrandpaParams { - config: grandpa_config, - link: grandpa_link, - network, - telemetry_on_connect: telemetry_connection_notifier.map(|x| x.on_connect_stream()), - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), - prometheus_registry, - shared_voter_state: SharedVoterState::empty(), - }; - - // the GRANDPA voter task is considered infallible, i.e. - // if it fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking( - "grandpa-voter", - sc_finality_grandpa::run_grandpa_voter(grandpa_config)? - ); - } - } - } - } - - network_starter.start_network(); - Ok(task_manager) -} - -/// Builds a new service for a full client. -pub fn new_full(config: Configuration, enable_dev_signer: bool) --> Result { - new_full_base(config, enable_dev_signer) -} - -pub fn new_light_base(config: Configuration) -> Result { - let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::(&config)?; - - let select_chain = sc_consensus::LongestChain::new(backend.clone()); - - let telemetry_span = TelemetrySpan::new(); - let _telemetry_span_entered = telemetry_span.enter(); - - let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( - config.transaction_pool.clone(), - config.prometheus_registry(), - task_manager.spawn_handle(), - client.clone(), - on_demand.clone(), - )); - - let (grandpa_block_import, _) = sc_finality_grandpa::block_import( - client.clone(), - &(client.clone() as Arc<_>), - select_chain.clone(), - )?; - - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - grandpa_block_import.clone(), - Some(Box::new(grandpa_block_import)), - client.clone(), - InherentDataProviders::new(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::NeverCanAuthor, - )?; - - let light_deps = crate::rpc::LightDeps { - remote_blockchain: backend.remote_blockchain(), - fetcher: on_demand.clone(), - client: client.clone(), - pool: transaction_pool.clone(), - }; - - let rpc_extensions = crate::rpc::create_light(light_deps); - - let (network, network_status_sinks, system_rpc_tx, network_starter) = - sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue, - on_demand: Some(on_demand.clone()), - block_announce_validator_builder: None, - })?; - - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), - ); - } - - sc_service::spawn_tasks(sc_service::SpawnTasksParams { - remote_blockchain: Some(backend.remote_blockchain()), - transaction_pool, - task_manager: &mut task_manager, - on_demand: Some(on_demand), - rpc_extensions_builder: Box::new(sc_service::NoopRpcExtensionBuilder(rpc_extensions)), - config, - client, - keystore: keystore_container.sync_keystore(), - backend, - network, - network_status_sinks, - system_rpc_tx, - telemetry_span: Some(telemetry_span.clone()), - })?; - - network_starter.start_network(); - - Ok(task_manager) -} - -/// Builds a new service for a light client. -pub fn new_light(config: Configuration) -> Result { - new_light_base(config) -} From 0069056bab440239ebdf9659e4b95c5783df9434 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 12 Apr 2021 19:22:24 +0300 Subject: [PATCH 08/14] Newlines --- pallets/tokens/src/basic_currency.rs | 2 +- pallets/tokens/src/lib.rs | 4 ++-- pallets/tokens/src/types.rs | 2 +- pallets/tokens/src/weights.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/tokens/src/basic_currency.rs b/pallets/tokens/src/basic_currency.rs index cac05179..2671e661 100644 --- a/pallets/tokens/src/basic_currency.rs +++ b/pallets/tokens/src/basic_currency.rs @@ -174,4 +174,4 @@ where ) -> result::Result { Currency::repatriate_reserved(slashed, beneficiary, value, status) } -} \ No newline at end of file +} diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs index 67b398b9..8d6bd8d8 100644 --- a/pallets/tokens/src/lib.rs +++ b/pallets/tokens/src/lib.rs @@ -1351,7 +1351,7 @@ impl Pallet { pub(crate) fn dead_account( who: &T::AccountId, - d: &mut TokenDetails, + _d: &mut TokenDetails, ) { frame_system::Pallet::::dec_consumers(who); } @@ -2027,4 +2027,4 @@ impl OnDust for BurnDust // if failed will leave some dust which still could be recycled. let _ = Pallet::::withdraw(currency_id, who, amount); } -} \ No newline at end of file +} diff --git a/pallets/tokens/src/types.rs b/pallets/tokens/src/types.rs index 03862bc8..2a171aaf 100644 --- a/pallets/tokens/src/types.rs +++ b/pallets/tokens/src/types.rs @@ -121,4 +121,4 @@ impl AccountData { pub fn total(&self) -> Balance { self.free.saturating_add(self.reserved) } -} \ No newline at end of file +} diff --git a/pallets/tokens/src/weights.rs b/pallets/tokens/src/weights.rs index e1d2b558..e258309a 100644 --- a/pallets/tokens/src/weights.rs +++ b/pallets/tokens/src/weights.rs @@ -292,4 +292,4 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } -} \ No newline at end of file +} From 6c2017e75de9a951fddd29a1ff92f4388b3101e1 Mon Sep 17 00:00:00 2001 From: Shady Khalifa Date: Tue, 13 Apr 2021 11:55:05 +0200 Subject: [PATCH 09/14] ups (#133) --- .dockerignore | 1 - .github/workflows/image-publish.yml | 3 +++ Dockerfile | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index bcbde20b..a8756266 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,5 @@ runtime/target **/*.rs.bk /*/**/target .vscode -build cache artifacts diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index 26136917..3a0cad6a 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -42,6 +42,9 @@ jobs: - name: Build node run: ./scripts/build.sh + - name: Copy binaries + run: mkdir -p build && cp target/release/node-template build/webb-node + - name: Build Image run: docker build . --tag image diff --git a/Dockerfile b/Dockerfile index b402d304..6adabb83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ -FROM gcr.io/distroless/cc +FROM debian:buster-slim LABEL AUTHOR="Webb Developers " +ENV RUST_BACKTRACE=full -ADD target/release/node-template / +RUN apt-get update && \ + apt-get install -y libc6 && \ + rm -rf /var/lib/apt/lists/* -ENV RUST_BACKTRACE=full +ADD build/webb-node /usr/local/bin/webb-node EXPOSE 9615 EXPOSE 9944 -CMD ["/node-template"] +CMD ["webb-node"] From c590d898a513e3c8dc180f9eb7283b9ac2392905 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Tue, 13 Apr 2021 21:34:45 +0300 Subject: [PATCH 10/14] Test updates --- Cargo.lock | 21 +- pallets/tokens/Cargo.toml | 6 +- pallets/tokens/src/lib.rs | 36 ++- pallets/tokens/src/mock.rs | 62 ++++- pallets/tokens/src/tests.rs | 529 +++++++++++++++++++++++++++++++++++- 5 files changed, 625 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5dd503e9..93868ac9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4632,6 +4632,7 @@ dependencies = [ "orml-currencies", "orml-traits", "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "pallet-treasury", "parity-scale-codec 2.1.0", "serde", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", @@ -4684,6 +4685,21 @@ dependencies = [ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] +[[package]] +name = "pallet-treasury" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "impl-trait-for-tuples 0.2.1", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + [[package]] name = "parity-db" version = "0.2.3" @@ -9721,11 +9737,6 @@ name = "pallet-staking-reward-curve" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" -[[patch.unused]] -name = "pallet-treasury" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" - [[patch.unused]] name = "pallet-utility" version = "3.0.0" diff --git a/pallets/tokens/Cargo.toml b/pallets/tokens/Cargo.toml index 06190c72..4db74a25 100644 --- a/pallets/tokens/Cargo.toml +++ b/pallets/tokens/Cargo.toml @@ -9,7 +9,8 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -balances = { version = "3.0.0", default-features = false, package = "pallet-balances" } +pallet-balances = { version = "3.0.0", default-features = false } +pallet-treasury = { version = "3.0.0", default-features = false } frame-support = { default-features = false, version = '3.0.0' } frame-system = { default-features = false, version = '3.0.0' } sp-std = { default-features = false, version = "3.0.0" } @@ -31,7 +32,8 @@ default = ['std'] std = [ "serde", "codec/std", - "balances/std", + "pallet-balances/std", + "pallet-treasury/std", "frame-support/std", "frame-system/std", "frame-benchmarking/std", diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs index 8d6bd8d8..ef7107bd 100644 --- a/pallets/tokens/src/lib.rs +++ b/pallets/tokens/src/lib.rs @@ -131,6 +131,9 @@ pub mod pallet { /// Handler to burn or transfer account's dust type OnDust: OnDust; + + // /// Handler to assign different balance updates + // type OnTransfer: OnTransfer; } #[pallet::event] @@ -1421,9 +1424,23 @@ impl MultiCurrency for Pallet { let details = Token::::get(currency_id).ok_or(Error::::Unknown)?; ensure!(to_balance >= details.min_balance, Error::::BelowMinimum); + // check if sender goes below min balance and send remaining to recipient + let dust = if from_balance - amount < details.min_balance { + from_balance - amount + } else { + T::Balance::zero() + }; + + // update the sender's balance in the event there is dust being reaped + let new_from_balance = if dust > T::Balance::zero() { + T::Balance::zero() + } else { + from_balance - amount + }; + // Cannot underflow because ensure_can_withdraw check - Self::set_free_balance(currency_id, from, from_balance - amount); - Self::set_free_balance(currency_id, to, to_balance); + Self::set_free_balance(currency_id, from, new_from_balance); + Self::set_free_balance(currency_id, to, to_balance + dust); Ok(()) } @@ -1452,11 +1469,9 @@ impl MultiCurrency for Pallet { return Ok(()); } Self::ensure_can_withdraw(currency_id, who, amount)?; - // Cannot underflow because ensure_can_withdraw check >::mutate(currency_id, |v| *v -= amount); Self::set_free_balance(currency_id, who, Self::free_balance(currency_id, who) - amount); - Ok(()) } @@ -2020,6 +2035,19 @@ impl ExtendedTokenSystem for } } +pub struct TransferDust(marker::PhantomData<(T, GetAccountId)>); +impl OnDust for TransferDust +where + T: Config, + GetAccountId: Get, +{ + fn on_dust(who: &T::AccountId, currency_id: T::CurrencyId, amount: T::Balance) { + // transfer the dust to treasury account, ignore the result, + // if failed will leave some dust which still could be recycled. + let _ = as MultiCurrency>::transfer(currency_id, who, &GetAccountId::get(), amount); + } +} + pub struct BurnDust(marker::PhantomData); impl OnDust for BurnDust { fn on_dust(who: &T::AccountId, currency_id: T::CurrencyId, amount: T::Balance) { diff --git a/pallets/tokens/src/mock.rs b/pallets/tokens/src/mock.rs index df3b2de0..ce4140e3 100644 --- a/pallets/tokens/src/mock.rs +++ b/pallets/tokens/src/mock.rs @@ -4,6 +4,7 @@ use frame_benchmarking::whitelisted_caller; use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; use basic_currency::BasicCurrencyAdapter; +use sp_runtime::{Permill}; use sp_core::H256; use sp_runtime::{ @@ -18,6 +19,16 @@ pub type CurrencyId = u64; pub type AccountId = u64; pub type BlockNumber = u64; +pub const DOT: CurrencyId = 1; +pub const BTC: CurrencyId = 2; +pub const ETH: CurrencyId = 3; +pub const ALICE: AccountId = 1u64; +pub const BOB: AccountId = 2u64; +pub const DAVE: AccountId = 4u64; +pub const TREASURY_ACCOUNT: AccountId = 3u64; +pub const ID_1: LockIdentifier = *b"1 "; +pub const ID_2: LockIdentifier = *b"2 "; + // Configure a mock runtime to test the pallet. type UncheckedExtrinsic = MockUncheckedExtrinsic; type Block = MockBlock; @@ -29,8 +40,9 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: balances::{Pallet, Call, Storage, Config, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, Tokens: tokens::{Pallet, Call, Storage, Event}, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, } ); @@ -43,7 +55,7 @@ parameter_types! { } impl frame_system::Config for Test { - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type AccountId = AccountId; type BaseCallFilter = (); type BlockHashCount = BlockHashCount; @@ -77,7 +89,7 @@ parameter_types! { pub const MinimumDepositLength: u64 = 10 * 60 * 24 * 28; } -impl balances::Config for Test { +impl pallet_balances::Config for Test { type AccountStore = System; type Balance = Balance; type DustRemoval = (); @@ -87,6 +99,31 @@ impl balances::Config for Test { type WeightInfo = (); } +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: u64 = 1; + pub const SpendPeriod: u64 = 2; + pub const Burn: Permill = Permill::from_percent(50); + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const GetTokenId: CurrencyId = DOT; +} + +impl pallet_treasury::Config for Test { + type PalletId = TreasuryPalletId; + type Currency = CurrencyAdapter; + type ApproveOrigin = frame_system::EnsureRoot; + type RejectOrigin = frame_system::EnsureRoot; + type Event = Event; + type OnSlash = (); + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type SpendPeriod = SpendPeriod; + type Burn = Burn; + type BurnDestination = (); + type SpendFunds = (); + type WeightInfo = (); +} + parameter_types! { pub const NativeCurrencyId: CurrencyId = 0; } @@ -100,6 +137,10 @@ parameter_types! { pub const MetadataDepositPerByte: u64 = 1; } +parameter_types! { + pub DustAccount: AccountId = PalletId(*b"orml/dst").into_account(); +} + impl Config for Test { type PalletId = TokensPalletId; type Event = Event; @@ -113,23 +154,26 @@ impl Config for Test { type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; - type OnDust = BurnDust; + type OnDust = TransferDust; + // type OnDust = BurnDust; type WeightInfo = (); type Extra = (); } +pub type TreasuryCurrencyAdapter = ::Currency; + // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - use balances::GenesisConfig as BalancesConfig; + use pallet_balances::GenesisConfig as BalancesConfig; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); BalancesConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![ - (0, 1_000_000_000), - (1, 1_000_000_000), - (2, 1_000_000_000), - (whitelisted_caller(), 1_000_000_000), + (0, 1_000_000_000_000_000_000), + (1, 1_000_000_000_000_000_000), + (2, 1_000_000_000_000_000_000), + (whitelisted_caller(), 1_000_000_000_000_000_000), ], } .assimilate_storage(&mut t) diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index 07b186e3..927010e5 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -20,7 +20,12 @@ use super::*; use crate::{Error, mock::*}; use frame_support::{assert_ok, assert_noop, traits::Currency}; -use balances::Error as BalancesError; +use pallet_balances::Error as BalancesError; + +/** + * @brief Assets tests (mostly from pallet-assets) + */ + #[test] fn basic_minting_should_work() { @@ -185,18 +190,18 @@ fn min_balance_should_work() { assert_noop!(Tokens::force_transfer(Origin::signed(1), 0, 1, 2, 9), Error::::BelowMinimum); // When deducting from an account to below minimum, it should be reaped. - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 91)); + assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 100)); assert!(Tokens::free_balance(0, &1).is_zero()); - assert_eq!(Tokens::free_balance(0, &2), 91); - assert_eq!(Tokens::total_issuance(0), 91); + assert_eq!(Tokens::free_balance(0, &2), 100); + assert_eq!(Tokens::total_issuance(0), 100); assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); - assert_ok!(Tokens::force_transfer(Origin::signed(1), 0, 2, 1, 91)); + assert_ok!(Tokens::force_transfer(Origin::signed(1), 0, 2, 1, 100)); assert!(Tokens::free_balance(0, &2).is_zero()); - assert_eq!(Tokens::free_balance(0, &1), 91); + assert_eq!(Tokens::free_balance(0, &1), 100); assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); - assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, 91)); + assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, 100)); assert!(Tokens::free_balance(0, &1).is_zero()); assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 0); }); @@ -488,6 +493,7 @@ fn force_metadata_should_work() { }); } + #[test] fn force_asset_status_should_work(){ new_test_ext().execute_with(|| { @@ -522,9 +528,514 @@ fn force_asset_status_should_work(){ //account drains to completion when funds dip below min_balance assert_ok!(Tokens::force_asset_status(Origin::root(), 0, 1, 1, 1, 1, 110, false)); + assert_eq!(Tokens::total_supply(0), 200); assert_ok!(Tokens::transfer(Origin::signed(2), 0, 1, 110)); - assert_eq!(Tokens::free_balance(0, &1), 110); + assert_eq!(Tokens::free_balance(0, &1), 200); assert_eq!(Tokens::free_balance(0, &2), 0); - assert_eq!(Tokens::total_supply(0), 110); + assert_eq!(Tokens::total_supply(0), 200); + }); +} + +/** + * @brief Tokens tests (mostly from orml-tokens) + */ + #[test] +fn minimum_balance_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_eq!(Tokens::minimum_balance(BTC), 1); + assert_eq!(Tokens::minimum_balance(DOT), 2); + assert_eq!(Tokens::minimum_balance(ETH), 1); + }); +} + +#[test] +fn remove_dust_work() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::deposit(DOT, &DAVE, 100)); + assert_eq!(Tokens::total_issuance(DOT), 100); + assert_eq!(Accounts::::contains_key(DOT, DAVE), true); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 100); + assert_eq!(System::providers(&DAVE), 1); + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), false); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 0); + assert_eq!(System::providers(&DustAccount::get()), 0); + + // total is gte ED, will not handle dust + assert_ok!(Tokens::withdraw(DOT, &DAVE, 98)); + assert_eq!(Tokens::total_issuance(DOT), 2); + assert_eq!(Accounts::::contains_key(DOT, DAVE), true); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 2); + assert_eq!(System::providers(&DAVE), 1); + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), false); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 0); + assert_eq!(System::providers(&DustAccount::get()), 0); + + assert_ok!(Tokens::withdraw(DOT, &DAVE, 1)); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 1); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 1); + // total is lte ED, will handle dust + assert_eq!(Tokens::total_issuance(DOT), 1); + assert_eq!(Accounts::::contains_key(DOT, DAVE), false); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 0); + assert_eq!(System::providers(&DAVE), 0); + + // will not handle dust for module account + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), true); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 1); + assert_eq!(System::providers(&DustAccount::get()), 1); + + let dust_lost_event = mock::Event::tokens(crate::Event::DustLost(DAVE, DOT, 1)); + assert!(System::events().iter().any(|record| record.event == dust_lost_event)); + }); +} + +#[test] +fn set_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 10); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen(), 10); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 50)); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 50); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_ok!(Tokens::set_lock(ID_2, DOT, &ALICE, 60)); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 60); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + }); +} + +#[test] +fn extend_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 10); + assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 20); + assert_ok!(Tokens::extend_lock(ID_2, DOT, &ALICE, 10)); + assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + }); +} + +#[test] +fn remove_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_ok!(Tokens::set_lock(ID_2, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + assert_ok!(Tokens::remove_lock(ID_2, DOT, &ALICE)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + }); +} + +#[test] +fn frozen_can_limit_liquidity() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 90)); + assert_noop!( + >::transfer(DOT, &ALICE, &BOB, 11), + Error::::LiquidityRestrictions, + ); + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_ok!(>::transfer(DOT, &ALICE, &BOB, 11),); + }); +} + +#[test] +fn can_reserve_is_correct() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 0), true); + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 101), false); + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 100), true); + }); +} + +#[test] +fn reserve_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_noop!(Tokens::reserve(DOT, &ALICE, 101), Error::::BalanceLow,); + assert_ok!(Tokens::reserve(DOT, &ALICE, 0)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_balance(DOT, &ALICE), 100); + }); +} + +#[test] +fn unreserve_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 50), 50); + assert_ok!(Tokens::reserve(DOT, &ALICE, 30)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 70); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 15), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 85); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 15); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 30), 15); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + }); +} + +#[test] +fn slash_reserved_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + assert_eq!(Tokens::slash_reserved(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + assert_eq!(Tokens::slash_reserved(DOT, &ALICE, 100), 50); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 150); + }); +} + +#[test] +fn repatriate_reserved_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!( + Tokens::repatriate_reserved(DOT, &ALICE, &ALICE, 0, BalanceStatus::Free), + Ok(0) + ); + assert_eq!( + Tokens::repatriate_reserved(DOT, &ALICE, &ALICE, 50, BalanceStatus::Free), + Ok(50) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 0); + assert_ok!(Tokens::reserve(DOT, &BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 50); + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &BOB, 60, BalanceStatus::Reserved), + Ok(10) + ); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 50); + + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &ALICE, 30, BalanceStatus::Reserved), + Ok(0) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 20); + + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &ALICE, 30, BalanceStatus::Free), + Ok(10) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 120); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 0); + }); +} + +#[test] +fn slash_draw_reserved_correct() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + + assert_eq!(Tokens::slash(DOT, &ALICE, 80), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 20); + assert_eq!(Tokens::total_issuance(DOT), 120); + + assert_eq!(Tokens::slash(DOT, &ALICE, 50), 30); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 100); + }); +} + +#[test] +fn genesis_issuance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::total_issuance(DOT), 200); + }); +} + +#[test] +fn transfer_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + System::set_block_number(1); + + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 150); + assert_eq!(Tokens::total_issuance(DOT), 200); + + let transferred_event = mock::Event::tokens(crate::Event::Transferred(DOT, ALICE, BOB, 50)); + assert!(System::events().iter().any(|record| record.event == transferred_event)); + + assert_noop!( + Tokens::transfer(Some(ALICE).into(), DOT, BOB, 60), + Error::::BalanceLow, + ); + }); +} + +#[test] +fn transfer_all_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + System::set_block_number(1); + + assert_ok!(Tokens::transfer_all(Some(ALICE).into(), DOT, BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 200); + + let transferred_event = mock::Event::tokens(crate::Event::Transferred(DOT, ALICE, BOB, 100)); + assert!(System::events().iter().any(|record| record.event == transferred_event)); + }); +} + +#[test] +fn deposit_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 200); + assert_eq!(Tokens::total_issuance(DOT), 300); + + assert_noop!( + Tokens::deposit(DOT, &ALICE, Balance::max_value()), + Error::::TotalIssuanceOverflow, + ); + }); +} + +#[test] +fn withdraw_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::withdraw(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 150); + + assert_noop!(Tokens::withdraw(DOT, &ALICE, 60), Error::::BalanceLow); + }); +} + +#[test] +fn slash_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + // slashed_amount < amount + assert_eq!(Tokens::slash(DOT, &ALICE, 50), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 150); + + // slashed_amount == amount + assert_eq!(Tokens::slash(DOT, &ALICE, 51), 1); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 100); + }); +} + +#[test] +fn update_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::update_balance(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 150); + assert_eq!(Tokens::total_issuance(DOT), 250); + + assert_ok!(Tokens::update_balance(DOT, &BOB, -50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + + assert_noop!(Tokens::update_balance(DOT, &BOB, -60), Error::::BalanceLow); + }); +} + +#[test] +fn ensure_can_withdraw_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_noop!( + Tokens::ensure_can_withdraw(DOT, &ALICE, 101), + Error::::BalanceLow + ); + + assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 1)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + }); +} + +#[test] +fn no_op_if_amount_is_zero() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 0)); + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 0)); + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, ALICE, 0)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 0)); + assert_ok!(Tokens::withdraw(DOT, &ALICE, 0)); + assert_eq!(Tokens::slash(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::slash(DOT, &ALICE, 1), 1); + assert_ok!(Tokens::update_balance(DOT, &ALICE, 0)); }); } + +#[test] +fn merge_account_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(BTC, &ALICE), 200); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 1)); + assert_noop!( + Tokens::merge_account(&ALICE, &BOB), + Error::::StillHasActiveReserved + ); + Tokens::unreserve(DOT, &ALICE, 1); + + assert_ok!(Tokens::merge_account(&ALICE, &BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(BTC, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::free_balance(BTC, &BOB), 200); + }); +} From c8d0bb09f2c0b8f62e4aefd49693a2d3eb6d74c3 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 14 Apr 2021 14:35:58 +0300 Subject: [PATCH 11/14] Fix merge account --- pallets/tokens/src/lib.rs | 13 ++++++++---- pallets/tokens/src/tests.rs | 41 +++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs index ef7107bd..035c6bba 100644 --- a/pallets/tokens/src/lib.rs +++ b/pallets/tokens/src/lib.rs @@ -447,15 +447,15 @@ pub mod pallet { Ok(_) => None, Err(origin) => Some(ensure_signed(origin)?), }; + // TODO: Ensure we clean up everything Token::::try_mutate_exists(id, |maybe_details| { - let mut details = maybe_details.take().ok_or(Error::::Unknown)?; + let details = maybe_details.take().ok_or(Error::::Unknown)?; if let Some(check_owner) = maybe_check_owner { ensure!(details.owner == check_owner, Error::::NoPermission); } for (who, _v) in Accounts::::drain_prefix(id) { - Self::dead_account(&who, &mut details); - AccountCurrencies::::remove(who, id); + Self::dead_account(id, &who); } let metadata = Metadata::::take(&id); @@ -1270,11 +1270,15 @@ impl Pallet { // and the account storage in frame_system shouldn't be repeaded. let _ = frame_system::Pallet::::dec_providers(who); } else if !existed && exists { + // Add existential currency identifier to this account + AccountCurrencies::::insert(who, currency_id, true); // if new, increase account provider frame_system::Pallet::::inc_providers(who); } if let Some(dust_amount) = handle_dust { + // Remove existential currency identifier to this account + AccountCurrencies::::remove(who, currency_id); // `OnDust` maybe get/set storage `Accounts` of `who`, trigger handler here // to avoid some unexpected errors. T::OnDust::on_dust(who, currency_id, dust_amount); @@ -1353,10 +1357,11 @@ impl Pallet { } pub(crate) fn dead_account( + id: T::CurrencyId, who: &T::AccountId, - _d: &mut TokenDetails, ) { frame_system::Pallet::::dec_consumers(who); + AccountCurrencies::::remove(who, id) } } diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index 927010e5..140676c7 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -544,10 +544,8 @@ fn minimum_balance_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); assert_eq!(Tokens::minimum_balance(BTC), 1); assert_eq!(Tokens::minimum_balance(DOT), 2); - assert_eq!(Tokens::minimum_balance(ETH), 1); }); } @@ -599,7 +597,7 @@ fn set_lock_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -621,7 +619,7 @@ fn extend_lock_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -642,7 +640,7 @@ fn remove_lock_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -659,7 +657,7 @@ fn frozen_can_limit_liquidity() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -678,7 +676,7 @@ fn can_reserve_is_correct() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -693,7 +691,7 @@ fn reserve_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -714,7 +712,7 @@ fn unreserve_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -739,7 +737,7 @@ fn slash_reserved_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -763,7 +761,7 @@ fn repatriate_reserved_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -817,7 +815,7 @@ fn slash_draw_reserved_correct() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -843,7 +841,7 @@ fn genesis_issuance_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -858,7 +856,7 @@ fn transfer_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); @@ -885,7 +883,7 @@ fn transfer_all_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -905,7 +903,7 @@ fn deposit_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -925,7 +923,7 @@ fn withdraw_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -942,7 +940,7 @@ fn slash_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -963,7 +961,7 @@ fn update_balance_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -984,7 +982,7 @@ fn ensure_can_withdraw_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -1017,9 +1015,8 @@ fn merge_account_should_work() { new_test_ext().execute_with(|| { assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); - assert_ok!(Tokens::force_create(Origin::root(), ETH, 1, 1)); + assert_ok!(Tokens::deposit(BTC, &ALICE, 200)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); - assert_ok!(Tokens::deposit(DOT, &BOB, 100)); assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); assert_eq!(Tokens::free_balance(BTC, &ALICE), 200); From d8e12f7da563fb59e4e0a469c4a9d2f4f5fa465c Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 14 Apr 2021 14:38:54 +0300 Subject: [PATCH 12/14] Fix no_op test --- pallets/tokens/src/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index 140676c7..82ac6b65 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -999,6 +999,7 @@ fn ensure_can_withdraw_should_work() { #[test] fn no_op_if_amount_is_zero() { new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 0)); assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 0)); assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, ALICE, 0)); From 37baeff675821005a61b07cbca087e085c09fbf6 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 14 Apr 2021 17:02:38 +0300 Subject: [PATCH 13/14] Updates, dust test not working --- pallets/tokens/src/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index 82ac6b65..63a89193 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -573,8 +573,9 @@ fn remove_dust_work() { assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 0); assert_eq!(System::providers(&DustAccount::get()), 0); + assert_eq!(Tokens::total_issuance(DOT), 2); assert_ok!(Tokens::withdraw(DOT, &DAVE, 1)); - assert_eq!(Tokens::free_balance(DOT, &DAVE), 1); + assert_eq!(Tokens::total_issuance(DOT), 1); assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 1); // total is lte ED, will handle dust assert_eq!(Tokens::total_issuance(DOT), 1); From 8daf59d042bbdb9e940e10ad6d7cfd5e0c695235 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Thu, 15 Apr 2021 02:14:39 +0300 Subject: [PATCH 14/14] Fix all tests --- pallets/tokens/src/lib.rs | 88 +++-- pallets/tokens/src/mock.rs | 25 +- pallets/tokens/src/tests.rs | 642 +++++++++++++++++------------------ pallets/tokens/src/traits.rs | 1 + pallets/tokens/src/types.rs | 8 + runtime/src/lib.rs | 2 +- 6 files changed, 402 insertions(+), 364 deletions(-) diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs index 035c6bba..386b21dd 100644 --- a/pallets/tokens/src/lib.rs +++ b/pallets/tokens/src/lib.rs @@ -57,7 +57,7 @@ use orml_traits::{ arithmetic::{self, Signed}, BasicCurrencyExtended, BasicLockableCurrency, BasicReservableCurrency, BalanceStatus, LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, - MultiReservableCurrency, OnDust, + MultiReservableCurrency, }; pub use weights::WeightInfo; @@ -128,12 +128,9 @@ pub mod pallet { /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; - - /// Handler to burn or transfer account's dust - type OnDust: OnDust; - // /// Handler to assign different balance updates - // type OnTransfer: OnTransfer; + /// The default account to send dust to. + type DustAccount: Get; } #[pallet::event] @@ -185,6 +182,8 @@ pub mod pallet { /// ExistentialDeposit, resulting in an outright loss. \[account, /// currency_id, amount\] DustLost(T::AccountId, T::CurrencyId, T::Balance), + /// Dust handler change success. \[currency_id, dust_type\] + DustHandlerChange(T::CurrencyId, DustHandlerType), } #[pallet::error] @@ -419,6 +418,7 @@ pub mod pallet { min_balance, approvals: 0, is_frozen: false, + dust_type: DustHandlerType::Transfer(T::DustAccount::get()), }); Self::deposit_event(Event::ForceCreated(id, owner)); Ok(()) @@ -1220,6 +1220,39 @@ pub mod pallet { Self::deposit_event(Event::Transferred(id, from, to, amount)); Ok(()) } + + /// Set the dust handler type. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `source`: The account to be debited. + /// - `dest`: The account to be credited. + /// - `amount`: The amount by which the `source`'s balance of assets should be reduced and + /// `dest`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the `source` balance above zero but + /// below the minimum balance. Must be greater than zero. + /// + /// Emits `DustHandlerChange` with the currency_id and new handler type. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_dust_type( + origin: OriginFor, + id: T::CurrencyId, + dust_type: DustHandlerType, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.admin, Error::::NoPermission); + + details.dust_type = dust_type.clone(); + Self::deposit_event(Event::DustHandlerChange(id, dust_type)); + Ok(()) + }) + } } } @@ -1281,7 +1314,7 @@ impl Pallet { AccountCurrencies::::remove(who, currency_id); // `OnDust` maybe get/set storage `Accounts` of `who`, trigger handler here // to avoid some unexpected errors. - T::OnDust::on_dust(who, currency_id, dust_amount); + >::handle_dust(currency_id, who, dust_amount); Self::deposit_event(Event::DustLost(who.clone(), currency_id, dust_amount)); } @@ -1363,6 +1396,10 @@ impl Pallet { frame_system::Pallet::::dec_consumers(who); AccountCurrencies::::remove(who, id) } + + pub(crate) fn get_pallet_account() -> T::AccountId { + T::PalletId::get().into_account() + } } impl MultiCurrency for Pallet { @@ -1427,7 +1464,9 @@ impl MultiCurrency for Pallet { .ok_or(Error::::BalanceOverflow)?; let details = Token::::get(currency_id).ok_or(Error::::Unknown)?; - ensure!(to_balance >= details.min_balance, Error::::BelowMinimum); + if !Self::is_module_account_id(to) { + ensure!(to_balance >= details.min_balance, Error::::BelowMinimum); + } // check if sender goes below min balance and send remaining to recipient let dust = if from_balance - amount < details.min_balance { @@ -1868,7 +1907,6 @@ where let currency_id = GetCurrencyId::get(); Pallet::::ensure_can_withdraw(currency_id, who, value)?; Pallet::::set_free_balance(currency_id, who, Pallet::::free_balance(currency_id, who) - value); - Ok(Self::NegativeImbalance::new(value)) } @@ -1996,6 +2034,7 @@ impl ExtendedTokenSystem for min_balance, approvals: 0, is_frozen: false, + dust_type: DustHandlerType::Transfer(T::DustAccount::get()), }); Ok(()) @@ -2038,26 +2077,17 @@ impl ExtendedTokenSystem for >::mutate(currency_id, |v| *v -= amount - remaining_burn); Ok(()) } -} - -pub struct TransferDust(marker::PhantomData<(T, GetAccountId)>); -impl OnDust for TransferDust -where - T: Config, - GetAccountId: Get, -{ - fn on_dust(who: &T::AccountId, currency_id: T::CurrencyId, amount: T::Balance) { - // transfer the dust to treasury account, ignore the result, - // if failed will leave some dust which still could be recycled. - let _ = as MultiCurrency>::transfer(currency_id, who, &GetAccountId::get(), amount); - } -} -pub struct BurnDust(marker::PhantomData); -impl OnDust for BurnDust { - fn on_dust(who: &T::AccountId, currency_id: T::CurrencyId, amount: T::Balance) { - // burn the dust, ignore the result, - // if failed will leave some dust which still could be recycled. - let _ = Pallet::::withdraw(currency_id, who, amount); + fn handle_dust(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + if let Some(token) = Token::::get(currency_id) { + match token.dust_type { + DustHandlerType::Burn => { + let _ =Pallet::::withdraw(currency_id, who, amount); + }, + DustHandlerType::Transfer(acc) => { + let _ = as MultiCurrency>::transfer(currency_id, who, &acc, amount); + } + } + } } } diff --git a/pallets/tokens/src/mock.rs b/pallets/tokens/src/mock.rs index ce4140e3..424627a1 100644 --- a/pallets/tokens/src/mock.rs +++ b/pallets/tokens/src/mock.rs @@ -10,22 +10,22 @@ use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Perbill, + Perbill, AccountId32, }; pub(crate) type Balance = u64; pub type Amount = i128; pub type CurrencyId = u64; -pub type AccountId = u64; +pub type AccountId = AccountId32; pub type BlockNumber = u64; pub const DOT: CurrencyId = 1; pub const BTC: CurrencyId = 2; pub const ETH: CurrencyId = 3; -pub const ALICE: AccountId = 1u64; -pub const BOB: AccountId = 2u64; -pub const DAVE: AccountId = 4u64; -pub const TREASURY_ACCOUNT: AccountId = 3u64; +pub const ALICE: AccountId = AccountId32::new([0u8; 32]); +pub const BOB: AccountId = AccountId32::new([1u8; 32]); +pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([2u8; 32]); +pub const DAVE: AccountId = AccountId::new([4u8; 32]); pub const ID_1: LockIdentifier = *b"1 "; pub const ID_2: LockIdentifier = *b"2 "; @@ -138,7 +138,7 @@ parameter_types! { } parameter_types! { - pub DustAccount: AccountId = PalletId(*b"orml/dst").into_account(); + pub DustAccount: AccountId = PalletId(*b"webb/dst").into_account(); } impl Config for Test { @@ -148,14 +148,13 @@ impl Config for Test { type Amount = i128; type CurrencyId = CurrencyId; type NativeCurrency = BasicCurrencyAdapter; - type ForceOrigin = frame_system::EnsureRoot; + type ForceOrigin = frame_system::EnsureRoot; type CurrencyDeposit = CurrencyDeposit; type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; - type OnDust = TransferDust; - // type OnDust = BurnDust; + type DustAccount = DustAccount; type WeightInfo = (); type Extra = (); } @@ -170,9 +169,9 @@ pub fn new_test_ext() -> sp_io::TestExternalities { BalancesConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![ - (0, 1_000_000_000_000_000_000), - (1, 1_000_000_000_000_000_000), - (2, 1_000_000_000_000_000_000), + (ALICE, 1_000_000_000_000_000_000), + (BOB, 1_000_000_000_000_000_000), + (TREASURY_ACCOUNT, 1_000_000_000_000_000_000), (whitelisted_caller(), 1_000_000_000_000_000_000), ], } diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs index 63a89193..ef84187d 100644 --- a/pallets/tokens/src/tests.rs +++ b/pallets/tokens/src/tests.rs @@ -30,375 +30,375 @@ use pallet_balances::Error as BalancesError; #[test] fn basic_minting_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 100)); - assert_eq!(Tokens::free_balance(0, &2), 100); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); }); } #[test] fn approval_lifecycle_works() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Balances::reserved_balance(&1), 1); - assert_ok!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 40)); - assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); - assert_eq!(Tokens::free_balance(0, &1), 60); - assert_eq!(Tokens::free_balance(0, &3), 40); - assert_eq!(Balances::reserved_balance(&1), 0); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert_ok!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 40)); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 60); + assert_eq!(Tokens::free_balance(DOT, &TREASURY_ACCOUNT), 40); + assert_eq!(Balances::reserved_balance(&ALICE), 0); }); } #[test] fn approval_deposits_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 10, 1)); - assert_ok!(Tokens::mint(Origin::signed(10), 0, 1, 100)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, AccountId::new([10u8; 32]), 1)); + assert_ok!(Tokens::mint(Origin::signed(AccountId::new([10u8; 32])), DOT, ALICE, 100)); let e = BalancesError::::InsufficientBalance; - assert_noop!(Tokens::approve_transfer(Origin::signed(10), 0, 2, 50), e); + assert_noop!(Tokens::approve_transfer(Origin::signed(AccountId::new([10u8; 32])), DOT, BOB, 50), e); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Balances::reserved_balance(&1), 1); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); - assert_ok!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 50)); - assert_eq!(Balances::reserved_balance(&1), 0); + assert_ok!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); - assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); - assert_eq!(Balances::reserved_balance(&1), 0); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); }); } #[test] fn cannot_transfer_more_than_approved() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); let e = Error::::Unapproved; - assert_noop!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 51), e); + assert_noop!(Tokens::transfer_approved(Origin::signed(BOB), DOT, BOB, TREASURY_ACCOUNT, 51), e); }); } #[test] fn cannot_transfer_more_than_exists() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 101)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 101)); let e = Error::::BalanceLow; - assert_noop!(Tokens::transfer_approved(Origin::signed(2), 0, 1, 3, 101), e); + assert_noop!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 101), e); }); } #[test] fn cancel_approval_works() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); - assert_noop!(Tokens::cancel_approval(Origin::signed(1), 1, 2), Error::::Unknown); - assert_noop!(Tokens::cancel_approval(Origin::signed(2), 0, 2), Error::::Unknown); - assert_noop!(Tokens::cancel_approval(Origin::signed(1), 0, 3), Error::::Unknown); - assert_ok!(Tokens::cancel_approval(Origin::signed(1), 0, 2)); - assert_noop!(Tokens::cancel_approval(Origin::signed(1), 0, 2), Error::::Unknown); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), BTC, BOB), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(BOB), DOT, BOB), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, TREASURY_ACCOUNT), Error::::Unknown); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB), Error::::Unknown); }); } #[test] fn force_cancel_approval_works() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - Balances::make_free_balance_be(&1, 1); - assert_ok!(Tokens::approve_transfer(Origin::signed(1), 0, 2, 50)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); let e = Error::::NoPermission; - assert_noop!(Tokens::force_cancel_approval(Origin::signed(2), 0, 1, 2), e); - assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 1, 1, 2), Error::::Unknown); - assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 2, 2), Error::::Unknown); - assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 3), Error::::Unknown); - assert_ok!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 2)); - assert_noop!(Tokens::force_cancel_approval(Origin::signed(1), 0, 1, 2), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(BOB), DOT, ALICE, BOB), e); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), BTC, ALICE, BOB), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, BOB, BOB), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, TREASURY_ACCOUNT), Error::::Unknown); + assert_ok!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, BOB)); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, BOB), Error::::Unknown); }); } #[test] fn lifecycle_should_work() { new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); - assert_eq!(Balances::reserved_balance(&1), 1); - assert!(Token::::contains_key(0)); - - assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0], vec![0], 12)); - assert_eq!(Balances::reserved_balance(&1), 4); - assert!(Metadata::::contains_key(0)); - - Balances::make_free_balance_be(&10, 100); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 10, 100)); - Balances::make_free_balance_be(&20, 100); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 20, 100)); - assert_eq!(Accounts::::iter_prefix(0).count(), 2); - - assert_ok!(Tokens::destroy(Origin::signed(1), 0)); - assert_eq!(Balances::reserved_balance(&1), 0); - - assert!(!Token::::contains_key(0)); - assert!(!Metadata::::contains_key(0)); - assert_eq!(Accounts::::iter_prefix(0).count(), 0); - - assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); - assert_eq!(Balances::reserved_balance(&1), 1); - assert!(Token::::contains_key(0)); - - assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0], vec![0], 12)); - assert_eq!(Balances::reserved_balance(&1), 4); - assert!(Metadata::::contains_key(0)); - - assert_ok!(Tokens::mint(Origin::signed(1), 0, 10, 100)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 20, 100)); - assert_eq!(Accounts::::iter_prefix(0).count(), 2); - - assert_ok!(Tokens::destroy(Origin::root(), 0)); - assert_eq!(Balances::reserved_balance(&1), 0); - - assert!(!Token::::contains_key(0)); - assert!(!Metadata::::contains_key(0)); - assert_eq!(Accounts::::iter_prefix(0).count(), 0); + Balances::make_free_balance_be(&ALICE, 100); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert!(Token::::contains_key(DOT)); + + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&ALICE), 4); + assert!(Metadata::::contains_key(DOT)); + + Balances::make_free_balance_be(&AccountId::new([10u8; 32]), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([10u8; 32]), 100)); + Balances::make_free_balance_be(&AccountId::new([20u8; 32]), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([20u8; 32]), 100)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 2); + + assert_ok!(Tokens::destroy(Origin::signed(ALICE), DOT)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert!(!Token::::contains_key(DOT)); + assert!(!Metadata::::contains_key(DOT)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 0); + + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert!(Token::::contains_key(DOT)); + + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&ALICE), 4); + assert!(Metadata::::contains_key(DOT)); + + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([10u8; 32]), 100)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([20u8; 32]), 100)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 2); + + assert_ok!(Tokens::destroy(Origin::root(), DOT)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert!(!Token::::contains_key(DOT)); + assert!(!Metadata::::contains_key(DOT)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 0); }); } #[test] fn min_balance_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 10)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 10)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); // Cannot create a new account with a balance that is below minimum... - assert_noop!(Tokens::mint(Origin::signed(1), 0, 2, 9), Error::::BelowMinimum); - assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 9), Error::::BelowMinimum); - assert_noop!(Tokens::force_transfer(Origin::signed(1), 0, 1, 2, 9), Error::::BelowMinimum); + assert_noop!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 9), Error::::BelowMinimum); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 9), Error::::BelowMinimum); + assert_noop!(Tokens::force_transfer(Origin::signed(ALICE), DOT, ALICE, BOB, 9), Error::::BelowMinimum); // When deducting from an account to below minimum, it should be reaped. - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 100)); - assert!(Tokens::free_balance(0, &1).is_zero()); - assert_eq!(Tokens::free_balance(0, &2), 100); - assert_eq!(Tokens::total_issuance(0), 100); - assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); - - assert_ok!(Tokens::force_transfer(Origin::signed(1), 0, 2, 1, 100)); - assert!(Tokens::free_balance(0, &2).is_zero()); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 1); - - assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, 100)); - assert!(Tokens::free_balance(0, &1).is_zero()); - assert_eq!(Accounts::::iter_prefix_values(0).into_iter().map(|e| e).collect::>>().len(), 0); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 100)); + assert!(Tokens::free_balance(DOT, &ALICE).is_zero()); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::total_issuance(DOT), 100); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::force_transfer(Origin::signed(ALICE), DOT, BOB, ALICE, 100)); + assert!(Tokens::free_balance(DOT, &BOB).is_zero()); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, 100)); + assert!(Tokens::free_balance(DOT, &ALICE).is_zero()); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 0); }); } #[test] fn querying_total_supply_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Tokens::free_balance(0, &1), 50); - assert_eq!(Tokens::free_balance(0, &2), 50); - assert_ok!(Tokens::transfer(Origin::signed(2), 0, 3, 31)); - assert_eq!(Tokens::free_balance(0, &1), 50); - assert_eq!(Tokens::free_balance(0, &2), 19); - assert_eq!(Tokens::free_balance(0, &3), 31); - assert_ok!(Tokens::burn(Origin::signed(1), 0, 3, u64::max_value())); - assert_eq!(Tokens::total_issuance(0), 69); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_ok!(Tokens::transfer(Origin::signed(BOB), DOT, TREASURY_ACCOUNT, 31)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 19); + assert_eq!(Tokens::free_balance(DOT, &TREASURY_ACCOUNT), 31); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, TREASURY_ACCOUNT, u64::max_value())); + assert_eq!(Tokens::total_issuance(DOT), 69); }); } #[test] fn transferring_amount_below_available_balance_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Tokens::free_balance(0, &1), 50); - assert_eq!(Tokens::free_balance(0, &2), 50); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); }); } #[test] fn transferring_enough_to_kill_source_when_keep_alive_should_fail() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 10)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_noop!(Tokens::transfer_keep_alive(Origin::signed(1), 0, 2, 91), Error::::WouldDie); - assert_ok!(Tokens::transfer_keep_alive(Origin::signed(1), 0, 2, 90)); - assert_eq!(Tokens::free_balance(0, &1), 10); - assert_eq!(Tokens::free_balance(0, &2), 90); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 10)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_noop!(Tokens::transfer_keep_alive(Origin::signed(ALICE), DOT, BOB, 91), Error::::WouldDie); + assert_ok!(Tokens::transfer_keep_alive(Origin::signed(ALICE), DOT, BOB, 90)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 10); + assert_eq!(Tokens::free_balance(DOT, &BOB), 90); }); } #[test] fn transferring_frozen_user_should_not_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::freeze(Origin::signed(1), 0, 1)); - assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 50), Error::::Frozen); - assert_ok!(Tokens::thaw(Origin::signed(1), 0, 1)); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::freeze(Origin::signed(ALICE), DOT, ALICE)); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50), Error::::Frozen); + assert_ok!(Tokens::thaw(Origin::signed(ALICE), DOT, ALICE)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); }); } #[test] fn transferring_frozen_asset_should_not_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::freeze_asset(Origin::signed(1), 0)); - assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 50), Error::::TokenIsFrozen); - assert_ok!(Tokens::thaw_asset(Origin::signed(1), 0)); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::freeze_asset(Origin::signed(ALICE), DOT)); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50), Error::::TokenIsFrozen); + assert_ok!(Tokens::thaw_asset(Origin::signed(ALICE), DOT)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); }); } #[test] fn origin_guards_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_noop!(Tokens::transfer_ownership(Origin::signed(2), 0, 2), Error::::NoPermission); - assert_noop!(Tokens::set_team(Origin::signed(2), 0, 2, 2, 2), Error::::NoPermission); - assert_noop!(Tokens::freeze(Origin::signed(2), 0, 1), Error::::NoPermission); - assert_noop!(Tokens::thaw(Origin::signed(2), 0, 2), Error::::NoPermission); - assert_noop!(Tokens::mint(Origin::signed(2), 0, 2, 100), Error::::NoPermission); - assert_noop!(Tokens::burn(Origin::signed(2), 0, 1, 100), Error::::NoPermission); - assert_noop!(Tokens::force_transfer(Origin::signed(2), 0, 1, 2, 100), Error::::NoPermission); - assert_noop!(Tokens::destroy(Origin::signed(2), 0), Error::::NoPermission); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_noop!(Tokens::transfer_ownership(Origin::signed(BOB), DOT, BOB), Error::::NoPermission); + assert_noop!(Tokens::set_team(Origin::signed(BOB), DOT, BOB, BOB, BOB), Error::::NoPermission); + assert_noop!(Tokens::freeze(Origin::signed(BOB), DOT, ALICE), Error::::NoPermission); + assert_noop!(Tokens::thaw(Origin::signed(BOB), DOT, BOB), Error::::NoPermission); + assert_noop!(Tokens::mint(Origin::signed(BOB), DOT, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::burn(Origin::signed(BOB), DOT, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::force_transfer(Origin::signed(BOB), DOT, BOB, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::destroy(Origin::signed(BOB), DOT), Error::::NoPermission); }); } #[test] fn transfer_owner_should_work() { new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - Balances::make_free_balance_be(&2, 100); - assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 1)); + Balances::make_free_balance_be(&ALICE, 100); + Balances::make_free_balance_be(&BOB, 100); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); - assert_eq!(Balances::reserved_balance(&1), 1); + assert_eq!(Balances::reserved_balance(&ALICE), 1); - assert_ok!(Tokens::transfer_ownership(Origin::signed(1), 0, 2)); - assert_eq!(Balances::reserved_balance(&2), 1); - assert_eq!(Balances::reserved_balance(&1), 0); + assert_ok!(Tokens::transfer_ownership(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Balances::reserved_balance(&BOB), 1); + assert_eq!(Balances::reserved_balance(&ALICE), 0); - assert_noop!(Tokens::transfer_ownership(Origin::signed(1), 0, 1), Error::::NoPermission); + assert_noop!(Tokens::transfer_ownership(Origin::signed(ALICE), DOT, ALICE), Error::::NoPermission); // Set metadata now and make sure that deposit gets transferred back. - assert_ok!(Tokens::set_metadata(Origin::signed(2), 0, vec![0u8; 10], vec![0u8; 10], 12)); - assert_ok!(Tokens::transfer_ownership(Origin::signed(2), 0, 1)); - assert_eq!(Balances::reserved_balance(&1), 22); - assert_eq!(Balances::reserved_balance(&2), 0); + assert_ok!(Tokens::set_metadata(Origin::signed(BOB), DOT, vec![0u8; 10], vec![0u8; 10], 12)); + assert_ok!(Tokens::transfer_ownership(Origin::signed(BOB), DOT, ALICE)); + assert_eq!(Balances::reserved_balance(&ALICE), 22); + assert_eq!(Balances::reserved_balance(&BOB), 0); }); } #[test] fn set_team_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::set_team(Origin::signed(1), 0, 2, 3, 4)); - - assert_ok!(Tokens::mint(Origin::signed(2), 0, 2, 100)); - assert_ok!(Tokens::freeze(Origin::signed(4), 0, 2)); - assert_ok!(Tokens::thaw(Origin::signed(3), 0, 2)); - assert_ok!(Tokens::force_transfer(Origin::signed(3), 0, 2, 3, 100)); - assert_ok!(Tokens::burn(Origin::signed(3), 0, 3, 100)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::set_team(Origin::signed(ALICE), DOT, BOB, TREASURY_ACCOUNT, DAVE)); + + assert_ok!(Tokens::mint(Origin::signed(BOB), DOT, BOB, 100)); + assert_ok!(Tokens::freeze(Origin::signed(DAVE), DOT, BOB)); + assert_ok!(Tokens::thaw(Origin::signed(TREASURY_ACCOUNT), DOT, BOB)); + assert_ok!(Tokens::force_transfer(Origin::signed(TREASURY_ACCOUNT), DOT, BOB, TREASURY_ACCOUNT, 100)); + assert_ok!(Tokens::burn(Origin::signed(TREASURY_ACCOUNT), DOT, TREASURY_ACCOUNT, 100)); }); } #[test] fn transferring_to_frozen_account_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_eq!(Tokens::free_balance(0, &2), 100); - assert_ok!(Tokens::freeze(Origin::signed(1), 0, 2)); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Tokens::free_balance(0, &2), 150); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_ok!(Tokens::freeze(Origin::signed(ALICE), DOT, BOB)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 150); }); } #[test] fn transferring_amount_more_than_available_balance_should_not_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Tokens::free_balance(0, &1), 50); - assert_eq!(Tokens::free_balance(0, &2), 50); - assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, u64::max_value())); - assert_eq!(Tokens::free_balance(0, &1), 0); - assert_noop!(Tokens::transfer(Origin::signed(2), 0, 1, 51), Error::::BalanceLow); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 51), Error::::BalanceLow); }); } #[test] fn transferring_less_than_one_unit_is_fine() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 0)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 0)); }); } #[test] fn transferring_more_units_than_total_supply_should_not_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_noop!(Tokens::transfer(Origin::signed(1), 0, 2, 101), Error::::BalanceLow); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 101), Error::::BalanceLow); }); } #[test] fn burning_asset_balance_with_positive_balance_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_ok!(Tokens::burn(Origin::signed(1), 0, 1, u64::max_value())); - assert_eq!(Tokens::free_balance(0, &1), 0); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); }); } #[test] fn burning_asset_balance_with_zero_balance_does_nothing() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Tokens::free_balance(0, &1), 100); - assert_eq!(Tokens::free_balance(0, &2), 0); - assert_ok!(Tokens::burn(Origin::signed(1), 0, 2, u64::max_value())); - assert_eq!(Tokens::free_balance(0, &2), 0); - assert_eq!(Tokens::total_supply(0), 100); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, BOB, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_eq!(Tokens::total_supply(DOT), 100); }); } @@ -407,49 +407,49 @@ fn set_metadata_should_work() { new_test_ext().execute_with(|| { // Cannot add metadata to unknown asset assert_noop!( - Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 10], 12), + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 10], 12), Error::::Unknown, ); - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); // Cannot add metadata to unowned asset assert_noop!( - Tokens::set_metadata(Origin::signed(2), 0, vec![0u8; 10], vec![0u8; 10], 12), + Tokens::set_metadata(Origin::signed(BOB), DOT, vec![0u8; 10], vec![0u8; 10], 12), Error::::NoPermission, ); // Cannot add oversized metadata assert_noop!( - Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 100], vec![0u8; 10], 12), + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 100], vec![0u8; 10], 12), Error::::BadMetadata, ); assert_noop!( - Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 100], 12), + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 100], 12), Error::::BadMetadata, ); // Successfully add metadata and take deposit - Balances::make_free_balance_be(&1, 30); - assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 10], 12)); - assert_eq!(Balances::free_balance(&1), 9); + Balances::make_free_balance_be(&ALICE, 30); + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 10], 12)); + assert_eq!(Balances::free_balance(&ALICE), 9); // Update deposit - assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 5], 12)); - assert_eq!(Balances::free_balance(&1), 14); - assert_ok!(Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 10], vec![0u8; 15], 12)); - assert_eq!(Balances::free_balance(&1), 4); + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 5], 12)); + assert_eq!(Balances::free_balance(&ALICE), 14); + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 15], 12)); + assert_eq!(Balances::free_balance(&ALICE), 4); // Cannot over-reserve assert_noop!( - Tokens::set_metadata(Origin::signed(1), 0, vec![0u8; 20], vec![0u8; 20], 12), + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 20], vec![0u8; 20], 12), BalancesError::::InsufficientBalance, ); // Clear Metadata - assert!(Metadata::::contains_key(0)); - assert_noop!(Tokens::clear_metadata(Origin::signed(2), 0), Error::::NoPermission); - assert_noop!(Tokens::clear_metadata(Origin::signed(1), 1), Error::::Unknown); - assert_ok!(Tokens::clear_metadata(Origin::signed(1), 0)); - assert!(!Metadata::::contains_key(0)); + assert!(Metadata::::contains_key(DOT)); + assert_noop!(Tokens::clear_metadata(Origin::signed(BOB), DOT), Error::::NoPermission); + assert_noop!(Tokens::clear_metadata(Origin::signed(ALICE), BTC), Error::::Unknown); + assert_ok!(Tokens::clear_metadata(Origin::signed(ALICE), DOT)); + assert!(!Metadata::::contains_key(DOT)); }); } @@ -457,39 +457,39 @@ fn set_metadata_should_work() { fn force_metadata_should_work() { new_test_ext().execute_with(|| { //force set metadata works - assert_ok!(Tokens::force_create(Origin::root(), 0, 1, 1)); - assert_ok!(Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; 10], vec![0u8; 10], 8, false)); - assert!(Metadata::::contains_key(0)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; 10], vec![0u8; 10], 8, false)); + assert!(Metadata::::contains_key(DOT)); //overwrites existing metadata - let asset_original_metadata = Metadata::::get(0); - assert_ok!(Tokens::force_set_metadata(Origin::root(), 0, vec![1u8; 10], vec![1u8; 10], 8, false)); - assert_ne!(Metadata::::get(0), asset_original_metadata); + let asset_original_metadata = Metadata::::get(DOT); + assert_ok!(Tokens::force_set_metadata(Origin::root(), DOT, vec![1u8; 10], vec![1u8; 10], 8, false)); + assert_ne!(Metadata::::get(DOT), asset_original_metadata); //attempt to set metadata for non-existent asset class assert_noop!( - Tokens::force_set_metadata(Origin::root(), 1, vec![0u8; 10], vec![0u8; 10], 8, false), + Tokens::force_set_metadata(Origin::root(), BTC, vec![0u8; 10], vec![0u8; 10], 8, false), Error::::Unknown ); //string length limit check let limit = StringLimit::get() as usize; assert_noop!( - Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; limit + 1], vec![0u8; 10], 8, false), + Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; limit + 1], vec![0u8; 10], 8, false), Error::::BadMetadata ); assert_noop!( - Tokens::force_set_metadata(Origin::root(), 0, vec![0u8; 10], vec![0u8; limit + 1], 8, false), + Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; 10], vec![0u8; limit + 1], 8, false), Error::::BadMetadata ); //force clear metadata works - assert!(Metadata::::contains_key(0)); - assert_ok!(Tokens::force_clear_metadata(Origin::root(), 0)); - assert!(!Metadata::::contains_key(0)); + assert!(Metadata::::contains_key(DOT)); + assert_ok!(Tokens::force_clear_metadata(Origin::root(), DOT)); + assert!(!Metadata::::contains_key(DOT)); //Error handles clearing non-existent asset class - assert_noop!(Tokens::force_clear_metadata(Origin::root(), 1), Error::::Unknown); + assert_noop!(Tokens::force_clear_metadata(Origin::root(), BTC), Error::::Unknown); }); } @@ -497,42 +497,42 @@ fn force_metadata_should_work() { #[test] fn force_asset_status_should_work(){ new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 10); - Balances::make_free_balance_be(&2, 10); - assert_ok!(Tokens::create(Origin::signed(1), 0, 1, 30)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 1, 50)); - assert_ok!(Tokens::mint(Origin::signed(1), 0, 2, 150)); + Balances::make_free_balance_be(&ALICE, 10); + Balances::make_free_balance_be(&BOB, 10); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 30)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 50)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 150)); //force asset status to change min_balance > balance - assert_ok!(Tokens::force_asset_status(Origin::root(), 0, 1, 1, 1, 1, 100, false)); - assert_eq!(Tokens::free_balance(0, &1), 50); + assert_ok!(Tokens::force_asset_status(Origin::root(), DOT, ALICE, ALICE, ALICE, ALICE, 100, false)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); //account can NOT receive Tokens for balance < min_balance - assert_noop!(Tokens::transfer(Origin::signed(2), 0, 1, 1), Error::::BelowMinimum); - assert_eq!(Tokens::free_balance(0, &1), 50); + assert_noop!(Tokens::transfer(Origin::signed(BOB), DOT, ALICE, 1), Error::::BelowMinimum); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); //account can send tokens for balance < min_balance - assert_ok!(Tokens::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Tokens::free_balance(0, &1), 0); - assert_eq!(Tokens::free_balance(0, &2), 200); - assert_eq!(Tokens::total_supply(0), 200); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 200); + assert_eq!(Tokens::total_supply(DOT), 200); //won't create new account with balance below min_balance - assert_noop!(Tokens::transfer(Origin::signed(2), 0, 3, 50), Error::::BelowMinimum); + assert_noop!(Tokens::transfer(Origin::signed(BOB), DOT, TREASURY_ACCOUNT, 50), Error::::BelowMinimum); //force asset status will not execute for non-existent class assert_noop!( - Tokens::force_asset_status(Origin::root(), 1, 1, 1, 1, 1, 90, false), + Tokens::force_asset_status(Origin::root(), BTC, ALICE, ALICE, ALICE, ALICE, 90, false), Error::::Unknown ); //account drains to completion when funds dip below min_balance - assert_ok!(Tokens::force_asset_status(Origin::root(), 0, 1, 1, 1, 1, 110, false)); - assert_eq!(Tokens::total_supply(0), 200); - assert_ok!(Tokens::transfer(Origin::signed(2), 0, 1, 110)); - assert_eq!(Tokens::free_balance(0, &1), 200); - assert_eq!(Tokens::free_balance(0, &2), 0); - assert_eq!(Tokens::total_supply(0), 200); + assert_ok!(Tokens::force_asset_status(Origin::root(), DOT, ALICE, ALICE, ALICE, ALICE, 110, false)); + assert_eq!(Tokens::total_supply(DOT), 200); + assert_ok!(Tokens::transfer(Origin::signed(BOB), DOT, ALICE, 110)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 200); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_eq!(Tokens::total_supply(DOT), 200); }); } @@ -542,8 +542,8 @@ fn force_asset_status_should_work(){ #[test] fn minimum_balance_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_eq!(Tokens::minimum_balance(BTC), 1); assert_eq!(Tokens::minimum_balance(DOT), 2); }); @@ -553,7 +553,7 @@ fn minimum_balance_work() { fn remove_dust_work() { new_test_ext().execute_with(|| { System::set_block_number(1); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &DAVE, 100)); assert_eq!(Tokens::total_issuance(DOT), 100); assert_eq!(Accounts::::contains_key(DOT, DAVE), true); @@ -596,21 +596,21 @@ fn remove_dust_work() { #[test] fn set_lock_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 10); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen(), 10); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 10); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen(), 10); assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 50)); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 50); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 50); assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); assert_ok!(Tokens::set_lock(ID_2, DOT, &ALICE, 60)); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 60); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 60); assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); }); } @@ -618,18 +618,18 @@ fn set_lock_should_work() { #[test] fn extend_lock_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 10); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 10); assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); - assert_eq!(Tokens::accounts(&ALICE, DOT).frozen, 20); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 20); assert_ok!(Tokens::extend_lock(ID_2, DOT, &ALICE, 10)); assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); @@ -639,8 +639,8 @@ fn extend_lock_should_work() { #[test] fn remove_lock_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -656,8 +656,8 @@ fn remove_lock_should_work() { #[test] fn frozen_can_limit_liquidity() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -675,8 +675,8 @@ fn frozen_can_limit_liquidity() { #[test] fn can_reserve_is_correct() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -690,8 +690,8 @@ fn can_reserve_is_correct() { #[test] fn reserve_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -711,8 +711,8 @@ fn reserve_should_work() { #[test] fn unreserve_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -736,8 +736,8 @@ fn unreserve_should_work() { #[test] fn slash_reserved_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -760,8 +760,8 @@ fn slash_reserved_should_work() { #[test] fn repatriate_reserved_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -814,8 +814,8 @@ fn repatriate_reserved_should_work() { #[test] fn slash_draw_reserved_correct() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -840,8 +840,8 @@ fn slash_draw_reserved_correct() { #[test] fn genesis_issuance_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -855,8 +855,8 @@ fn genesis_issuance_should_work() { #[test] fn transfer_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -882,8 +882,8 @@ fn transfer_should_work() { #[test] fn transfer_all_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -902,8 +902,8 @@ fn transfer_all_should_work() { #[test] fn deposit_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -922,8 +922,8 @@ fn deposit_should_work() { #[test] fn withdraw_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -939,8 +939,8 @@ fn withdraw_should_work() { #[test] fn slash_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -960,8 +960,8 @@ fn slash_should_work() { #[test] fn update_balance_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -981,8 +981,8 @@ fn update_balance_should_work() { #[test] fn ensure_can_withdraw_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); assert_ok!(Tokens::deposit(DOT, &BOB, 100)); @@ -1000,7 +1000,7 @@ fn ensure_can_withdraw_should_work() { #[test] fn no_op_if_amount_is_zero() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 0)); assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 0)); assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, ALICE, 0)); @@ -1015,8 +1015,8 @@ fn no_op_if_amount_is_zero() { #[test] fn merge_account_should_work() { new_test_ext().execute_with(|| { - assert_ok!(Tokens::force_create(Origin::root(), BTC, 1, 1)); - assert_ok!(Tokens::force_create(Origin::root(), DOT, 1, 2)); + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); assert_ok!(Tokens::deposit(BTC, &ALICE, 200)); assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); diff --git a/pallets/tokens/src/traits.rs b/pallets/tokens/src/traits.rs index 591f156f..05999f12 100644 --- a/pallets/tokens/src/traits.rs +++ b/pallets/tokens/src/traits.rs @@ -7,4 +7,5 @@ pub trait ExtendedTokenSystem { -> Result<(), dispatch::DispatchError>; fn burn(currency_id: CurrencyId, account_id: AccountId, amount: Balance) -> Result<(), dispatch::DispatchError>; + fn handle_dust(currency_id: CurrencyId, account_id: &AccountId, amount: Balance); } diff --git a/pallets/tokens/src/types.rs b/pallets/tokens/src/types.rs index 2a171aaf..0261d339 100644 --- a/pallets/tokens/src/types.rs +++ b/pallets/tokens/src/types.rs @@ -1,5 +1,11 @@ use super::*; +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub enum DustHandlerType { + Burn, + Transfer(AccountId), +} + #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] pub struct TokenDetails< Balance, @@ -23,6 +29,8 @@ pub struct TokenDetails< pub(super) approvals: u32, /// Whether the currency is frozen for non-admin transfers. pub(super) is_frozen: bool, + /// The type of handler used to clean up dust + pub(super) dust_type: DustHandlerType, } /// A pair to act as a key for the approval storage map. diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 1aff838b..e32abef4 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -384,7 +384,7 @@ impl tokens::Config for Runtime { type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = StringLimit; - type OnDust = (); + type DustAccount = (); type WeightInfo = (); type Extra = (); }