gupnik
cd8741c8b5
Moves all test runtimes to use derive_impl ( #2409 )
...
Step in https://github.com/paritytech/polkadot-sdk/issues/171
This PR adds `derive_impl` on all `frame_system` config impls for mock
runtimes. The overridden configs are maintained as of now to ensure
minimal changes.
---------
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-11-28 14:13:57 +01:00
Kian Paimani
35eb133baa
Ensure correct variant count in Runtime[Hold/Freeze]Reason ( #1900 )
...
closes https://github.com/paritytech/polkadot-sdk/issues/1882
## Breaking Changes
This PR introduces a new item to `pallet_balances::Config`:
```diff
trait Config {
++ type RuntimeFreezeReasons;
}
```
This value is only used to check it against `type MaxFreeze`. A similar
check has been added for `MaxHolds` against `RuntimeHoldReasons`, which
is already given to `pallet_balances`.
In all contexts, you should pass the real `RuntimeFreezeReasons`
generated by `construct_runtime` to `type RuntimeFreezeReasons`. Passing
`()` would also work, but it would imply that the runtime uses no
freezes at all.
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-10-24 12:01:04 +02:00
Juan
6a29a70a92
Replace system config Index for Nonce ( #14290 )
...
* replace Index by Nonce
* replace Index by Nonce
* replace Index by Nonce
* replace Index by Nonce
* replace Index by Nonce
* wip
* remove index in lieu of nonce
* wip
* remove accountnonce in lieu of nonce
* add minor improvement
* rebase and merge conflicts
2023-07-14 06:56:48 +00:00
gupnik
5e7b27e98c
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: Juan <juangirini@gmail.com >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Juan <juangirini@gmail.com >
* ".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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/democracy/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* 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: Bastian Köcher <git@kchr.de >
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Updates doc
* Updates doc
---------
Co-authored-by: command-bot <>
Co-authored-by: Juan <juangirini@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-07-13 12:01:34 +00:00
Michal Kucharczyk
87d41d0a89
GenesisBuild<T,I> deprecated. BuildGenesisConfig added. (#14306 )
...
* 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: Sebastian Kunert <skunert49@gmail.com >
* Update frame/support/src/traits/hooks.rs
Co-authored-by: Sebastian Kunert <skunert49@gmail.com >
* 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: Davide Galassi <davxy@datawok.net >
* 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: Bastian Köcher <git@kchr.de >
* fmt
* fix
* fix
---------
Co-authored-by: parity-processbot <>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com >
Co-authored-by: Davide Galassi <davxy@datawok.net >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-07-12 10:22:12 +00:00
Bastian Köcher
05da6d8e84
HoldReason: Improve usage ( #13869 )
...
* HoldReason: Improve usage
`HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums
from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the
variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason`
from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as
type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the
pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`.
* Update frame/nis/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Review comment
* Fixes
---------
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-05-24 21:59:34 +00:00
Arkadiy Paronyan
bfafbf7bac
Statement store ( #13701 )
...
* WIP Statement store
* Sync with networking changes in master
* WIP statement pallet
* Statement validation
* pallet tests
* Validation queue
* Store maintenance
* Basic statement refactoring + tests + docs
* Store metrics
* Store tests
* Store maintenance test
* cargo fmt
* Build fix
* OCW Api
* Offchain worker
* Enable host functions
* fmt
* Minor tweaks
* Fixed a warning
* Removed tracing
* Manual expiration
* Reworked constraint management
* Updated pallet constraint calculation
* Added small test
* Added remove function to the APIs
* Copy-paste spec into readme
* Comments
* Made the store optional
* Removed network protocol controller
* fmt
* Clippy fixes
* fmt
* fmt
* More clippy fixes
* More clippy fixes
* More clippy fixes
* Update client/statement-store/README.md
Co-authored-by: cheme <emericchevalier.pro@gmail.com >
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de >
* Removed sstore from node-template
* Sort out data path
* Added offline check
* Removed dispatch_statement
* Renamed into_generic
* Fixed commit placement
* Use HashSet for tracking peers/statements
* fmt
* Use ExtendedHostFunctions
* Fixed benches
* Tweaks
* Apply suggestions from code review
Co-authored-by: cheme <emericchevalier.pro@gmail.com >
* Fixed priority mixup
* Rename
* newtypes for priorities
* Added MAX_TOPICS
* Fixed key filtering logic
* Remove empty entrie
* Removed prefix from signing
* More documentation
* fmt
* Moved store setup from sc-service to node
* Handle maintenance task in sc-statement-store
* Use statement iterator
* Renamed runtime API mod
* fmt
* Remove dump_encoded
* fmt
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de >
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de >
* Fixed build after applying review suggestions
* License exceptions
* fmt
* Store options
* Moved pallet consts to config trait
* Removed global priority
* Validate fields when decoding
* Limit validation channel size
* Made a comment into module doc
* Removed submit_encoded
---------
Co-authored-by: cheme <emericchevalier.pro@gmail.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-05-04 10:24:32 +00:00