Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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.
///
Expand Down
6 changes: 3 additions & 3 deletions src/palette/balances.rs → src/frame/balances.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Implements support for the pallet_balances module.
use crate::{
error::Error,
palette::{
frame::{
Call,
system::System,
},
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/palette/contracts.rs → src/frame/contracts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Implements support for the pallet_contracts module.
use crate::{
palette::{
frame::{
Call,
balances::Balances,
system::System,
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions src/palette/system.rs → src/frame/system.rs
Original file line number Diff line number Diff line change
@@ -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,
},
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use crate::{
DefaultExtra,
SignedExtra,
},
palette::{
frame::{
Call,
balances::Balances,
system::{
Expand All @@ -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::*;

Expand Down Expand Up @@ -388,7 +388,7 @@ where
mod tests {
use super::*;
use crate::{
palette::{
frame::{
balances::{
Balances,
BalancesStore,
Expand Down Expand Up @@ -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();
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
RuntimeEvent,
},
metadata::Metadata,
palette::{
frame::{
balances::Balances,
system::System,
},
Expand Down Expand Up @@ -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>>;
Expand Down
2 changes: 1 addition & 1 deletion src/runtimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down