mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 04:28:00 +00:00
New substrate crate renames (#50)
This commit is contained in:
+7
-7
@@ -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" }
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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,
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
+4
-4
@@ -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<u8>) -> Call<SetCode> {
|
||||
#[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),
|
||||
}
|
||||
|
||||
+7
-7
@@ -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;
|
||||
|
||||
|
||||
+11
-11
@@ -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<K, V> {
|
||||
|
||||
impl<K: Encode, V: Decode + Clone> StorageMap<K, V> {
|
||||
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<B: 'static, O: 'static>(dd: DecodeDifferent<B, O>) -> Result<O, Error
|
||||
}
|
||||
|
||||
fn convert_event(
|
||||
event: runtime_metadata::EventMetadata,
|
||||
event: frame_metadata::EventMetadata,
|
||||
) -> Result<ModuleEventMetadata, Error> {
|
||||
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<StorageMetadata, Error> {
|
||||
let default = convert(entry.default)?;
|
||||
Ok(StorageMetadata {
|
||||
|
||||
+5
-5
@@ -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,
|
||||
};
|
||||
|
||||
+2
-2
@@ -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 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 = <<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId;
|
||||
type Address = pallet_indices::address::Address<Self::AccountId, u32>;
|
||||
|
||||
Reference in New Issue
Block a user