mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Make sr-api-macros and srml-support renaming of crates (#1757)
Procedural do not support `$crate` to get access to the crate where the macro is defined. We use a hack to re-export the crate under a known name. With rust edition 2018, people started to rename their crates in `Cargo.toml`, but that breaks the re-export. This commit introduces `proc-maco-crate` that supports finding the requested crate name, even if it was renamed.
This commit is contained in:
@@ -10,11 +10,11 @@ safe-mix = { version = "1.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0" }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
substrate-client = { path = "../../core/client", default-features = false }
|
||||
client = { package = "substrate-client", path = "../../core/client", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
version = { package = "sr-version", path = "../../core/sr-version", default-features = false }
|
||||
srml-support = { path = "../../srml/support", default-features = false }
|
||||
support = { package = "srml-support", path = "../../srml/support", default-features = false }
|
||||
aura = { package = "srml-aura", path = "../../srml/aura", default-features = false }
|
||||
balances = { package = "srml-balances", path = "../../srml/balances", default-features = false }
|
||||
consensus = { package = "srml-consensus", path = "../../srml/consensus", default-features = false }
|
||||
@@ -45,7 +45,7 @@ std = [
|
||||
"substrate-primitives/std",
|
||||
"rstd/std",
|
||||
"runtime_primitives/std",
|
||||
"srml-support/std",
|
||||
"support/std",
|
||||
"balances/std",
|
||||
"consensus/std",
|
||||
"contract/std",
|
||||
@@ -65,7 +65,7 @@ std = [
|
||||
"node-primitives/std",
|
||||
"serde/std",
|
||||
"safe-mix/std",
|
||||
"substrate-client/std",
|
||||
"client/std",
|
||||
"consensus_aura/std",
|
||||
"rustc-hex",
|
||||
"hex-literal",
|
||||
|
||||
@@ -26,17 +26,16 @@ extern crate runtime_primitives;
|
||||
use rstd::prelude::*;
|
||||
use parity_codec_derive::{Encode, Decode};
|
||||
#[cfg(feature = "std")]
|
||||
use srml_support::{Serialize, Deserialize};
|
||||
use srml_support::construct_runtime;
|
||||
use support::{Serialize, Deserialize};
|
||||
use support::construct_runtime;
|
||||
use substrate_primitives::u32_trait::{_2, _4};
|
||||
use node_primitives::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature
|
||||
};
|
||||
use grandpa::fg_primitives::{self, ScheduledChange};
|
||||
use substrate_client::impl_runtime_apis;
|
||||
use substrate_client::{
|
||||
use client::{
|
||||
block_builder::api::{self as block_builder_api, InherentData, CheckInherentsResult},
|
||||
runtime_api as client_api,
|
||||
runtime_api as client_api, impl_runtime_apis
|
||||
};
|
||||
use runtime_primitives::ApplyResult;
|
||||
use runtime_primitives::transaction_validity::TransactionValidity;
|
||||
@@ -58,7 +57,7 @@ pub use consensus::Call as ConsensusCall;
|
||||
pub use timestamp::Call as TimestampCall;
|
||||
pub use balances::Call as BalancesCall;
|
||||
pub use runtime_primitives::{Permill, Perbill};
|
||||
pub use srml_support::StorageValue;
|
||||
pub use support::StorageValue;
|
||||
|
||||
/// Runtime version.
|
||||
pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
|
||||
Generated
+20
@@ -758,6 +758,14 @@ dependencies = [
|
||||
"uint 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-hack"
|
||||
version = "0.4.1"
|
||||
@@ -1069,6 +1077,7 @@ name = "sr-api-macros"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1386,6 +1395,7 @@ dependencies = [
|
||||
name = "srml-support-procedural-tools"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"srml-support-procedural-tools-derive 0.1.0",
|
||||
@@ -1860,6 +1870,14 @@ dependencies = [
|
||||
"tokio-reactor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.4.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trie-db"
|
||||
version = "0.11.0"
|
||||
@@ -2110,6 +2128,7 @@ dependencies = [
|
||||
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
|
||||
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
|
||||
"checksum primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edb92f1ebfc177432c03287b15d48c202e6e2c95993a7af3ba039abb43b1492e"
|
||||
"checksum proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c6cf4e5b00300d151dfffae39f529dfa5188f42eeb14201229aa420d6aad10c"
|
||||
"checksum proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8"
|
||||
"checksum proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3e90aa19cd73dedc2d0e1e8407473f073d735fef0ab521438de6da8ee449ab66"
|
||||
"checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a"
|
||||
@@ -2167,6 +2186,7 @@ dependencies = [
|
||||
"checksum tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f37f0111d76cc5da132fe9bc0590b9b9cfd079bc7e75ac3846278430a299ff8"
|
||||
"checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92"
|
||||
"checksum tokio-uds 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "99ce87382f6c1a24b513a72c048b2c8efe66cb5161c9061d00bee510f08dc168"
|
||||
"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
|
||||
"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788"
|
||||
"checksum trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c6fef2705af3258ec46a7e22286090394a44216201a1cf7d04b78db825e543"
|
||||
"checksum twox-hash 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "555cd4909480122bbbf21e34faac4cb08a171f324775670447ed116726c474af"
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user