Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
386b07d
First umbrella
ggwpez May 13, 2024
c918fe9
Fix FRAME macro stuff
ggwpez May 14, 2024
d7cd7db
Add docs
ggwpez May 14, 2024
9d4b6df
fmt
ggwpez May 14, 2024
aac3211
fmt toml
ggwpez May 14, 2024
7321721
Fix compile
ggwpez May 14, 2024
93de212
Fix test
ggwpez May 14, 2024
cbd764a
Fix umbrella
ggwpez May 14, 2024
9b3c45e
Add python generation script
ggwpez May 14, 2024
505ad60
Comment slow check
ggwpez May 14, 2024
a9f2739
Update
ggwpez May 15, 2024
d595ed0
Update script
ggwpez May 15, 2024
4dd2182
Merge remote-tracking branch 'origin/master' into oty-test-umbrella
ggwpez May 15, 2024
e588f9b
Update lockfile
ggwpez May 15, 2024
2bded84
Fix formatting
ggwpez May 15, 2024
d6e93ba
Add CI
ggwpez May 15, 2024
b9feb44
Add CI
ggwpez May 15, 2024
ca5d323
Fix CI
ggwpez May 15, 2024
65665e1
Fix CI
ggwpez May 15, 2024
8c15f6d
Fix CI
ggwpez May 15, 2024
b6eb564
Fix CI
ggwpez May 15, 2024
a694824
Fix CI
ggwpez May 15, 2024
65af809
Fix generator
ggwpez May 15, 2024
88ab975
Fix CI
ggwpez May 15, 2024
cb46f78
Fix docs
ggwpez May 15, 2024
a01dfa6
Cleanup
ggwpez May 15, 2024
890473a
Cleanup macros
ggwpez May 15, 2024
5152471
Cleanup
ggwpez May 15, 2024
dbdeaf0
Revert tt macro change
ggwpez May 15, 2024
4357d9a
Fix CI
ggwpez May 15, 2024
3ffe52c
Add prdoc
ggwpez May 15, 2024
2ddb4fb
Fix prdoc
ggwpez May 15, 2024
0877939
Remove unneeded features
ggwpez May 15, 2024
ec5b065
Merge remote-tracking branch 'origin/master' into oty-test-umbrella
ggwpez May 15, 2024
a147bc3
Post merge
ggwpez May 15, 2024
80660fb
Merge branch 'master' into oty-test-umbrella
ggwpez May 21, 2024
2f8cb66
Merge remote-tracking branch 'origin/master' into oty-test-umbrella
ggwpez May 23, 2024
0c3ebca
Add frame-metadata-extension to the umbrella
ggwpez May 23, 2024
b50c977
Lockfile
ggwpez May 23, 2024
70a41f4
Fix prdoc
ggwpez May 23, 2024
53add30
Fix doctest
ggwpez May 24, 2024
02628e1
Merge remote-tracking branch 'origin/master' into oty-test-umbrella
ggwpez May 24, 2024
176181c
Fix link
ggwpez May 24, 2024
d064ced
Toml format
ggwpez May 24, 2024
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
Prev Previous commit
Next Next commit
Cleanup macros
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed May 15, 2024
commit 890473a94e0e356258eefe36bf39eb687fa63cb1
34 changes: 16 additions & 18 deletions substrate/bin/node/runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,16 @@ impl ProposalProvider<AccountId, Hash, RuntimeCall> for AllianceProposalProvider

#[cfg(test)]
mod multiplier_tests {
use polkadot_sdk::{
frame_support::{
dispatch::DispatchClass,
weights::{Weight, WeightToFee},
},
pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment},
sp_runtime::{
assert_eq_error_rate,
traits::{Convert, One, Zero},
BuildStorage, FixedPointNumber,
},
use frame_support::{
dispatch::DispatchClass,
weights::{Weight, WeightToFee},
};
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
use polkadot_sdk::*;
use sp_runtime::{
assert_eq_error_rate,
traits::{Convert, One, Zero},
BuildStorage, FixedPointNumber,
};

use crate::{
Expand Down Expand Up @@ -202,11 +201,10 @@ mod multiplier_tests {
where
F: Fn() -> (),
{
let mut t: polkadot_sdk::sp_io::TestExternalities =
polkadot_sdk::frame_system::GenesisConfig::<Runtime>::default()
.build_storage()
.unwrap()
.into();
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::<Runtime>::default()
.build_storage()
.unwrap()
.into();
t.execute_with(|| {
System::set_block_consumed_resources(w, 0);
assertions()
Expand Down Expand Up @@ -313,7 +311,7 @@ mod multiplier_tests {
Weight::from_parts(100, 0);

// Default substrate weight.
let tx_weight = polkadot_sdk::frame_support::weights::constants::ExtrinsicBaseWeight::get();
let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get();

run_with_system_weight(block_weight, || {
// initial value configured on module
Expand All @@ -330,7 +328,7 @@ mod multiplier_tests {
fm = next;
iterations += 1;
let fee =
<Runtime as polkadot_sdk::pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
<Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
&tx_weight,
);
let adjusted_fee = fm.saturating_mul_acc_int(fee);
Expand Down
6 changes: 2 additions & 4 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2241,9 +2241,7 @@ impl pallet_parameters::Config for Runtime {
type WeightInfo = ();
}

use frame_support::runtime;

#[runtime]
#[frame_support::runtime]
mod runtime {
use super::*;

Expand Down Expand Up @@ -2598,7 +2596,7 @@ mod mmr {

#[cfg(feature = "runtime-benchmarks")]
mod benches {
super::frame_benchmarking::define_benchmarks!(
polkadot_sdk::frame_benchmarking::define_benchmarks!(
[frame_benchmarking, BaselineBench::<Runtime>]
[frame_benchmarking_pallet_pov, Pov]
[pallet_alliance, Alliance]
Expand Down
5 changes: 3 additions & 2 deletions substrate/client/chain-spec/derive/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub fn derive(
};

let name = &ast.ident;
let crate_name = match crate_name(CRATE_NAME) {
let crate_path = match crate_name(CRATE_NAME) {
Ok(FoundCrate::Itself) => CRATE_NAME.replace("-", "_"),
Ok(FoundCrate::Name(chain_spec_name)) => chain_spec_name,
Err(e) => match crate_name("polkadot-sdk") {
Expand All @@ -181,7 +181,8 @@ pub fn derive(
},
},
};
let crate_path = syn::parse_str::<Path>(&crate_name).unwrap();
let crate_path =
syn::parse_str::<Path>(&crate_path).expect("crate_name returns valid path; qed");
let field_names = fields.named.iter().flat_map(|x| x.ident.as_ref()).collect::<Vec<_>>();
let field_types = fields.named.iter().map(|x| &x.ty).collect::<Vec<_>>();

Expand Down
18 changes: 0 additions & 18 deletions substrate/frame/support/procedural/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,6 @@ mod keyword {
}

pub fn runtime(attr: TokenStream, tokens: TokenStream) -> TokenStream {
let modified = do_runtime(attr, tokens);

/*use expander::*;
let expanded = Expander::new("baz")
.add_comment("This is generated code!".to_owned())
.fmt(Edition::_2021)
.verbose(true)
// common way of gating this, by making it part of the default feature set
.dry(cfg!(feature="no-file-expansion"))
.write_to_out_dir(modified.clone().into()).unwrap_or_else(|e| {
eprintln!("Failed to write to file: {:?}", e);
modified.into()
});
expanded.into()*/
modified
}

pub fn do_runtime(attr: TokenStream, tokens: TokenStream) -> TokenStream {
let mut legacy_ordering = false;
if !attr.is_empty() {
if let Ok(_) = syn::parse::<keyword::legacy_ordering>(attr.clone()) {
Expand Down
1 change: 0 additions & 1 deletion substrate/frame/support/procedural/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ fn get_frame_crate_path(def_crate: &str) -> Option<syn::Path> {
}

fn get_sdk_crate_path(def_crate: &str) -> Option<syn::Path> {
// This does not work if the frame crate is renamed.
if let Ok(FoundCrate::Name(name)) = crate_name(&"polkadot-sdk") {
let path = format!("{}::{}", name, def_crate.to_string()).replace("-", "_");
Some(syn::parse_str::<syn::Path>(&path).expect("is a valid path; qed"))
Expand Down