diff --git a/Cargo.toml b/Cargo.toml index 8856789b40..0b1bdec173 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,17 +20,17 @@ serde = { version = "1.0", features = ["derive"] } url = "1.7" parity-scale-codec = { version = "1.1", default-features = false, features = ["derive", "full"] } -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" } -sr-version = { git = "https://github.com/paritytech/substrate/", package = "sr-version" } +frame-metadata = { git = "https://github.com/paritytech/substrate/", package = "frame-metadata" } +frame-support = { git = "https://github.com/paritytech/substrate/", package = "frame-support" } +sp-runtime = { git = "https://github.com/paritytech/substrate/", package = "sp-runtime" } +sp-version = { git = "https://github.com/paritytech/substrate/", package = "sp-version" } 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" } substrate-rpc-api = { git = "https://github.com/paritytech/substrate/", package = "sc-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" } +sp-rpc = { git = "https://github.com/paritytech/substrate/", package = "sp-rpc" } +sp-core = { git = "https://github.com/paritytech/substrate/", package = "sp-core" } txpool-api = { git = "https://github.com/paritytech/substrate/", package = "sp-transaction-pool-api" } [dev-dependencies] @@ -38,4 +38,4 @@ env_logger = "0.7" tokio = "0.1" wabt = "0.9" node-runtime = { git = "https://github.com/paritytech/substrate/", package = "node-runtime" } -substrate-keyring = { git = "https://github.com/paritytech/substrate/", package = "substrate-keyring" } +sp-keyring = { git = "https://github.com/paritytech/substrate/", package = "sp-keyring" } diff --git a/src/error.rs b/src/error.rs index 52d995f85a..731cc8a58f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -15,8 +15,8 @@ // along with substrate-subxt. If not, see . use jsonrpc_core_client::RpcError; -use runtime_primitives::transaction_validity::TransactionValidityError; -use substrate_primitives::crypto::SecretStringError; +use sp_runtime::transaction_validity::TransactionValidityError; +use sp_core::crypto::SecretStringError; use crate::{ events::EventsError, diff --git a/src/extrinsic.rs b/src/extrinsic.rs index c4cae79a13..adf864b809 100644 --- a/src/extrinsic.rs +++ b/src/extrinsic.rs @@ -22,7 +22,7 @@ use parity_scale_codec::{ Encode, }; -use runtime_primitives::{ +use sp_runtime::{ generic::{ Era, SignedPayload, @@ -35,7 +35,7 @@ use runtime_primitives::{ }, transaction_validity::TransactionValidityError, }; -use substrate_primitives::Pair; +use sp_core::Pair; use crate::frame::{ balances::Balances, diff --git a/src/frame/balances.rs b/src/frame/balances.rs index defc3fe8f1..f79fe5feef 100644 --- a/src/frame/balances.rs +++ b/src/frame/balances.rs @@ -27,12 +27,12 @@ use parity_scale_codec::{ Encode, }; -use runtime_primitives::traits::{ +use sp_runtime::traits::{ MaybeSerialize, Member, SimpleArithmetic, }; -use runtime_support::Parameter; +use frame_support::Parameter; use crate::{ error::Error, diff --git a/src/frame/system.rs b/src/frame/system.rs index fc9f89c4c1..da0c7541ee 100644 --- a/src/frame/system.rs +++ b/src/frame/system.rs @@ -25,7 +25,7 @@ use futures::future::{ use parity_scale_codec::Codec; use serde::de::DeserializeOwned; -use runtime_primitives::traits::{ +use sp_runtime::traits::{ Bounded, CheckEqual, Hash, @@ -38,7 +38,7 @@ use runtime_primitives::traits::{ SimpleBitOps, StaticLookup, }; -use runtime_support::Parameter; +use frame_support::Parameter; use crate::{ error::Error, @@ -173,7 +173,7 @@ pub fn set_code(code: Vec) -> Call { #[derive(Clone, Debug, parity_scale_codec::Decode)] pub enum SystemEvent { /// An extrinsic completed successfully. - ExtrinsicSuccess(runtime_support::weights::DispatchInfo), + ExtrinsicSuccess(frame_support::weights::DispatchInfo), /// An extrinsic failed. - ExtrinsicFailed(runtime_primitives::DispatchError), + ExtrinsicFailed(sp_runtime::DispatchError), } diff --git a/src/lib.rs b/src/lib.rs index 7a8d58c6c8..47a8ce3987 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ use parity_scale_codec::{ Decode, Encode, }; -use runtime_primitives::{ +use sp_runtime::{ generic::UncheckedExtrinsic, traits::{ IdentifyAccount, @@ -46,8 +46,8 @@ use runtime_primitives::{ }, MultiSignature, }; -use sr_version::RuntimeVersion; -use substrate_primitives::{ +use sp_version::RuntimeVersion; +use sp_core::{ storage::{ StorageChangeSet, StorageKey, @@ -394,9 +394,9 @@ where mod tests { use futures::stream::Stream; use parity_scale_codec::Encode; - use runtime_support::StorageMap; - use substrate_keyring::AccountKeyring; - use substrate_primitives::storage::StorageKey; + use frame_support::StorageMap; + use sp_keyring::AccountKeyring; + use sp_core::storage::StorageKey; use super::*; use crate::{ @@ -528,7 +528,7 @@ mod tests { let (_, client) = test_setup(); let balances = client.metadata().module_with_calls("Balances").unwrap(); - let dest = substrate_keyring::AccountKeyring::Bob.to_account_id(); + let dest = sp_keyring::AccountKeyring::Bob.to_account_id(); let address: Address = dest.clone().into(); let amount: Balance = 10_000; diff --git a/src/metadata.rs b/src/metadata.rs index 52a2c981fb..88046a9f0b 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -26,7 +26,7 @@ use parity_scale_codec::{ Encode, }; -use runtime_metadata::{ +use frame_metadata::{ DecodeDifferent, RuntimeMetadata, RuntimeMetadataPrefixed, @@ -35,7 +35,7 @@ use runtime_metadata::{ StorageHasher, META_RESERVED, }; -use substrate_primitives::storage::StorageKey; +use sp_core::storage::StorageKey; use crate::codec::Encoded; @@ -232,19 +232,19 @@ pub struct StorageMap { impl StorageMap { pub fn key(&self, key: K) -> StorageKey { - let mut bytes = substrate_primitives::twox_128(&self.module_prefix).to_vec(); - bytes.extend(&substrate_primitives::twox_128(&self.storage_prefix)[..]); + let mut bytes = sp_core::twox_128(&self.module_prefix).to_vec(); + bytes.extend(&sp_core::twox_128(&self.storage_prefix)[..]); let encoded_key = key.encode(); let hash = match self.hasher { StorageHasher::Blake2_128 => { - substrate_primitives::blake2_128(&encoded_key).to_vec() + sp_core::blake2_128(&encoded_key).to_vec() } StorageHasher::Blake2_256 => { - substrate_primitives::blake2_256(&encoded_key).to_vec() + sp_core::blake2_256(&encoded_key).to_vec() } - StorageHasher::Twox128 => substrate_primitives::twox_128(&encoded_key).to_vec(), - StorageHasher::Twox256 => substrate_primitives::twox_256(&encoded_key).to_vec(), - StorageHasher::Twox64Concat => substrate_primitives::twox_64(&encoded_key).to_vec(), + StorageHasher::Twox128 => sp_core::twox_128(&encoded_key).to_vec(), + StorageHasher::Twox256 => sp_core::twox_256(&encoded_key).to_vec(), + StorageHasher::Twox64Concat => sp_core::twox_64(&encoded_key).to_vec(), }; bytes.extend(hash); StorageKey(bytes) @@ -417,7 +417,7 @@ fn convert(dd: DecodeDifferent) -> Result Result { let name = convert(event.name)?; let mut arguments = Vec::new(); @@ -431,7 +431,7 @@ fn convert_event( fn convert_entry( module_prefix: String, storage_prefix: String, - entry: runtime_metadata::StorageEntryMetadata, + entry: frame_metadata::StorageEntryMetadata, ) -> Result { let default = convert(entry.default)?; Ok(StorageMetadata { diff --git a/src/rpc.rs b/src/rpc.rs index 89ca279476..5f8869a7df 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -39,8 +39,8 @@ use parity_scale_codec::{ }; use frame_system::Phase; -use runtime_metadata::RuntimeMetadataPrefixed; -use runtime_primitives::{ +use frame_metadata::RuntimeMetadataPrefixed; +use sp_runtime::{ generic::{ Block, SignedBlock, @@ -48,8 +48,8 @@ use runtime_primitives::{ traits::Hash, OpaqueExtrinsic, }; -use sr_version::RuntimeVersion; -use substrate_primitives::{ +use sp_version::RuntimeVersion; +use sp_core::{ storage::{ StorageChangeSet, StorageKey, @@ -61,7 +61,7 @@ use substrate_rpc_api::{ chain::ChainClient, state::StateClient, }; -use substrate_rpc_primitives::{ +use sp_rpc::{ list::ListOrValue, number::NumberOrHex, }; diff --git a/src/runtimes.rs b/src/runtimes.rs index ebaf0b8bad..aded4394e0 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 runtime_primitives::{ +use sp_runtime::{ generic::Header, traits::{ BlakeTwo256, @@ -42,7 +42,7 @@ pub struct DefaultNodeRuntime; impl System for DefaultNodeRuntime { type Index = u32; type BlockNumber = u32; - type Hash = substrate_primitives::H256; + type Hash = sp_core::H256; type Hashing = BlakeTwo256; type AccountId = <::Signer as IdentifyAccount>::AccountId; type Address = pallet_indices::address::Address;