Rename palette -> frame (#41)

This commit is contained in:
Andrew Jones
2019-11-22 18:35:36 +00:00
committed by GitHub
parent 0b39bbbc30
commit 55e067a294
10 changed files with 27 additions and 27 deletions
+3 -3
View File
@@ -19,12 +19,12 @@ 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 = "palette-metadata" }
runtime_support = { git = "https://github.com/paritytech/substrate/", package = "palette-support" }
runtime_metadata = { git = "https://github.com/paritytech/substrate/", package = "frame-metadata" }
runtime_support = { git = "https://github.com/paritytech/substrate/", package = "frame-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" }
palette-system = { git = "https://github.com/paritytech/substrate/", package = "palette-system" }
frame-system = { git = "https://github.com/paritytech/substrate/", package = "frame-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" }
+2 -2
View File
@@ -20,12 +20,12 @@ use crate::{
Metadata,
MetadataError,
},
palette::balances::Balances,
frame::balances::Balances,
System,
SystemEvent,
};
use log;
use palette_system::Phase;
use frame_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::palette::{
use crate::frame::{
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 `palette_system::Trait`
/// substrate's `frame_system::Trait`
/// Ensure the runtime version registered in the transaction is the same as at present.
///
@@ -1,7 +1,7 @@
//! Implements support for the pallet_balances module.
use crate::{
error::Error,
palette::{
frame::{
Call,
system::System,
},
@@ -35,9 +35,9 @@ pub trait Balances: System {
}
/// Blanket impl for using existing runtime types
impl<T: palette_system::Trait + pallet_balances::Trait + Debug> Balances for T
impl<T: frame_system::Trait + pallet_balances::Trait + Debug> Balances for T
where
<T as palette_system::Trait>::Header: serde::de::DeserializeOwned,
<T as frame_system::Trait>::Header: serde::de::DeserializeOwned,
{
type Balance = T::Balance;
}
@@ -1,6 +1,6 @@
//! Implements support for the pallet_contracts module.
use crate::{
palette::{
frame::{
Call,
balances::Balances,
system::System,
@@ -1,7 +1,7 @@
//! Implements support for the palette_system module.
//! Implements support for the frame_system module.
use crate::{
error::Error,
palette::{
frame::{
Call,
balances::Balances,
},
@@ -29,7 +29,7 @@ use runtime_support::Parameter;
use serde::de::DeserializeOwned;
use std::fmt::Debug;
/// The subset of the `palette::Trait` that a client must implement.
/// The subset of the `frame::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.
@@ -80,7 +80,7 @@ pub trait System: 'static + Eq + Clone + Debug {
+ Ord
+ Default;
/// The address type. This instead of `<palette_system::Trait::Lookup as StaticLookup>::Source`.
/// The address type. This instead of `<frame_system::Trait::Lookup as StaticLookup>::Source`.
type Address: Codec + Clone + PartialEq + Debug;
/// The block header.
@@ -90,9 +90,9 @@ pub trait System: 'static + Eq + Clone + Debug {
}
/// Blanket impl for using existing runtime types
impl<T: palette_system::Trait + Debug> System for T
impl<T: frame_system::Trait + Debug> System for T
where
<T as palette_system::Trait>::Header: serde::de::DeserializeOwned,
<T as frame_system::Trait>::Header: serde::de::DeserializeOwned,
{
type Index = T::Index;
type BlockNumber = T::BlockNumber;
+6 -6
View File
@@ -62,7 +62,7 @@ use crate::{
DefaultExtra,
SignedExtra,
},
palette::{
frame::{
Call,
balances::Balances,
system::{
@@ -84,13 +84,13 @@ mod error;
mod events;
mod extrinsic;
mod metadata;
mod palette;
mod frame;
mod rpc;
mod runtimes;
pub use error::Error;
pub use events::RawEvent;
pub use palette::*;
pub use frame::*;
pub use rpc::ExtrinsicSuccess;
pub use runtimes::*;
@@ -388,7 +388,7 @@ where
mod tests {
use super::*;
use crate::{
palette::{
frame::{
balances::{
Balances,
BalancesStore,
@@ -530,7 +530,7 @@ mod tests {
let transfer = pallet_balances::Call::transfer(address.clone(), amount);
let call = node_runtime::Call::Balances(transfer);
let subxt_transfer = crate::palette::balances::transfer::<Runtime>(address, amount);
let subxt_transfer = crate::frame::balances::transfer::<Runtime>(address, amount);
let call2 = balances
.call("transfer", subxt_transfer.args)
.unwrap();
@@ -548,7 +548,7 @@ mod tests {
assert_eq!(free_balance_key, free_balance_key2);
let account_nonce =
<palette_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
<frame_system::AccountNonce<node_runtime::Runtime>>::hashed_key_for(&dest);
let account_nonce_key = StorageKey(account_nonce);
let account_nonce_key2 = client
.metadata()
+3 -3
View File
@@ -21,7 +21,7 @@ use crate::{
RuntimeEvent,
},
metadata::Metadata,
palette::{
frame::{
balances::Balances,
system::System,
},
@@ -161,9 +161,9 @@ use txpool::watcher::Status;
use crate::{
events::RawEvent,
palette::system::SystemEvent,
frame::system::SystemEvent,
};
use palette_system::Phase;
use frame_system::Phase;
type MapClosure<T> = Box<dyn Fn(T) -> T + Send>;
pub type MapStream<T> = stream::Map<TypedSubscriptionStream<T>, MapClosure<T>>;
+1 -1
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::palette::{
use crate::frame::{
balances::Balances,
contracts::Contracts,
system::System,