* Generate one #[test] fn per bench case.
* Update benchmark macro syntax in frame pallets.
* Explain new benchmark macro syntax in example pallet.
* support with and without a semicolon
* update pallets to use individual tests
* migrate staking too
* migrate more pallets
* fix up democracy and use individual tests
* Fix comment
* Put println message in panic
* Remove `another_set_dummy` from doc
`another_set_dummy` is not present in the benchmarking.rs (anymore).
* Update doc for benchmarks macro
* Update doc for impl_benchmark_test_suite macro
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Use 'Pallet' struct in construct_runtime.
* Fix genesis and metadata macro.
* Fix 'Pallet' type alias.
* Replace 'Module' with 'Pallet' for all construct_runtime use cases.
* Replace more deprecated 'Module' struct.
* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.
* Replace deprecated 'Module' struct from merge master.
* Minor fix.
* Fix UI tests.
* Revert UI override in derive_no_bound.
* Fix more deprecated 'Module' use from master branch.
* Fix more deprecated 'Module' use from master branch.
* Create a macro which automates creation of benchmark test suites.
* bump impl_version
* allow unused on test_bench_by_name
* use proper doctest ignore attribute
* Explicitly hand the Module to the test suite
Much better practice than depending on it showing up implicitly in
the namespace.
* explicitly import what we need into `mod tests`
* bench_module is `ident` not `tt`
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* allow end users to specify arguments for new_test_ext
This turned out to be surprisingly easy. On reflection, it turns out
that of course the compiler can't eagerly evaluate the function call,
but needs to paste it in everywhere desired.
* enable explicitly specifying the path to the benchmarks invocation
also enable optional trailing commas
* Revert "bump impl_version"
This reverts commit 0209e4de33fd43873f8cfc6875815d0fd6151e63.
* list failing benchmark tests and the errors which caused the failure
* harden benchmark tests against internal panics
* suppress warning about ignored profiles
unfortunately, setting the profile here doesn't do anything; we'd
need to set it in every leaf package anyway. However, as this was
just making the default explicit anyway, I think it's safe enough
to remove entirely.
* impl_benchmark_test_suite for assets
* impl_benchmark_test_suite for balances
* impl_benchmark_test_suite for bounties
* impl_benchmark_test_suite for Collective
* impl_benchmark_test_suite for Contracts
* impl_benchmark_test_suite for Democracy
* don't impl_benchmark_test_suite for Elections-Phragmen
* impl_benchmark_test_suite for Identity
Note that Identity tests currently fail. They failed in an identical
way before this change, so as far as I'm concerned, the status quo is
good enough for now.
* impl_benchmark_test_suite for ImOnline
* impl_benchmark_test_suite for indices
For this crate also, the test suite fails identically with and without
this change, so we can say that this change is not the cause of the
tests' failure to compile.
* impl_benchmark_test_suite for lottery
* impl_benchmark_test_suite for merkle-mountain-range
* impl_benchmark_test_suite for Multisig
These tests fail identically with and without the change, so the change
seems unlikely to be the origin of the failures.
* impl_benchmark_test_suite for offences
* impl_benchmark_test_suite for Proxy
Fails identically with and without this change.
* impl_benchmark_test_suite for scheduler
* impl_benchmark_test_suite for session
It turns out to be important to be able to exclude items marked
`#[extra]` sometimes. Who knew?
* impl_benchmark_test_suite for staking
* impl_benchmark_test_suite for system
* impl_benchmark_test_suite for timestamp
* impl_benchmark_test_suite for tips
* impl_benchmark_test_suite for treasury
* impl_benchmark_test_suite for utility
Note that benchmark tests fail identically before and after this change.
* impl_benchmark_test_suite for vesting
* fix wrong module name in impl_benchmark_test_suite in Offences
* address line length nits
* enable optional keyword argument: exec_name
Took a _lot_ of macro-wrangling to get the functionality that I want,
but now you have the option to pass in
```rust
impl_benchmark_test_suite!(
Elections,
crate::tests::ExtBuilder::default().desired_members(13).desired_runners_up(7),
crate::tests::Test,
exec_name = build_and_execute,
);
```
and have it expand out properly. A selected fragment of the expansion:
```rust
fn test_benchmarks() {
crate::tests::ExtBuilder::default()
.desired_members(13)
.desired_runners_up(7)
.build_and_execute(|| {
```
* get rid of dead code
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* commented use of common
* hack to pass tests
* another hack
* remove all commented code
* fix the easy tests
* temp hack
* follow through comma hack until better solution
* patch macro
* missed one
* update benchmarks
* update docs
* fix docs
* removed too much
* fix changes
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Rename `ModuleToIndex` to `PalletRuntimeSetup`
Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.
* Rename it to `PalletInfo`
* Remove accidentally added files
* Fixes and tests
* Don't set subs be re-registered.
Also allow subs to de-register themselves and collect the deposit.
Also allow individual registering and removal of subs.
* Make it build
* Update frame/identity/src/lib.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Tests
* Add benchmarks
* Add some reasonable weights
* Docs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Only check single extrinsics weight limit in validate_transaction.
* Add missing parameter to all pallets.
* Add tests, fix default configuration.
* Bump spec version.
* Use AvailableBlockRation to calculate MaxExtrinsicWeight
* Update system weights
* Use maximum block weight for scheduler
* Update offences to use full block
* Move weight inside if statement
* Add one read to offences `on_initialize`
* Delete factory test
* Revert "Delete factory test"
This reverts commit 8f95aacd63a028ef1b415185b45367b4140d86fd.
* Revert "Add one read to offences `on_initialize`"
This reverts commit 7df7ebc73625ed79b14086f13c247d4058ee87d6.
* Revert "Move weight inside if statement"
This reverts commit 87277d07913a7d1868eeee85ef4673f51ee4013b.
* Revert "Update offences to use full block"
This reverts commit 0bbe0ce18e9419b032157f7d37dea6481078cdc0.
* Use scheduler in Sudo
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Revert "Use scheduler in Sudo"
This reverts commit 95bd2768dfea100bdf682cf4fe6c0f46e8e1f66e.
* remove max extrinsic weight (it does nothing useful)
* fix tests
* introduce `sudo_unchecked_weight`
* bump spec version
* scheduler 80 percent of maximum
* Update `set_changes_trie_config` weight
* Update bin/node/runtime/src/lib.rs
* Update frame/democracy/src/tests.rs
* Update tests.rs
* update based on feedback
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>