1. Aug 23, 2023
    • juangirini's avatar
      Restructure `frame_support` macro related exports (#14745) · 878c562c
      juangirini authored
      
      
      * make reexports private
      
      * make reexports private 2
      
      * make reexports private for runtime-benchmarking
      
      * make reexports private for try-runtime
      
      * fix for try-runtime
      
      * make reexports private for tests
      
      * fmt
      
      * make reexports private for tests
      
      * make reexports private for experimental
      
      * fix beefy
      
      * fix ui test
      
      * fix ui test
      
      * fix benches
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * fix contracts use
      
      * wip
      
      * wip
      
      * do not reexport sp_api::metadata_ir
      
      * fix CI checks
      
      * fix support tests
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/support/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * import codec directly
      
      * fmt
      
      * fix node-cli tests
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      878c562c
  2. Aug 17, 2023
  3. Aug 16, 2023
  4. Aug 04, 2023
    • Alex Pozhylenkov's avatar
      CountedNMap implementation (#10621) · ef0238dd
      Alex Pozhylenkov authored
      
      
      * add initial CountedDoubleMap implementation
      
      * extend CountedDoubleMap functionality
      
      * add some traits implementation for CountedStorageDoubleMap
      
      * add basic tests for CountedStorageDoubleMap
      
      * add mutate functions implementation
      
      * add additional tests
      
      * add test_option_query test
      
      * add try_append_decode_len_works, append_decode_len_works tests
      
      * add migrate_keys_works, translate_values tests
      
      * add test_iter_drain_translate test
      
      * add test_metadata test
      
      * add remove_prefix implementation,  add test_iter_drain_prefix test
      
      * update
      
      * refactor PrefixIterator usage
      
      * Fix CI build
      
      * fix storage_ensure_span_are_ok_wrong_gen.rs storage_ensure_span_are_ok_wrong_gen_unnamed.rs
      
      * add counted_nmap implementation
      
      * add tests, fixes
      
      * remove counted double map impl
      
      * fix metadata checks
      
      * update clear func
      
      * fix clear, clear with prefix
      
      * fix set function
      
      * update
      
      * final fix
      
      * Update frame/support/src/storage/types/counted_nmap.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * Update frame/support/src/storage/types/counted_nmap.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * Update frame/support/src/storage/types/counted_nmap.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * fix comments
      
      * fix suggestion
      
      * cargo update
      
      * Relocate impl of Sealed for Ref to module root
      
      * fix StorageEntryMetadata type
      
      * Update frame/support/src/storage/types/nmap.rs
      
      Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
      
      * removed StorageNMap and StoragePrefixedMap traits impl
      
      * fix tests
      
      * Update frame/support/src/storage/types/counted_nmap.rs
      
      Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
      
      * extend pallet::storage macro with CountedStorageNMap usage
      
      * fix
      
      * add tests
      
      * fix
      
      * fix
      
      * Add counter_storage_final_key(), map_storage_final_prefix() functions
      
      * update tests
      
      * fix
      
      * fix
      
      * fix
      
      * update tests
      
      * fix fmt
      
      * fix fmt
      
      ---------
      
      Co-authored-by: default avatarAnton <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
      Co-authored-by: parity-processbot <>
      ef0238dd
  5. Aug 01, 2023
  6. Jul 31, 2023
  7. Jul 24, 2023
    • Michal Kucharczyk's avatar
      `test-runtime`: `GenesisBuilder` runtime API impl + tests (#14310) · 53cbda1d
      Michal Kucharczyk authored
      
      
      * test-runtime: GenesisBuilder runtime API impl + tests
      
      This PR provides implementation of `GenesisBuilder` API for `substrate-test-runtime`, can be considered as reference imiplementation for other runtimes.
      The `GenesisBuilder` implementation is gated by `gensis-config` feature.
      
      Tested scenarios:
      - default `GenesisConfig` to JSON blob,
      - deserialization of `GenesisConfig` from custom JSON, and storing its keys into the Storage (genesis storage creation).
      - creation of genesis storage using partial JSON definition,
      - checking if invalid/renamed JSON files causes the runtime to panic,
      
      * missing file added
      
      * client: GenesisBuilder helper added
      
      * feature renamed: genesis-config -> genesis-builder
      
      * Update Cargo.toml
      
      * Update Cargo.toml
      
      * Update Cargo.toml
      
      * Update Cargo.toml
      
      * redundant function removed
      
      * genesis builder helper: introduced RuntimeGenesisBuild
      
      * test-runtime: get rid of unused T
      
      * redundant bound removed
      
      * helper: use GenesisBuild again
      
      * tests adjusted for on_genesis
      
      * test-runtime: support for BuildGenesisConfig
      
      * helper: BuildGenesisConfig support
      
      * Update client/genesis-builder/src/lib.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Update test-utils/runtime/src/test_json/readme.md
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Update test-utils/runtime/src/test_json/readme.md
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Update test-utils/runtime/src/genesismap.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * jsons are now human-friendly
      
      * fix
      
      * improvements
      
      * jsons fixed
      
      * helper: no_defaults added
      
      * test-runtime: no_defaults added
      
      * test-runtime: patching fn removed
      
      * helper: patching fn removed
      
      * helper: moved to frame_support
      
      * test-runtime: fixes
      
      * Cargo.lock updated
      
      * fmt + naming
      
      * test-runtime: WasmExecutor used
      
      * helper / test-runtime: struct removed
      
      * test-runtime: merge fixes
      
      * Cargo.lock + test-utils/runtime/Cargo.toml updated
      
      * doc fixed
      
      * client/rpc: test fixed (new rt api)
      
      * client/rpc-spec-v2: test fix
      
      * doc fix
      
      * test-runtime: disable-genesis-builder feature
      
      * fix
      
      * fix
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * test-runtime: rerun added to build script
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: parity-processbot <>
      53cbda1d
  8. Jul 19, 2023
  9. Jul 13, 2023
    • gupnik's avatar
      Moves `Block` to `frame_system` instead of `construct_runtime` and removes... · 5e7b27e9
      gupnik authored
      
      Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#14437)
      
      * Initial setup
      
      * Adds node block
      
      * Uses UncheckedExtrinsic and removes Where section
      
      * Updates frame_system to use Block
      
      * Adds deprecation warning
      
      * Fixes pallet-timestamp
      
      * Removes Header and BlockNumber
      
      * Addresses review comments
      
      * Addresses review comments
      
      * Adds comment about compiler bug
      
      * Removes where clause
      
      * Refactors code
      
      * Fixes errors in cargo check
      
      * Fixes errors in cargo check
      
      * Fixes warnings in cargo check
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Uses import instead of full path for BlockNumber
      
      * Uses import instead of full path for Header
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Fixes imports in benchmarks
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Formatting
      
      * Minor updates
      
      * Fixes construct_runtime ui tests
      
      * Fixes construct_runtime ui tests with 1.70
      
      * Fixes docs
      
      * Fixes docs
      
      * Adds u128 mock block type
      
      * Fixes split example
      
      * fixes for cumulus
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Updates new tests
      
      * Fixes fully-qualified path in few places
      
      * Formatting
      
      * Update frame/examples/default-config/src/lib.rs
      
      Co-authored-by: default avatarJuan <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarJuan <[email protected]>
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Addresses some review comments
      
      * Fixes build
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/democracy/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/democracy/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Addresses review comments
      
      * Updates trait bounds
      
      * Minor fix
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Removes unnecessary bound
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Updates test
      
      * Fixes build
      
      * Adds a bound for header
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Removes where block
      
      * Minor fix
      
      * Minor fix
      
      * Fixes tests
      
      * ".git/.scripts/commands/update-ui/update-ui.sh" 1.70
      
      * Updates test
      
      * Update primitives/runtime/src/traits.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update primitives/runtime/src/traits.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Updates doc
      
      * Updates doc
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarJuan <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      5e7b27e9
  10. Jul 12, 2023
    • Michal Kucharczyk's avatar
      `GenesisBuild<T,I>` deprecated. `BuildGenesisConfig` added. (#14306) · 87d41d0a
      Michal Kucharczyk authored
      
      
      * frame::support: GenesisConfig types for Runtime enabled
      
      * frame::support: macro generating GenesisBuild::build for RuntimeGenesisConfig
      
      * frame: ambiguity BuildStorage vs GenesisBuild fixed
      
      * fix
      
      * RuntimeGenesisBuild added
      
      * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"
      
      This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293.
      
      * Revert "fix"
      
      This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b.
      
      * Revert "RuntimeGenesisBuild added"
      
      This reverts commit 3c131b618138ced29c01ab8d15d8c6410c9e128b.
      
      * Revert "Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed""
      
      This reverts commit 2b1ecd467231eddec69f8d328039ba48a380da3d.
      
      * Revert "Revert "fix""
      
      This reverts commit fd7fa629adf579d83e30e6ae9fd162637fc45e30.
      
      * Code review suggestions
      
      * frame: BuildGenesisConfig added, BuildGenesis deprecated
      
      * frame: some pallets updated with BuildGenesisConfig
      
      * constuct_runtime: support for BuildGenesisConfig
      
      * frame::support: genesis_build macro supports BuildGenesisConfig
      
      * frame: BuildGenesisConfig added, BuildGenesis deprecated
      
      * Cargo.lock update
      
      * test-runtime: fixes
      
      * Revert "fix"
      
      This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b.
      
      * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"
      
      This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293.
      
      * self review
      
      * doc fixed
      
      * ui tests fixed
      
      * fmt
      
      * tests fixed
      
      * genesis_build macrto fixed for non-generic GenesisConfig
      
      * BuildGenesisConfig constraints added
      
      * warning fixed
      
      * some duplication removed
      
      * fmt
      
      * fix
      
      * doc tests fix
      
      * doc fix
      
      * cleanup: remove BuildModuleGenesisStorage
      
      * self review comments
      
      * fix
      
      * Update frame/treasury/src/tests.rs
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * Update frame/support/src/traits/hooks.rs
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * doc fix: GenesisBuild exposed
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * frame: more serde(skip) + cleanup
      
      * Update frame/support/src/traits/hooks.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * frame: phantom fields moved to the end of structs
      
      * chain-spec: Default::default cleanup
      
      * test-runtime: phantom at the end
      
      * merge master fixes
      
      * fix
      
      * fix
      
      * fix
      
      * fix
      
      * fix (facepalm)
      
      * Update frame/support/procedural/src/pallet/expand/genesis_build.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fmt
      
      * fix
      
      * fix
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      87d41d0a
  11. Jul 10, 2023
  12. Jun 29, 2023
  13. Jun 27, 2023
    • gupnik's avatar
      [FRAME Core] Adds ability to split a pallet across multiple files (#13950) · 5d877401
      gupnik authored
      
      
      * Initial setup
      
      * Updates macro_magic version and refactors accordingly
      
      * Removes unwrap from macro
      
      * Splits into multiple sections
      
      * Uses call_site to fix macro hygiene issue
      
      * Initial setup
      
      * Removes unnecessary changes
      
      * Moves template palet back
      
      * Updates cargo.lock
      
      * Moves BagsList inside mod
      
      * Comments access to internal functions for now
      
      * Updates tests
      
      * Uncomments code
      
      * Fixes test
      
      * Moves bags-list to separate crate
      
      * Initial setup
      
      * Removes bags-list changes
      
      * Fix structure
      
      * Minor update
      
      * Addresses review comment
      
      * Adds a couple of UI tests. More to be added
      
      * Adds err files
      
      * Adds test for no pallet
      
      * Adds doc
      
      * Updates versions
      
      * Adds benchmarking
      
      * Updates doc link
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Minor update
      
      * Adds missing changes
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarSam Johnson <[email protected]>
      
      * Addresses review comments
      
      * Addresses review comments
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarSam Johnson <[email protected]>
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarSam Johnson <[email protected]>
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarSam Johnson <[email protected]>
      
      * Adds UI test for disambiguation
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Makes clippy happy
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Fixes frame support test
      
      * Fixes frame support test
      
      * Split items other than storage
      
      * Updates versions
      
      * Fixes some review comments
      
      * Addresses review comments
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Updates docs
      
      * Adds experimental disclaimer
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/support/test/tests/split_ui/no_section_found.rs
      
      Co-authored-by: default avatarSam Johnson <[email protected]>
      
      * Addresses review comments
      
      * Fixes test
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarcommand-bot <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      5d877401
  14. Jun 24, 2023
  15. Jun 16, 2023
    • Sam Johnson's avatar
      update macro_magic to 0.4.1 (#14356) · 18df38a4
      Sam Johnson authored
      
      
      * update to macro_magic 0.4.0
      
      * remove deprecated syntax and related doc comments
      
      * upgrade to macro_magic v0.4.1
      
      * fix import issue
      
      * fix UI tests
      
      * resolve frame_support path properly
      
      * add docs note about importing
      
      * fix typo
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
      
      * revert UI tests changes because we can't use rust 1.70
      
      * fix UI tests
      
      * fix another UI test
      
      * use simplified import style
      
      * switch back import since tests are written expecting it that way
      
      ---------
      
      Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
      18df38a4
  16. Jun 12, 2023
  17. Jun 06, 2023
  18. 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
  19. 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
  20. May 29, 2023
  21. 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
  22. 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
  23. May 10, 2023
  24. Apr 27, 2023
  25. Apr 25, 2023
  26. Apr 11, 2023
  27. 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
  28. 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
  29. Mar 15, 2023
  30. 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
  31. 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
  32. Jan 27, 2023
  33. 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
  34. 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
  35. Nov 25, 2022
  36. 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
  37. 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
  38. Sep 23, 2022