diff --git a/Cargo.toml b/Cargo.toml index 9b3bfdf7f1..3c77aa5cdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,15 +19,15 @@ futures = "0.1.28" jsonrpc-core-client = { version = "14.0", features = ["ws"] } num-traits = { version = "0.2", default-features = false } parity-scale-codec = { version = "1.0", default-features = false, features = ["derive", "full"] } -runtime_metadata = { git = "https://github.com/paritytech/substrate/", package = "paint-metadata" } -runtime_support = { git = "https://github.com/paritytech/substrate/", package = "paint-support" } +runtime_metadata = { git = "https://github.com/paritytech/substrate/", package = "palette-metadata" } +runtime_support = { git = "https://github.com/paritytech/substrate/", package = "palette-support" } runtime_primitives = { git = "https://github.com/paritytech/substrate/", package = "sr-primitives" } serde = { version = "1.0", features = ["derive"] } sr-version = { git = "https://github.com/paritytech/substrate/", package = "sr-version" } -paint-system = { git = "https://github.com/paritytech/substrate/", package = "paint-system" } -paint-balances = { git = "https://github.com/paritytech/substrate/", package = "paint-balances" } -paint-contracts = { git = "https://github.com/paritytech/substrate/", package = "paint-contracts" } -paint-indices = { git = "https://github.com/paritytech/substrate/", package = "paint-indices" } +palette-system = { git = "https://github.com/paritytech/substrate/", package = "palette-system" } +pallet-balances = { git = "https://github.com/paritytech/substrate/", package = "pallet-balances" } +pallet-contracts = { git = "https://github.com/paritytech/substrate/", package = "pallet-contracts" } +pallet-indices = { git = "https://github.com/paritytech/substrate/", package = "pallet-indices" } substrate-rpc-api = { git = "https://github.com/paritytech/substrate/", package = "substrate-rpc-api" } substrate-rpc-primitives = { git = "https://github.com/paritytech/substrate/", package = "substrate-rpc-primitives" } substrate-primitives = { git = "https://github.com/paritytech/substrate/", package = "substrate-primitives" } diff --git a/src/events.rs b/src/events.rs index ec34844a5f..242e792356 100644 --- a/src/events.rs +++ b/src/events.rs @@ -20,12 +20,12 @@ use crate::{ Metadata, MetadataError, }, - paint::balances::Balances, + palette::balances::Balances, System, SystemEvent, }; use log; -use paint_system::Phase; +use palette_system::Phase; use parity_scale_codec::{ Codec, Compact, diff --git a/src/extrinsic.rs b/src/extrinsic.rs index 59e28f9d75..8709032fb3 100644 --- a/src/extrinsic.rs +++ b/src/extrinsic.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::paint::{ +use crate::palette::{ balances::Balances, system::System, }; @@ -40,7 +40,7 @@ use std::marker::PhantomData; use substrate_primitives::Pair; /// SignedExtra checks copied from substrate, in order to remove requirement to implement -/// substrate's `paint_system::Trait` +/// substrate's `palette_system::Trait` /// Ensure the runtime version registered in the transaction is the same as at present. /// diff --git a/src/lib.rs b/src/lib.rs index 5edac52f42..482e659bfb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ use crate::{ SignedExtra, }, metadata::MetadataError, - paint::{ + palette::{ balances::Balances, system::{ System, @@ -84,13 +84,13 @@ mod error; mod events; mod extrinsic; mod metadata; -mod paint; +mod palette; mod rpc; mod runtimes; pub use error::Error; pub use events::RawEvent; -pub use paint::*; +pub use palette::*; pub use rpc::ExtrinsicSuccess; pub use runtimes::*; @@ -415,7 +415,7 @@ where mod tests { use super::*; use crate::{ - paint::{ + palette::{ balances::{ Balances, BalancesStore, @@ -559,7 +559,7 @@ mod tests { let address: Address = dest.clone().into(); let amount: Balance = 10_000; - let transfer = paint_balances::Call::transfer(address.clone(), amount); + let transfer = pallet_balances::Call::transfer(address.clone(), amount); let call = node_runtime::Call::Balances(transfer); let call2 = balances .call("transfer", (address, codec::compact(amount))) @@ -567,7 +567,7 @@ mod tests { assert_eq!(call.encode().to_vec(), call2.0); let free_balance = - >::hashed_key_for(&dest); + >::hashed_key_for(&dest); let free_balance_key = StorageKey(free_balance); let free_balance_key2 = balances .storage("FreeBalance") @@ -578,7 +578,7 @@ mod tests { assert_eq!(free_balance_key, free_balance_key2); let account_nonce = - >::hashed_key_for(&dest); + >::hashed_key_for(&dest); let account_nonce_key = StorageKey(account_nonce); let account_nonce_key2 = client .metadata() diff --git a/src/paint/balances.rs b/src/palette/balances.rs similarity index 92% rename from src/paint/balances.rs rename to src/palette/balances.rs index 09ec0adf62..3d12cdaea0 100644 --- a/src/paint/balances.rs +++ b/src/palette/balances.rs @@ -1,4 +1,4 @@ -//! Implements support for the paint_balances module. +//! Implements support for the pallet_balances module. use crate::{ codec::{ compact, @@ -6,7 +6,7 @@ use crate::{ }, error::Error, metadata::MetadataError, - paint::{ + palette::{ system::System, ModuleCalls, }, @@ -30,7 +30,7 @@ use runtime_support::Parameter; use std::fmt::Debug; use substrate_primitives::Pair; -/// The subset of the `paint_balances::Trait` that a client must implement. +/// The subset of the `pallet_balances::Trait` that a client must implement. pub trait Balances: System { /// The balance of an account. type Balance: Parameter @@ -45,9 +45,9 @@ pub trait Balances: System { } /// Blanket impl for using existing runtime types -impl Balances for T +impl Balances for T where - ::Header: serde::de::DeserializeOwned, + ::Header: serde::de::DeserializeOwned, { type Balance = T::Balance; } @@ -110,7 +110,7 @@ pub trait BalancesXt { /// Signature type type Signature: Verify; - /// Create a call for the paint balances module + /// Create a call for the pallet balances module fn balances( &self, f: F, diff --git a/src/paint/contracts.rs b/src/palette/contracts.rs similarity index 91% rename from src/paint/contracts.rs rename to src/palette/contracts.rs index 4681539bd9..8076e58bf1 100644 --- a/src/paint/contracts.rs +++ b/src/palette/contracts.rs @@ -1,11 +1,11 @@ -//! Implements support for the paint_contracts module. +//! Implements support for the pallet_contracts module. use crate::{ codec::{ compact, Encoded, }, metadata::MetadataError, - paint::{ + palette::{ balances::Balances, system::System, ModuleCalls, @@ -23,18 +23,18 @@ use substrate_primitives::Pair; /// instructions can operate on them efficiently. pub type Gas = u64; -/// The subset of the `paint_contracts::Trait` that a client must implement. +/// The subset of the `pallet_contracts::Trait` that a client must implement. pub trait Contracts: System + Balances {} /// Blanket impl for using existing runtime types impl< - T: paint_contracts::Trait - + paint_system::Trait - + paint_balances::Trait + T: pallet_contracts::Trait + + palette_system::Trait + + pallet_balances::Trait + std::fmt::Debug, > Contracts for T where - ::Header: serde::de::DeserializeOwned, + ::Header: serde::de::DeserializeOwned, { } @@ -47,7 +47,7 @@ pub trait ContractsXt { /// Signature type type Signature: Verify; - /// Create a call for the paint contracts module + /// Create a call for the pallet contracts module fn contracts( &self, f: F, diff --git a/src/paint/mod.rs b/src/palette/mod.rs similarity index 100% rename from src/paint/mod.rs rename to src/palette/mod.rs diff --git a/src/paint/system.rs b/src/palette/system.rs similarity index 92% rename from src/paint/system.rs rename to src/palette/system.rs index 1f31da7320..49a52bc34b 100644 --- a/src/paint/system.rs +++ b/src/palette/system.rs @@ -1,9 +1,9 @@ -//! Implements support for the paint_system module. +//! Implements support for the palette_system module. use crate::{ codec::Encoded, error::Error, metadata::MetadataError, - paint::{ + palette::{ balances::Balances, ModuleCalls, }, @@ -36,7 +36,7 @@ use serde::de::DeserializeOwned; use std::fmt::Debug; use substrate_primitives::Pair; -/// The subset of the `paint::Trait` that a client must implement. +/// The subset of the `palette::Trait` that a client must implement. pub trait System: 'static + Eq + Clone + Debug { /// Account index (aka nonce) type. This stores the number of previous /// transactions associated with a sender account. @@ -87,7 +87,7 @@ pub trait System: 'static + Eq + Clone + Debug { + Ord + Default; - /// The address type. This instead of `::Source`. + /// The address type. This instead of `::Source`. type Address: Codec + Clone + PartialEq + Debug; /// The block header. @@ -97,9 +97,9 @@ pub trait System: 'static + Eq + Clone + Debug { } /// Blanket impl for using existing runtime types -impl System for T +impl System for T where - ::Header: serde::de::DeserializeOwned, + ::Header: serde::de::DeserializeOwned, { type Index = T::Index; type BlockNumber = T::BlockNumber; @@ -154,7 +154,7 @@ pub trait SystemXt { /// Signature type type Signature: Verify; - /// Create a call for the paint system module + /// Create a call for the pallet system module fn system( &self, f: F, diff --git a/src/rpc.rs b/src/rpc.rs index 205f5f6c92..227c885124 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -21,7 +21,7 @@ use crate::{ RuntimeEvent, }, metadata::Metadata, - paint::{ + palette::{ balances::Balances, system::System, }, @@ -161,9 +161,9 @@ use txpool::watcher::Status; use crate::{ events::RawEvent, - paint::system::SystemEvent, + palette::system::SystemEvent, }; -use paint_system::Phase; +use palette_system::Phase; type MapClosure = Box T + Send>; pub type MapStream = stream::Map, MapClosure>; diff --git a/src/runtimes.rs b/src/runtimes.rs index 448434269a..b0c92db4b0 100644 --- a/src/runtimes.rs +++ b/src/runtimes.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::paint::{ +use crate::palette::{ balances::Balances, contracts::Contracts, system::System, @@ -44,7 +44,7 @@ impl System for DefaultNodeRuntime { type Hash = substrate_primitives::H256; type Hashing = BlakeTwo256; type AccountId = <::Signer as IdentifyAccount>::AccountId; - type Address = paint_indices::address::Address; + type Address = pallet_indices::address::Address; type Header = Header; }