Skip to content

Commit 878c562

Browse files
juangirinibkchr
andauthored
Restructure frame_support macro related exports (#14745)
* make reexports private * make reexports private 2 * make reexports private for runtime-benchmarking * make reexports private for try-runtime * fix for try-runtime * make reexports private for tests * fmt * make reexports private for tests * make reexports private for experimental * fix beefy * fix ui test * fix ui test * fix benches * ".git/.scripts/commands/fmt/fmt.sh" * fix contracts use * wip * wip * do not reexport sp_api::metadata_ir * fix CI checks * fix support tests * ".git/.scripts/commands/fmt/fmt.sh" * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> * import codec directly * fmt * fix node-cli tests --------- Co-authored-by: command-bot <> Co-authored-by: Bastian Köcher <[email protected]>
1 parent 574592d commit 878c562

File tree

125 files changed

+449
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+449
-398
lines changed

substrate/Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

substrate/bin/node/runtime/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use frame_support::{
4747
},
4848
ConstantMultiplier, IdentityFee, Weight,
4949
},
50-
BoundedVec, PalletId, RuntimeDebug,
50+
BoundedVec, PalletId,
5151
};
5252
use frame_system::{
5353
limits::{BlockLength, BlockWeights},
@@ -78,6 +78,7 @@ use sp_runtime::{
7878
},
7979
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
8080
ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Percent, Permill, Perquintill,
81+
RuntimeDebug,
8182
};
8283
use sp_std::prelude::*;
8384
#[cfg(any(feature = "std", test))]

substrate/frame/alliance/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ pub mod migration;
9494
mod types;
9595
pub mod weights;
9696

97+
use codec::{Decode, Encode, MaxEncodedLen};
9798
use frame_support::pallet_prelude::*;
9899
use frame_system::pallet_prelude::*;
99100
use sp_runtime::{
@@ -103,20 +104,19 @@ use sp_runtime::{
103104
use sp_std::{convert::TryInto, prelude::*};
104105

105106
use frame_support::{
106-
codec::{Decode, Encode, MaxEncodedLen},
107107
dispatch::{
108108
DispatchError, DispatchResult, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo,
109109
PostDispatchInfo,
110110
},
111111
ensure,
112-
scale_info::TypeInfo,
113112
traits::{
114113
ChangeMembers, Currency, Get, InitializeMembers, IsSubType, OnUnbalanced,
115114
ReservableCurrency,
116115
},
117116
weights::Weight,
118117
};
119118
use pallet_identity::IdentityField;
119+
use scale_info::TypeInfo;
120120

121121
pub use pallet::*;
122122
pub use types::*;

substrate/frame/asset-rate/src/benchmarking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use frame_benchmarking::v2::*;
2525
use frame_support::assert_ok;
2626
use frame_system::RawOrigin;
2727
use sp_core::crypto::FromEntropy;
28+
use sp_std::vec;
2829

2930
/// Trait describing the factory function for the `AssetKind` parameter.
3031
pub trait AssetKindFactory<AssetKind> {

substrate/frame/assets/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1414

1515
[dependencies]
1616
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
17+
log = { version = "0.4.17", default-features = false }
1718
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
1819
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }
1920
# Needed for various traits. In our case, `OnFinalize`.
@@ -34,6 +35,7 @@ pallet-balances = { version = "4.0.0-dev", path = "../balances" }
3435
default = ["std"]
3536
std = [
3637
"codec/std",
38+
"log/std",
3739
"scale-info/std",
3840
"sp-core/std",
3941
"sp-std/std",

substrate/frame/assets/src/migration.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
// limitations under the License.
1717

1818
use super::*;
19-
use frame_support::{log, traits::OnRuntimeUpgrade};
19+
use frame_support::traits::OnRuntimeUpgrade;
20+
use log;
2021

2122
#[cfg(feature = "try-runtime")]
2223
use sp_runtime::TryRuntimeError;

substrate/frame/aura/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1414

1515
[dependencies]
1616
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive", "max-encoded-len"] }
17+
log = { version = "0.4.17", default-features = false }
1718
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
1819
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
1920
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
@@ -31,6 +32,7 @@ sp-io = { version = "23.0.0", path = "../../primitives/io" }
3132
default = ["std"]
3233
std = [
3334
"codec/std",
35+
"log/std",
3436
"frame-support/std",
3537
"frame-system/std",
3638
"pallet-timestamp/std",

substrate/frame/aura/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040

4141
use codec::{Decode, Encode, MaxEncodedLen};
4242
use frame_support::{
43-
log,
4443
traits::{DisabledValidators, FindAuthor, Get, OnTimestampSet, OneSessionHandler},
4544
BoundedSlice, BoundedVec, ConsensusEngineId, Parameter,
4645
};
46+
use log;
4747
use sp_consensus_aura::{AuthorityIndex, ConsensusLog, Slot, AURA_ENGINE_ID};
4848
use sp_runtime::{
4949
generic::DigestItem,

substrate/frame/balances/src/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use frame_support::{
3030
StorageMapShim, StoredMap, WhitelistedStorageKeys,
3131
},
3232
weights::{IdentityFee, Weight},
33-
RuntimeDebug,
3433
};
3534
use frame_system::{self as system, RawOrigin};
3635
use pallet_transaction_payment::{ChargeTransactionPayment, CurrencyAdapter, Multiplier};
@@ -39,7 +38,8 @@ use sp_core::{hexdisplay::HexDisplay, H256};
3938
use sp_io;
4039
use sp_runtime::{
4140
traits::{BadOrigin, IdentityLookup, SignedExtension, Zero},
42-
ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, TokenError,
41+
ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug,
42+
TokenError,
4343
};
4444
use std::collections::BTreeSet;
4545

substrate/frame/balances/src/types.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@
2020
use crate::{Config, CreditOf, Event, Pallet};
2121
use codec::{Decode, Encode, MaxEncodedLen};
2222
use core::ops::BitOr;
23-
use frame_support::{
24-
traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons},
25-
RuntimeDebug,
26-
};
23+
use frame_support::traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons};
2724
use scale_info::TypeInfo;
28-
use sp_runtime::Saturating;
25+
use sp_runtime::{RuntimeDebug, Saturating};
2926

3027
/// Simplified reasons for withdrawing balance.
3128
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo)]

0 commit comments

Comments
 (0)