* first draft, probably won't work
* first draft, probably won't work
* good progress..
* good milestone, still a lot to do.
* EVERYTHING WORKS
* Update frame/support/procedural/src/derive_impl.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/support/procedural/src/derive_impl.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* clean up + cargo fmt
* import tokens WIP
* export_tokens working with impl Trait
* WIP / notes
* use macro_magic 0.2.0's export_tokens to access foreign items
* token importing working properly using macro_magic 0.2.5
* combine_impls almost working
* successfully get foreign path via macro_magic 0.2.6
* combine_impls using implementing_type generics
* working + clean up
* more clean up
* decrease rightwards drift and add docs to combine_impls
* add support for macros to impl_item_ident in case we hit that
* add docs for impl_item_ident method
* fix no_std issues
* re-export of macro_magic working in pallets 🎉
* clean up + fully resolve no_std issue with macro_magic with v0.2.11
* remove trait item code for different trait item types since this
is now handled directly by combine_impls
* clean up
* remove dev comments
* only generate default trait if #[pallet::default_trait] is attached
* authorship and most other pallets now compiling
* compiling 🎉
* add check for more than two pallet attributes on Config trait
* remove unused import in nomination-pool
* clean up debug code
* upgrade to macro_magic v0.2.12
* add neater #[register_default_config(SomeIdent)] macro
* really just a thin wrapper around #[export_tokens]
* upgrade to macro_magic 0.3.1
* rewrite parsing to be compatible with syn 2.x, compiling 🎉
* remove unused keywords
* macro stubs for the new pallet:: macros, preliminary docs
* upgrade to macro_magic v0.3.2
* rename register_default_config => register_default_impl
* bump to macro_magic v0.3.3
* custom disambiguation_path working as 2nd arg to derive_impl
* overhaul docs
* fixes, ident-style paths shortcut working
* remove ident-style shortcut because it makes testing difficult
* add passing UI tests for derive_impl
* switch to `ForeignPath as DisambiguationPath` syntax + update docs
* add UI test for bad foreign path
* add UI test for bad disambiguation path
* add UI test for missing disambiguation path
* add UI test for attached to non impl
* fix derive_impl_attr_args_parsing test
* move tests to bottom
* fix nightly issue
* add doc notes on importing/re-exporting
* remove explicit use of macro_magic::use_attr
Co-authored-by: Bastian Köcher <git@kchr.de>
* use explicit macro_magic::use_attr
Co-authored-by: Bastian Köcher <git@kchr.de>
* remove unneeded {}
Co-authored-by: Bastian Köcher <git@kchr.de>
* remove unneeded collect
Co-authored-by: Bastian Köcher <git@kchr.de>
* add docs for TestDefaultConfig
* remove unneeded `#[export_tokens]` on `DefaultConfig`
* add docs for auto-generated `DefaultConfig`
* no need to clone
Co-authored-by: Bastian Köcher <git@kchr.de>
* clean up combine_impls + compiling again
* remove unused dependency
* simplify struct definition
Co-authored-by: Bastian Köcher <git@kchr.de>
* fix register_default_impl docs
* reduce rightward drift / refactor
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* fix derive_impl after keith's changes
* simplify disambiguation_path calculation
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* compiling again
* simplify parsing of trait item
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* rename preludes => prelude
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* fix other places where we used preludes instead of prelude
* fix indents
* simplify PalletAttr parsing
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* go back to having no_default and constant as keywords
* make it more clear that disambiguation_path is optional
* make default_trait_items just a Vec instead of Option<Vec>
* rename foreign_path => default_impl_path within substrate
* fix docs
* Change {} to ;
Co-authored-by: Bastian Köcher <git@kchr.de>
* highlight full end-to-end example with link
* add pallet-default-config-example, start by copying dev mode code
* update dev-mode specific docs
* use Person and Points instead of Dummy and Bar
* add docs to example pallet
* revert changes to pallets other than the default config example
* fix outdated references to basic example pallet
* re-order docs to be a bit more clear
* better errors for extra attributes
* add UI tests for duplicate/extra attributes on trait items
* change `#[pallet::default_config]` to option on `#[pallet::config()]`
* update UI tests
* add UI test covering missing `#[pallet::config(with_default)]` when
`#[pallet::no_default]` is used
* add note about new optional conventions
* improve docs about `DefaultConfig` and link to these from a few places
* fix doc comment
* fix old comment referencing `pallet::default_config`
* use u32 instead of u64 for block number
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* use () instead of u32 for `AccountData`
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* use ConstU32<10> for BlockHashCount instead of ConstU64<10>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* people are not dummies
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
* fix wording
Co-authored-by: Just van Stam <vstam1@users.noreply.github.com>
* Person => People and compiling again
* add docs for `prelude` module in frame_system
* update Cargo.lock
* cleaner example
* tweaks
* update docs more
* update docs more
* update docs more
* update docs more
* fix ui tests
* err
* Update frame/support/test/tests/pallet_ui.rs
* update ui tests
---------
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Just van Stam <vstam1@users.noreply.github.com>
* frame: GenesisBuild::build allowed in no_std
i`GenesisBuild::build` function will be required for no_std in no native
runtime world.
`GenesisBuild::build` macro generated function allows to build the runtime
GenesisConfig assembled from all pallets' GenesisConfigs.
* fixes
* GenesisBuild::build avaiable in no-std
- #[cfg(feature = "std")] is not longer added to GenesisBuild implementation.
* system: hash69 available for no-std
* elections-phragmen: panic message fixed for no_std
* frame::suport: doc updated
* test-runtime: default for GenesisConfig
* frame::test-pallet: serde/std added to std feature deps
* Cargo.toml: deps sorted
* Cargo.lock update
cargo update -p frame-support-test-pallet -p frame-support-test
* frame ui tests: cleanup
---------
Co-authored-by: parity-processbot <>
* Improve handling of unset `StorageVersion`
When a user is forgetting to set the storage version in a pallet and calls
`current_storage_version` to compare it against the `on_chain_storage_version` it will now fail to
compile the code. Before the pallet macro just returned `StorageVersion::default()` for
`current_storage_version` leading to potential issues with migrations. Besides that it also checks
in `post_upgrade` that the pallet storage version was upgraded and thus, no migration was missed.
* Use correct `Cargo.lock`
* Fixes
* Fix test
* Update frame/support/test/tests/pallet.rs
* Ensure we don't set a storage version when the pallet is missing the attribute
* Fix merge conflict
* Update frame/support/procedural/src/pallet/expand/hooks.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/support/procedural/src/pallet/expand/hooks.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Fix compilation
* Do not run everything with `try-runtime`
* Fix test
* Apply suggestions from code review
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix `no-metadata-docs`
---------
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
* impl_runtime_apis: Generate getters for `metadata_at` functions
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* runtime: Implement new `Metadata` runtime trait
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* runtime: Move `metadata_at` functions to construct_runtime macro
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* contruct_runtime: Use `OpaqueMetadata` from hidden imports
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Adjust testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/tests: Add tests for the new API
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Helper to extract documentation literals
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Helper to filter all `cfg` attributes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Generate documentation getters for metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Avoid trait collision with snake case methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* proc-macro/tests: Check doc getters
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Generate metadata for runtime methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/api: Export scale-info and frame-metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Generate metadata for runtime traits
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/runtime: Expose metadata v15 internally
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* test: Use metadata v15 from `lexnv/md_v15_test` branch
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Generate crate access one module up
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame: Implement `runtime_metadata` for mocks and tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Fix warnings
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Add no-docs flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame: Adjust more tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/tests: Check runtime metadata correctness
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/benchmarking: Adjust benchmarks
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/benchmarks: Adjust more benchmarks
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/api: Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/proc-macro: Generate runtime metadata on the `decl_runtime_apis`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame: Abuse Deref to resolve `runtime_metadata`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert "frame: Implement `runtime_metadata` for mocks and tests"
This reverts commit b7f41aa189218589392a6e713ea9488e93c4db45.
Revert "frame: Adjust more tests"
This reverts commit 3cba5982c7f45552e76335e96c430aecbc42d8c6.
Revert "frame/benchmarking: Adjust benchmarks"
This reverts commit 60b382ada486c791ffceeb65da587e949b90ec5d.
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Revert "frame/benchmarks: Adjust more benchmarks"
This reverts commit eb75c477179b1a27347a5554c5732ef26a00d7e8.
* primitives/proc-macro: Remove unused imports and function
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/support: Adjust runtime metadata test
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/tests: Remove doc getter test
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/support: Enable `no-metadata-docs` feature from `sp-api`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/tests: Add `TypeInfo` for test::extrinsic
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/api: Expose scale-info and frame-metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update frame-metadata to include v15
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Fix merge conflicts
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/metadata_ir: Add IR for runtime API metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/metadata_ir: Convert IR to V15
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/api: Collect IR metadata for runtime API
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/api: Move `metadata_ir` from frame/support
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/tests: Adjust testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame/tests: Adjust `metadata_versions` test
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/runtime_metadata: Exclude default type parameters from methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/src/metadata_ir/types.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/src/metadata_ir/mod.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/utils.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* primitives: Fix build
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives/metadata-ir: Move IR to dedicated crate
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives: Reexport metadata-ir and frame-metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* frame: Use apis field instead of runtime
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Better documentation for the `Deref` abstraction
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* ui-tests: Check empty `impl_runtime_apis`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives: Remove unneeded bounds on generic params
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives: Rename `collect_where_bounds` to `get_argument_type_param`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives: Generate crate access per fn call
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert "primitives: Remove unneeded bounds on generic params"
This reverts commit 5178e38cf21cfb481156eefd628d62989201d59a.
* metadata-ir: Add no-std
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* primitives: Adjust where bounds
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Change `frame-metadata` branch to "origin/main"
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update to `main` from origin
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update frame-metadata to crates.io v15.1
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert "ui-tests: Check empty `impl_runtime_apis`"
This reverts commit cf78a7190ad9cba3c3bb2e78dc3d0dc382b2fea9.
* Move ui test to primitives/ui
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update frame/support/test/tests/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/api/proc-macro/src/runtime_metadata.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Test already covered by `empty_impl_runtime_apis_call.stderr`
This reverts commit 3bafb294cbe9745569bf5e5a1a2e6b4a4c1aadc5.
* Retriger CI
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Import `TokenStream` as `TokenStream2`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
* add stub for new benchmark macro
* benchmark syntax
* add #[extrinsic call] separator
* parse #[benchmark] item as a function
* proper emission of error when #[extrinsic_call] annotation is missing
* clean up
* enclosing module via benchmarks! { } working
* use an attribute macro on the module instead of benchmarks! { }
* cargo fmt
* working component implementation
* WIP
* working
* add syntax for Linear<A, B>
* parsing of param ranges (still need to build tuple though)
* params parsing WIP
* clean up (don't need extrinsic call name)
* use proper Result syntax for BenchmarkDef parsing
* proper parsing of Linear<0, 1> style args
* successfully parse and make use of linear component ranges 💥
* rename support variable => home because eventually will be moved
* compile-time check that param range types implement ParamRange
* switch to using balances as example, failing on instance pallet
* successfully set up __origin and __call with balances 💥
* clean up
* use a module
* don't need a variable for transfer
* rename benchmark_transfer -> transfer because no longer conflicts
* clean up
* working with transfer_increasing_users as well 💥
* re-add BareBlock
* add comments for undocumented structs+functions+traits
* refactor in preparation for removing module requirements
* switch to a block instead of a module
* use the outer macro pattern to to enable #[benchmarks] aggregation
* successfully generate SelectedBenchmark 💥
* implement components for SelectedBenchmark
* implement instance for SelectedBenchmark
* properly track #[extra]
* working impl for fn benchmarks()
* run_benchmarks WIP
* finish run_benchmark! impl 💥
* import balances transfer_best_case benchmark
* import transfer_keep_alive balances pallet benchmark
* import set_balance_creating balances pallet benchmark
* import set_balance_killing balances pallet benchmark
* import force_transfer balances pallet benchmark
* add #[extra] annotation and docs to transfer_increasing_users
* import transfer_all balances pallet benchmark
* import force_unreserve balances pallet benchmark
* prepare to implement impl_benchmark_test_suite!
* ensure tests cover #[extra] before and after #[benchmark] tag
* refactor
* clean up
* fix
* move to outer
* switch to benchmarks/instance_benchmarks
* test impl almost done, strange compiler error
* benchmark test suites working 💥
* clean up
* add stub and basic parsing for where_clause
* working except where clause and extrinsic calls containing method chains
* assume option (2) for now wrt https://github.com/paritytech/substrate/pull/12924#issuecomment-1372938718
* clean up
* switch to attribute-style
* properly handle where clauses
* fix subtle missing where clause, now just MessageQueue issues
* fix block formatting in message-queue pallet
* switch to block vs non-block parsing of extrinsic call
* working now but some benchmark tests failing
* message-queue tests working (run order issue fixed) 🎉
* add comments and internal docs for fame_support_procedural::benchmark
* fix license years
* docs for lib.rs
* add docs to new support procedural macros
* don't allow #[benchmark] outside of benchmarking module
* add docs
* use benchmark(extra, skip_meta) style args
* update docs accordingly
* appease clippy
* bump ci
* add notes about `extra` and `skip_meta`
* fix doc tests
* re-run CI
* use `ignore` instead of `no_run` on doc examples
* bump CI
* replace some if-lets with if-elses
* more refactoring of if-let statements
* fix remaining if-lets in BenchmarkDef::from()
* fix if-lets in benchmarks()
* fix remaining if-lets, use nested find_map for extrinsic call
* switch to use #[extrinsic_call] or #[block] situationally
* refactor ExtrinsicCallDef => BenchmarkCallDef
* update docs with info about #[block]
* add macro stub for #[extrinsic_call]
* fix docs and add stub for #[block] as well
* remove unused extern crate line
* fix clippy nits
* Use V2 bench syntax in pallet-example-basic
Just testing the dev-ex...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* carry over comment
* use curly-brace style for impl_benchmark_test_suite!
* remove unneeded parenthesis
* proper handling of _() extrinsic call style
* add docs for _() syntax
* fix crate access
* simplify keyword access
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* simplify module content destructuring
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* fix crate access "frame_benchmarking" => "frame-benchmarking", compiles
* use _() extrinsic call syntax where possible in balances
* simplify attr.path.segments.last()
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* fix compile error being suppressed
* simplify extrinsic call keyword parsing
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* use ? operator instead of return None
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* rename generics => type_use_generics
rename full_generics => type_impl_generics
* simplify extrinsic call extraction with transpose
* bump CI
* nit
* proper handling of too many + too few block/extrinsic call annotations
* change to B >= A
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* remove unneeded ignore
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* remove another ignore
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* add ui tests
* use _() style extrinsic call on accumulate_dummy
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* add range check to ParamRange
* ui test for bad param ranges
* fix failing example
* add ignore back to other failing example
* tweak expr_call span
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* fix typo
* eliminate a match
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* change pub fn benchmarks to return Result<TokenStream>
* fix origin error span
* more informative error for invalid benchmark parameter name
* fix spans on a few benchmark errors
* remove unneeded clone
* refactor inner loop of benchmark function parsing
* preserve mod attributes
* refactor outer loop of benchmark def parsing code, greatly simplified
* simplify to use a ? operator when parsing benchmark attr path
* fix another ? operator
* further simplify benchmark function attr parsing with more ? ops
* refactor extrinsic call handling to use if let rather than match
* replace is_ok => is_err
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* re-use name during expansion of benchmark def
* remove unneeded clone
* fix span for origin missing error
* fix missing semi
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: parity-processbot <>
* Update trybuild to avoid random test failures.
A feature was added to trybuild >1.0.70 avoid failing on different variant
counts in the line `and 278 others`
fixes#12955
* Update all trybuild deps to latest version
* Update Cargo.lock
* construct_runtime: Fix generation of types behind features
With the recent addition of supporting features in `construct_runtime!` there was a bug overseen.
The `AllPalletsWithSystem` etc type declarations would be declared twice when a certain was enabled.
The problem was that in the macro we didn't feature gate the types that should be declared when
there is no feature enabled. This pull request now takes care of feature gating this type behind
`all(#( not(feature) ))`. So, these types will only be enabled if no of the configured features is enabled.
* Fix tests
* FMT
* pallet-macro: Ensure that building with `missing_docs` works
Before this pr it was failing when compiling with `missing_docs`, because the macro was generating
functions etc without the appropriate docs. In the case of this pr it is mainly about hiding these
functions in the docs as they are internal api anyway.
* Fix UI test
* Upgraded dependencies
* Adapting code to scale v3
* Empty commit to trigger CI
* Triggering CI
* Fixing UI test
* Remove superfluous dev-dep added by #9228
* Cryout for CI
* Introduce `SecretUri`
* `inspect-key`: Adds support for `expect-public`
`expect-public` can be used to check that a given secret uri corresponds to the given public key.
This is mainly useful when the secret uri is protected by a password and a new derived account
should be generated. With `--expect-public` the user can pass the public key/account-id of the
"base" secret uri aka the one without any derivation to ensure the correct password was inserted.
* Fixes
* 🤦
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Review feedback
* FMT
* Bump the versions
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Emit error when Config part is imported but without the std feature
* Add UI test for missing std feature on GenesisConfig
* Update frame/support/test/Cargo.toml
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Remove unused imports
* Unify all dummy party checker macros
* Fix
* Dispaly pallet_path::GenesisConfig instead of PalletConfig in error message
* Revert changes to construct_runtime_ui.rs
* Add additional parameter for dummy part checker macro
* Apply suggestions from code review
* fix master merge: update version
* update Cargo.lock
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* mark template and utils as non-publish
* switch to development version for testing
* activate unleash check
* maybe if I disable all rules...
* Fix isolated compilation of `max-encoded-len-derive` with `syn`
error[E0369]: binary operation `==` cannot be applied to type `syn::Path`
--> src/lib.rs:88:29
|
88 | .filter(|attr| attr.path == parse_quote!(max_encoded_len_crate))
| --------- ^^ ----------------------------------- _
| |
| syn::Path
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
Error: could not compile `max-encoded-len-derive`
* WIP: bump changes crates since v3 tag to next breaking
cargo unleash version bump-breaking --changed-since v3.0.0
cargo unleash version set-pre dev --changed-since v3.0.0
FIXME: Don't modify crates that are not yet released, e.g.
`max-encoded-len-derive`
* Update lockfile
* WIP: Bump sp-transaction-pool as well
* WIP: Bump sp-offchain as well
* WIP: Bump frame-system-rpc-runtime-api as well
* WIP: Bump sp-authority-discovery as well
* Manually deactivate dev-deps before `cargo unleash check`
Otherwise we run into `Cycle detected` error.
* Bump sp-consensus-slots
* Add missing Cargo.lock change
* Bump sp-consensus-vrf as well
* Bump sp-keyring as well
* Bump sp-consensus-pow as well
* Try to speed up the `unleash-check` job
Previously, the job took 106 minutes - let's see if explicitly
specifying a `CARGO_TARGET_DIR` will help
* fixup: Ensure the temp target dir exists for unleash check
* Bump pallet-transaction-payment-rpc-runtime-api as well
Needed for Polkadot
* Bump pallet-transaction-payment-rpc as well
Needed for Polkadot
* Try updating crates after patching in the Polkadot CI job
* Use another approach to update patched Substrate crates
* Try to update all sp-core versions in Polkadot CI job
* Simplify sp-core version checking
* Apply another shellcheck lint
* Just do the simplest thing I guess
* Welp don't do --offline then
* Clean up `unleash-check` job triggers
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Fix a note in unleash-check cache step
* Add a note about temporary optimization in cargo-unleash
* Pin a newer version of cargo-unleash
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Lol
* Yeah
* Moare
* adaasda
* Convert AURA to new pallet macro
* AURA: Switch to `CurrentSlot` instead of `LastTimestamp`
This switches AURA to use `CurrentSlot` instead of `LastTimestamp`.
* Add missing file
* Update frame/aura/src/migrations.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Remove the runtime side provide inherent code
* Use correct weight
* Add TODO
* Remove the Inherent from AURA
* 🤦
* Remove unused stuff
* Update primitives authorship
* Fix babe inherent data provider
* Fix consensus-uncles
* Fix BABE
* Do some further changes to authorship primitives... :D
* More work
* Make it compile the happy path
* Make it async!
* Take hash
* More stuff
* Hacks
* Revert "Hacks"
This reverts commit cfffad88668cfdebf632a59c4fbfada001ef8251.
* Fix
* Make `execute_block` return the final block header
* Move Aura digest stuff
* Make it possible to disable equivocation checking
* Fix fix fix
* Some refactorings
* Comment
* Fixes fixes fixes
* More cleanups
* Some love
* Better love
* Make slot duration being exposed as `Duration` to the outside
* Some slot info love
* Add `build_aura_worker` utility function
* Copy copy copy
* Some stuff
* Start fixing pow
* Fix pow
* Remove some bounds
* More work
* Make grandpa work
* Make slots use `async_trait`
* Introduce `SharedData`
* Add test and fix bugs
* Switch to `SharedData`
* Make grandpa tests working
* More Babe work
* Make grandpa work
* Introduce `SharedData`
* Add test and fix bugs
* Switch to `SharedData`
* Make grandpa tests working
* More Babe work
* Make it async
* Fix fix
* Use `async_trait` in sc-consensus-slots
This makes the code a little bit easier to read and also expresses that
there can always only be one call at a time to `on_slot`.
* Make grandpa tests compile
* More Babe tests work
* Fix network test
* Start fixing service test
* Finish service-test
* Fix sc-consensus-aura
* Fix fix fix
* More fixes
* Make everything compile *yeah*
* Make manual-seal compile
* More fixes
* Start fixing Aura
* Fix Aura tests
* Fix Babe tests
* Make everything compile
* Move code around and switch to async_trait
* Fix Babe
* Docs docs docs
* Move to FRAME
* Fix fix fix
* Make everything compile
* Last cleanups
* Fix integration test
* Change slot usage of the timestamp
* We really need to switch to `impl-trait-for-tuples`
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Some extra logging
* Remove dbg!
* Update primitives/consensus/common/src/import_queue/basic_queue.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* more clear randomness API for BABE
* babe: move randomness utilities to its own file
* node: use babe::RandomnessFromOneEpochAgo in random_seed implementation
* frame-support: annotate randomness trait with block number
* pallet-randomness-collective-flip: fix for new randomness trait
* pallet-society: fix randomness usage
* pallet-lottery: fix randomness usage
* pallet-contracts: fix randomness usage
* pallet-babe: fix randomness usage
we need to track when the current and previous epoch started so that we
know the block number by each existing on-chain was known
* node: fix random_seed
* node-template: fix random_seed
* frame-support: extend docs
* babe: add test for epoch starting block number tracking
* babe: fix epoch randomness docs
* frame: add todos for dealing with randomness api changes
Co-authored-by: André Silva <andrerfosilva@gmail.com>