1. Jun 01, 2023
    • Michal Kucharczyk's avatar
      frame: support for serde added (#14261) · dc716127
      Michal Kucharczyk authored
      
      
      * frame: support for serde added
      
      - enabled `serde` features in dependent crates, no gate feature introduced, linker should do the job and strip unused code.
      
      - frame::staking: added impl of `serde::Serialize, serde::Deserialize` for `enum Forcing`
      
      - primitives::runtime: impl_opaque_keys macro provides `Serialize/Deserialize` impl if `serde` is enabled
      
      - primitives::staking: added impl of `serde::Serialize`, `serde::Deserialize` for `enum StakerStatus`
      
      * frame::support: serde for pallets' GenesisConfig enabled in no-std
      
      * Cargo.lock updated
      
      * Update primitives/staking/Cargo.toml
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fix
      
      * Cargo.lock update + missed serde/std in beefy
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      dc716127
  2. May 30, 2023
    • Kian Paimani's avatar
      Default Pallet Config Trait / derive_impl (#13454) · 263a5d6c
      Kian Paimani authored
      
      
      * 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: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/support/procedural/src/derive_impl.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * 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: default avatarBastian Köcher <[email protected]>
      
      * use explicit macro_magic::use_attr
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * remove unneeded {}
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * remove unneeded collect
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * add docs for TestDefaultConfig
      
      * remove unneeded `#[export_tokens]` on `DefaultConfig`
      
      * add docs for auto-generated `DefaultConfig`
      
      * no need to clone
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * clean up combine_impls + compiling again
      
      * remove unused dependency
      
      * simplify struct definition
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fix register_default_impl docs
      
      * reduce rightward drift / refactor
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * fix derive_impl after keith's changes
      
      * simplify disambiguation_path calculation
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * compiling again
      
      * simplify parsing of trait item
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * rename preludes => prelude
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * fix other places where we used preludes instead of prelude
      
      * fix indents
      
      * simplify PalletAttr parsing
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * 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: default avatarBastian Köcher <[email protected]>
      
      * 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: default avatarKian Paimani <[email protected]>
      
      * use () instead of u32 for `AccountData`
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * use ConstU32<10> for BlockHashCount instead of ConstU64<10>
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * people are not dummies
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      
      * fix wording
      
      Co-authored-by: default avatarJust van Stam <[email protected]>
      
      * 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: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarJust van Stam <[email protected]>
      263a5d6c
  3. May 29, 2023
  4. May 26, 2023
    • juangirini's avatar
      Soft deprecate GenesisConfig (#14210) · 34b2a56a
      juangirini authored
      * soft deprecate genesisconfig
      
      * temporarily add a deprecation attr
      
      * update tests
      
      * update mocks
      
      * update genesis config
      
      * update genesis config
      
      * update genesis config
      
      * update genesis config
      
      * remove deprecation warning
      
      * update deprecation comment
      
      ---------
      
      Co-authored-by: parity-processbot <>
      34b2a56a
  5. May 25, 2023
    • Michal Kucharczyk's avatar
      frame: GenesisBuild::build allowed in no_std (#14107) · e31a214a
      Michal Kucharczyk authored
      * 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 <>
      e31a214a
  6. May 10, 2023
  7. Apr 27, 2023
  8. Apr 25, 2023
  9. Apr 11, 2023
  10. Apr 06, 2023
    • Liam Aharon's avatar
      Fix `try-runtime follow-chain`, try-runtime upgrade tuple tests, cli test utils (#13794) · 0b3444c5
      Liam Aharon authored
      
      
      * new test for try-runtime tuple stuff
      
      * fix
      
      * remove development comment
      
      * formatting
      
      * remove todo comment
      
      * follow-chain working test
      
      * refactor common cli testing utils
      
      * fix comment
      
      * revert Cargo.lock changes
      
      * update Cargo.lock
      
      * improve doc comment
      
      * fix error typo
      
      * update Cargo.lock
      
      * feature gate try-runtime test
      
      * build_substrate cli test util
      
      * feature gate follow_chain tests
      
      * move fn start_node to test-utils
      
      * improve test pkg name
      
      * use tokio Child and Command
      
      * remove redundant import
      
      * fix ci
      
      * fix ci
      
      * don't leave hanging processes
      
      * improved child process cleanup
      
      * use existing KillChildOnDrop
      
      * remove redundant comment
      
      * Update test-utils/cli/src/lib.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      ---------
      
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      0b3444c5
    • Keith Yeung's avatar
      Add HoldReason to the NIS pallet (#13823) · 38f3b053
      Keith Yeung authored
      * Add HoldReason to the NIS pallet
      
      * Rename composable_enum to composite_enum
      
      * Add encoding test
      
      * Add more doc comments
      38f3b053
  11. Apr 04, 2023
    • Keith Yeung's avatar
      Implement #[pallet::composite_enum] (#13722) · 1a55f961
      Keith Yeung authored
      * Implement #[pallet::hold_reason]
      
      * Appease clippy
      
      * cargo fmt
      
      * Update test expectations
      
      * Update test expectations
      
      * Support composite_enum attribute instead
      
      * Update test expectations
      
      * Change hold_reason to composite_enum
      
      * Add UI test for unsupported identifier when using composite_enum
      
      * Fix comment
      
      * Add documentation for pallet::composable_enum
      
      * More docs
      
      * cargo fmt
      1a55f961
  12. Mar 15, 2023
  13. Feb 27, 2023
    • Bastian Köcher's avatar
      `pallet-treasury`: Ensure we respect `max_amount` for spend across batch calls (#13468) · 6aa4127a
      Bastian Köcher authored
      * `pallet-treasury`: Ensure we respect `max_amount` for spend across batch calls
      
      When calling `spend` the origin defines the `max_amount` of tokens it is allowed to spend. The
      problem is that someone can send a `batch(spend, spend)` to circumvent this restriction as we don't
      check across different calls that the `max_amount` is respected. This pull request fixes this
      behavior by introducing a so-called dispatch context. This dispatch context is created once per
      outer most `dispatch` call. For more information see the docs in this pr. The treasury then uses
      this dispatch context to attach information about already spent funds per `max_amount` (we assume
      that each origin has a different `max_amount` configured). So, a `batch(spend, spend)` is now
      checked to stay inside the allowed spending bounds.
      
      Fixes: https://github.com/paritytech/substrate/issues/13167
      
      * Import `Box` for wasm
      
      * FMT
      6aa4127a
  14. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * Change copyright year to 2023 from 2022
      
      * Fix incorrect update of copyright year
      
      * Remove years from copy right header
      
      * Fix remaining files
      
      * Fix typo in a header and remove update-copyright.sh
      bc53b9a0
  15. Jan 27, 2023
  16. Jan 23, 2023
    • Sam Johnson's avatar
      new proc-macro-based benchmarking syntax (#12924) · 42e5c27c
      Sam Johnson authored
      * 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: default avatarOliver Tale-Yazdi <[email protected]>
      
      * 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: default avatarKeith Yeung <[email protected]>
      
      * simplify module content destructuring
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * fix crate access "frame_benchmarking" => "frame-benchmarking", compiles
      
      * use _() extrinsic call syntax where possible in balances
      
      * simplify attr.path.segments.last()
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * fix compile error being suppressed
      
      * simplify extrinsic call keyword parsing
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * use ? operator instead of return None
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * 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: default avatarOliver Tale-Yazdi <[email protected]>
      
      * remove unneeded ignore
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * remove another ignore
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * add ui tests
      
      * use _() style extrinsic call on accumulate_dummy
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * 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: default avatarKeith Yeung <[email protected]>
      
      * fix typo
      
      * eliminate a match
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * 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: default avatarKeith Yeung <[email protected]>
      
      * re-use name during expansion of benchmark def
      
      * remove unneeded clone
      
      * fix span for origin missing error
      
      * fix missing semi
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: parity-processbot <>
      42e5c27c
  17. Jan 11, 2023
    • Bastian Köcher's avatar
      `IntegrityTest` implementation should be feature gated (#13094) · 1b01bf8d
      Bastian Köcher authored
      * `IntegrityTest` implementation should be feature gated
      
      The initial implementation for the old declarative macros is still feature gating the
      implementation. As we only call this in a test, there is no need to have this compiled for wasm.
      
      * Don't assume that all "consumers" have a `std` feature
      1b01bf8d
  18. Nov 25, 2022
  19. Nov 07, 2022
    • Sam Johnson's avatar
      Add pallet dev mode (#12536) · 7c4bfc97
      Sam Johnson authored
      
      
      * stub for construct_dev_runtime!
      
      * revert
      
      * stub for dev_mode proc macro
      
      * preliminary docs for pallet::dev_mode (attribute) proc macro
      
      * add dev_mode to pallet_macros module
      
      * add docs item for dev_mode to frame_support
      
      * parsing of #[pallet(dev_mode)]
      
      * strip out dev_mode stub since it will be an arg for pallet instead
      
      * make pallet Def struct aware of dev mode
      
      * WIP
      
      * revert changes to call.rs
      
      * pass dev_mode to pallet parsing code
      
      * auto-specify default weights when in dev mode if not specified
      
      * add proof / expect for syn::parse in dev mode weight processing
      
      * set all storages to unbounded when in dev mode
      
      * just use 0
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      
      * add invalid pallet arg test
      
      * add passing dev mode pallet test
      
      * add test confirming that dev mode features only work in dev mode
      
      * cargo fmt + clean up
      
      * bump CI
      
      * fix pallet ui test
      
      * add docs for dev mode
      
      * add warning about using dev mode in production circumstances
      
      * remove comment about no other attributes being supported
      
      * fix unneeded assignment
      
      * make warning more explicit
      
      * more explicit warning about using dev mode in production
      
      * simpler assignment for dev_mode boolean
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * add note about MEL requirement
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * add comment specifying why weights can be omitted in example
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * tweak wording of comments
      
      * bump ci
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      7c4bfc97
  20. Oct 06, 2022
    • Sam Johnson's avatar
      macro stubs for all pallet:: macros to improve documentation visibility and... · af58e8e8
      Sam Johnson authored
      
      macro stubs for all pallet:: macros to improve documentation visibility and discovery + revamp of pallet macro documentation (#12334)
      
      * proof of concept working for pallet::whitelist_storage
      
      * fix comments
      
      * pallet macros docs rewrite WIP
      
      * fix issue with cargo fmt cobbling links
      
      * tweak capitalization
      
      * fix docs for storage_version
      
      * fix docs for pallet::hooks
      
      * fix several comments
      
      * fix invalid link
      
      * fix wrapping and add missing links for pallet::hooks docs
      
      * run rewrap on all text blocks in frame_support::pallet docs
      
      * cargo fmt
      
      * fix up pallet::call_index docs
      
      * fix docs for pallet::extra_constants
      
      * fix docs for pallet::error
      
      * fix docs for pallet::event
      
      * fix docs for pallet::event
      
      * * fix docs for pallet::storage
      * fix docs for pallet::getter
      * fix docs for pallet::storage_prefix
      * fix docs for pallet::unbounded
      * fix docs for pallet::whitelist_storage
      * fix docs for #[cfg(..)] (for storage items and attributes)
      * fix docs for pallet::storage macro expansion
      
      * fix docs for pallet::type_value
      
      * fix docs for pallet::genesis_config
      
      * fix docs for pallet::genesis_build
      
      * fix docs for pallet::inherent
      
      * fix docs for pallet::validate_unsigned
      
      * fix docs for pallet::origin
      
      * fix docs for general notes on instantiable pallets
      
      * fix docs for example of a non-instantiable pallet
      
      * fix docs for example of an instantiable pallet
      
      * fix docs for upgrade guidelines
      
      * fix docs for upgrade guidelines
      
      * fix docs for upgrade checking and final notes
      
      * fix some examples near the beginning
      
      * extract docs for `pallet::whitelist_storage`
      
      * add docs for pallet_macro_stub
      
      * fix order of pallet::config and pallet::constant
      
      * set up stub for pallet::config
      
      * set up stub for pallet::constant
      
      * fix
      
      * set up stub for pallet::disable_frame_system_supertrait_check
      
      * set up stub for pallet::generate_storage_info
      
      * set up stub for pallet::storage_version
      
      * set up stub for pallet::hooks
      
      * set up stub for pallet::weight
      
      * set up stub for pallet::compact
      
      * set up stub for pallet::call_index
      
      * set up stub for pallet::extra_constants
      
      * set up stub for pallet::error
      
      * set up stub for pallet::event
      
      * set up stub for pallet::generate_deposit
      
      * set up stub for pallet::storage
      
      * set up stub for pallet::getter
      
      * set up stub for pallet::storage_prefix
      
      * set up stub for pallet::unbounded
      
      * set up stub for pallet::type_value
      
      * set up stub for pallet::genesis_config
      
      * set up stub for pallet::genesis_build
      
      * set up stub for pallet::inherent
      
      * set up stub for pallet::validate_unsigned
      
      * set up stub for pallet::origin
      
      * fix comment
      
      * cargo fmt
      
      * tweak error message
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * switch order of derives
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * tweak wording
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * add more context info about `MAX_MODULE_ERROR_ENCODED_SIZE`
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * tweak wording about where clause
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * clarify wording about system/events key
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * use "The Event enum" instead of "item"
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * fix bad wording
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * use enum instead of type
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * expect => expects
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * add additional note about storage prefix
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * clearer note about GenesisConfig
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * Use "The impl" instead of "The item"
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * add note and link to tight-coupling docs
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * cargo fmt
      
      * remove spaces around parenthesis
      
      * fix missing text for pallet::config
      
      * fix issue with pallet::constant intro
      
      * fix wording about codec index
      
      * fix pallet::error wording
      
      * fix comment about 1 byte => 256 errors
      
      * fix where clause comment
      
      * fix comment about where pallet events are stored
      
      * rewrap some text
      
      * fix pallet::storage docs
      
      * fix pallet::storage_prefix docs
      
      * tweak docs for pallet::genesis_build
      
      * tweak docs for pallet::config
      
      * specify that pallet::event must be present if pallet::config is present
      
      * add note about why we would want to bypass the supertrait check
      
      * mention that pallet::generate_store attribute is only valid on pallet struct
      
      * add note about adding new calls to the end to maintain existing order
      
      * add note about pallet::type_value and pallet::storage
      
      Co-authored-by: default avatarSquirrel <[email protected]>
      
      * add note about using pallet::type_value alongside pallet::storage
      
      * include warning about modifying disaptchables on other pallet::call_index docs page
      
      * fix incorrect comment
      
      * add much more information for pallet::inherent
      
      * move pallet::pallet macro expansion notes back to their rightful place
      
      * re-run CI
      
      * fix macro expansion appearing in wrong place for pallet::pallet
      
      * replicate pallet::pallet docs on the pallet::pallet macro stub
      
      * force CI re-run
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarSquirrel <[email protected]>
      Co-authored-by: parity-processbot <>
      af58e8e8
  21. Sep 23, 2022
  22. Sep 20, 2022
    • Sergej Sakac's avatar
      BREAKING: Rename Origin (#12258) · e4b6f4a6
      Sergej Sakac authored
      * BREAKING: Rename Origin
      
      * more renaming
      
      * a bit more renaming
      
      * fix
      
      * more fixing
      
      * fix in frame_support
      
      * even more fixes
      
      * fix
      
      * small fix
      
      * ...
      
      * update .stderr
      
      * docs
      
      * update docs
      
      * update docs
      
      * docs
      e4b6f4a6
  23. Sep 19, 2022
  24. Sep 16, 2022
    • Sam Johnson's avatar
      Add special tag to exclude runtime storage items from benchmarking (#12205) · c0e007b5
      Sam Johnson authored
      * initial setup
      
      * add WhitelistedStorageKeys trait
      
      * add (A, B) tuple implementation for whitelisted_storage_keys()
      
      * fix formatting
      
      * implement WhitelistedStorageKeys for all tuple combinations
      
      * impl_for_tuples up to 128 for WhitelistedStorageKeys
      
      * refactor to #[benchmarking(cached)]
      
      * tweak error message and mark BlockNumber as cached
      
      * add benchmarking(cached) to the other default types
      
      * add docs for benchmarking(cached)
      
      * properly parse storage type declaration
      
      * make storage_alias structs public so we can use them in this macro
      
      * use BTreeMap since TrackedStorageKey missing Ord outside of std
      
      * make WhitelistedStorageKeys accessible
      
      * basic detection of benchmarking(cached) 💥
      
      * proper parsing of #[benchmarking(cached)] from pallet parse macro
      
      * store presence of #[benchmarking(cached)] macro on StorageDef
      
      * will be used for later expansion
      
      * compiling blank impl for WhitelistedStorageKeys
      
      * move impl to expand_pallet_struct
      
      * use frame_support::sp_std::vec::Vec properly
      
      * successfully compiling with storage info loaded into a variable 💥
      
      * plausible implementation for whitelisted_storage_keys()
      
      * depends on the assumption that storage_info.encode() can be loaded
        into TrackedStorageKey::new(..)
      
      * use Pallet::whitelisted_storage_keys() instead of hard-coded list
      
      * AllPallets::whitelisted_storage_keys() properly working 💥
      
      * collect storage names
      
      * whitelisted_storage_keys() impl working 💥
      
      
      
      * clean up
      
      * fix compiler error
      
      * just one compiler error
      
      * fix doc compiler error
      
      * use better import path
      
      * fix comment
      
      * whoops
      
      * whoops again
      
      * fix macro import issue
      
      * cargo fmt
      
      * mark example as ignore
      
      * use keyword tokens instead of string parsing
      
      * fix keyword-based parsing of benchmarking(cached)
      
      * preliminary spec for check_whitelist()
      
      * add additional test for benchmarking whitelist
      
      * add TODO note
      
      * remove irrelevant line from example
      
      * use filter_map instead of filter and map
      
      * simplify syntax
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * clean up
      
      * fix test
      
      * fix tests
      
      * use keyword parsing instead of string parsing
      
      * use collect() instead of a for loop
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * fix compiler error
      
      * clean up benchmarking(cached) marking code
      
      * use cloned()
      
      * refactor to not use panic! and remove need for pub types in storage_alias
      
      * remove unneeded use
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * remove unneeded visibility changes
      
      * don't manually hard code hash for treasury account as hex
      
      * proper Ord, PartialOrd, and Hash impls for TrackedStorageKey
      
      * now based just on key, and available in no-std
      
      * use BTreeSet instead of BTreeMap
      
      * fix comments
      
      * cargo fmt
      
      * switch to pallet::whitelist and re-do it basti's way :D
      
      * make PartialOrd for TrackedStorageKey consistent with Ord
      
      * more correct implementation of hash-related traits for TrackedStorageKey
      
      * fix integration test
      
      * update TODO
      
      * remove unused keyword
      
      * remove more unused keywords
      
      * use into_iter()
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Update frame/support/procedural/src/pallet/parse/mod.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * add docs for whitelisted
      
      * fix comment
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c0e007b5
  25. Sep 13, 2022
  26. Sep 12, 2022
    • Sergej Sakac's avatar
      BREAKING: Rename Call & Event (#11981) · 6e8795af
      Sergej Sakac authored
      
      
      * rename Event to RuntimeEvent
      
      * rename Call
      
      * rename in runtimes
      
      * small fix
      
      * rename Event
      
      * small fix & rename RuntimeCall back to Call for now
      
      * small fixes
      
      * more renaming
      
      * a bit more renaming
      
      * fmt
      
      * small fix
      
      * commit
      
      * prep for renaming associated types
      
      * fix
      
      * rename associated Event type
      
      * rename to RuntimeEvent
      
      * commit
      
      * merge conflict fixes & fmt
      
      * additional renaming
      
      * fix.
      
      * fix decl_event
      
      * rename in tests
      
      * remove warnings
      
      * remove accidental rename
      
      * .
      
      * commit
      
      * update .stderr
      
      * fix in test
      
      * update .stderr
      
      * TRYBUILD=overwrite
      
      * docs
      
      * fmt
      
      * small change in docs
      
      * rename PalletEvent to Event
      
      * rename Call to RuntimeCall
      
      * renamed at wrong places :P
      
      * rename Call
      
      * rename
      
      * rename associated type
      
      * fix
      
      * fix & fmt
      
      * commit
      
      * frame-support-test
      
      * passing tests
      
      * update docs
      
      * rustdoc fix
      
      * update .stderr
      
      * wrong code in docs
      
      * merge fix
      
      * fix in error message
      
      * update .stderr
      
      * docs & error message
      
      * .
      
      * merge fix
      
      * merge fix
      
      * fmt
      
      * fmt
      
      * merge fix
      
      * more fixing
      
      * fmt
      
      * remove unused
      
      * fmt
      
      * fix
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      6e8795af
  27. Sep 08, 2022
    • Boluwatife Bakre's avatar
      Use parameter_types instead of thread_local for test-setup (#12036) · 3ec4d13e
      Boluwatife Bakre authored
      
      
      * Edit to Assets. parameter_types
      
      * fixes
      
      * Test Fixes. WIP
      
      * Edits to pallet-aura
      
      * Camel Case
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Implementation of mutate fn
      
      * update to pallet-aura
      
      * Update to frame-system. Fixes
      
      * Update to frame-support-test. CamelCases
      
      * Updates to frame- contracts, offences, staking, bounties, child bounties
      
      * Edit to mutate fn. Changes to frame-contracts. CamelCase pallet-aura
      
      * Edits to frame-contracts & executive
      
      * cargo +nightly fmt
      
      * unused import removed
      
      * unused import removed
      
      * cargo +nightly fmt
      
      * minor adjustment
      
      * updates
      
      * updates
      
      * cargo +nightly fmt
      
      * cargo +nightly fmt
      
      * take fn implemented
      
      * update
      
      * update
      
      * Fixes to CallFilter
      
      * cargo +nightly fmt
      
      * final fixes
      
      * Default changed to $value
      
      * Update frame/support/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      3ec4d13e
  28. Sep 02, 2022
  29. Sep 01, 2022
  30. Aug 31, 2022
    • Shawn Tabrizi's avatar
      Weight v1.5: Opaque Struct (#12138) · 30951822
      Shawn Tabrizi authored
      * initial idea
      
      * update frame_support
      
      * update a bunch more
      
      * add ord
      
      * adjust RuntimeDbWeight
      
      * frame_system builds
      
      * re-export
      
      * frame_support tests pass
      
      * frame_executive compile
      
      * frame_executive builds
      
      * frame_system tests passing
      
      * pallet-utility tests pass
      
      * fix a bunch of pallets
      
      * more
      
      * phragmen
      
      * state-trie-migration
      
      * scheduler and referenda
      
      * pallet-election-provider-multi-phase
      
      * aura
      
      * staking
      
      * more
      
      * babe
      
      * balances
      
      * bunch more
      
      * sudo
      
      * transaction-payment
      
      * asset-tx-payment
      
      * last pallets
      
      * fix alliance merge
      
      * fix node template runtime
      
      * fix pallet-contracts cc @athei
      
      * fix node runtime
      
      * fix compile on runtime-benchmarks feature
      
      * comment
      
      * fix frame-support-test
      
      * fix more tests
      
      * weight regex
      
      * frame system works
      
      * fix a bunch
      
      * more
      
      * more
      
      * more
      
      * more
      
      * more
      
      * more fixes
      
      * update templates
      
      * fix contracts benchmarks
      
      * Update lib.rs
      
      * Update lib.rs
      
      * fix ui
      
      * make scalar saturating mul const
      
      * more const functions
      
      * scalar div
      
      * refactor using constant functions
      
      * move impl
      
      * fix overhead template
      
      * use compactas
      
      * Update lib.rs
      30951822
  31. Aug 24, 2022
    • Keith Yeung's avatar
      Implement ResultQuery (#11257) · edc8f7b4
      Keith Yeung authored
      * Implement ResultQuery
      
      * Fix test expectations
      
      * Add more tests
      
      * Fix test expectations
      
      * Clean up some names
      
      * Silence warnings
      
      * Specify error type when supplying error type to ResultQuery
      
      * cargo fmt
      
      * Add support for type parameters in parameter_types macro
      
      * Reduce deeply indented code
      
      * Fixes
      
      * Update test expectation
      
      * Rewrite and document formula for calculating max storage size
      
      * More docs
      
      * cargo fmt
      
      * formatting
      
      Co-authored-by: parity-processbot <>
      edc8f7b4
  32. Aug 14, 2022
  33. Jul 17, 2022
  34. Jun 13, 2022
  35. May 31, 2022
    • Gavin Wood's avatar
      Several tweaks needed for Governance 2.0 (#11124) · 7808b0c3
      Gavin Wood authored
      
      
      * Add stepped curve for referenda
      
      * Treasury SpendOrigin
      
      * Add tests
      
      * Better Origin Or-gating
      
      * Reciprocal curve
      
      * Tests for reciprical and rounding in PerThings
      
      * Tweaks and new quad curve
      
      * Const derivation of reciprocal curve parameters
      
      * Remove some unneeded code
      
      * Actually useful linear curve
      
      * Fixes
      
      * Provisional curves
      
      * Rejig 'turnout' as 'support'
      
      * Use TypedGet
      
      * Fixes
      
      * Enable curve's ceil to be configured
      
      * Formatting
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Remove EnsureOneOf
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Formatting
      
      * Fixes
      
      * Update frame/support/src/traits/dispatch.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Grumbles
      
      * Formatting
      
      * Fixes
      
      * APIs of VoteTally should include class
      
      * Fixes
      
      * Fix overlay prefix removal result
      
      * Second part of the overlay prefix removal fix.
      
      * Formatting
      
      * Fixes
      
      * Add some tests and make clear rounding algo
      
      * Fixes
      
      * Formatting
      
      * Revert questionable fix
      
      * Introduce test for kill_prefix
      
      * Fixes
      
      * Formatting
      
      * Fixes
      
      * Fix possible overflow
      
      * Docs
      
      * Add benchmark test
      
      * Formatting
      
      * Update frame/referenda/src/types.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Docs
      
      * Fixes
      
      * Use latest API in tests
      
      * Formatting
      
      * Whitespace
      
      * Use latest API in tests
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      7808b0c3
  36. May 29, 2022
    • Gavin Wood's avatar
      Safe and sane multi-item storage removal (#11490) · ecbd65fb
      Gavin Wood authored
      * Fix overlay prefix removal result
      
      * Second part of the overlay prefix removal fix.
      
      * Report only items deleted from storage in clear_prefix
      
      * Fix kill_prefix
      
      * Formatting
      
      * Remove unused code
      
      * Fixes
      
      * Fixes
      
      * Introduce clear_prefix host function v3
      
      * Formatting
      
      * Use v2 for now
      
      * Fixes
      
      * Formatting
      
      * Docs
      
      * Child prefix removal should also hide v3 for now
      
      * Fixes
      
      * Fixes
      
      * Formatting
      
      * Fixes
      
      * apply_to_keys_whle takes start_at
      
      * apply_to_keys_whle takes start_at
      
      * apply_to_keys_whle takes start_at
      
      * Cursor API; force limits
      
      * Use unsafe deprecated functions
      
      * Formatting
      
      * Fixes
      
      * Grumbles
      
      * Fixes
      
      * Docs
      
      * Some nitpicks 🙈
      
      
      
      * Update primitives/externalities/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Formatting
      
      * Fixes
      
      * cargo fmt
      
      * Fixes
      
      * Update primitives/io/src/lib.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Formatting
      
      * Fixes
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      ecbd65fb
  37. May 23, 2022