Rename paint -> palette with pallets (#38)

This commit is contained in:
Andrew Jones
2019-11-21 10:08:54 +00:00
committed by GitHub
parent 5ec410baeb
commit 5242939f4d
10 changed files with 43 additions and 43 deletions
+6 -6
View File
@@ -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" }
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.
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.
///
+7 -7
View File
@@ -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 =
<paint_balances::FreeBalance<node_runtime::Runtime>>::hashed_key_for(&dest);
<pallet_balances::FreeBalance<node_runtime::Runtime>>::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 =
<paint_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
<palette_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
let account_nonce_key = StorageKey(account_nonce);
let account_nonce_key2 = client
.metadata()
@@ -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<T: paint_system::Trait + paint_balances::Trait + Debug> Balances for T
impl<T: palette_system::Trait + pallet_balances::Trait + Debug> Balances for T
where
<T as paint_system::Trait>::Header: serde::de::DeserializeOwned,
<T as palette_system::Trait>::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<F>(
&self,
f: F,
@@ -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
<T as paint_system::Trait>::Header: serde::de::DeserializeOwned,
<T as palette_system::Trait>::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<F>(
&self,
f: F,
@@ -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 `<paint_system::Trait::Lookup as StaticLookup>::Source`.
/// The address type. This instead of `<palette_system::Trait::Lookup as StaticLookup>::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<T: paint_system::Trait + Debug> System for T
impl<T: palette_system::Trait + Debug> System for T
where
<T as paint_system::Trait>::Header: serde::de::DeserializeOwned,
<T as palette_system::Trait>::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<F>(
&self,
f: F,
+3 -3
View File
@@ -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<T> = Box<dyn Fn(T) -> T + Send>;
pub type MapStream<T> = stream::Map<TypedSubscriptionStream<T>, MapClosure<T>>;
+2 -2
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.
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 = <<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId;
type Address = paint_indices::address::Address<Self::AccountId, u32>;
type Address = pallet_indices::address::Address<Self::AccountId, u32>;
type Header = Header<Self::BlockNumber, BlakeTwo256>;
}