Xiliang Chen
d346028a9d
reset events before apply runtime upgrade ( #10620 )
...
* reset events before apply runtime upgrade
* fix tests
* add test
* update comment
* Update frame/system/src/lib.rs
* trigger CI
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-01-12 08:22:29 +00:00
Bastian Köcher
f3662b4bba
Happy new year 2022 ( #10573 )
2022-01-03 09:22:14 +01:00
Shawn Tabrizi
ea50ecac4a
Fix Places where AccountId Uses Default ( #10556 )
...
* fix places where accountid is default
* Update frame/system/src/lib.rs
* fmt
* add simple test
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-12-28 23:42:58 +00:00
Alex Pozhylenkov
1d19c7dc7f
Move EnsureOneOf into the dispatch.rs, make an interface more general ( #10379 )
...
* move EnsureOneOf into the dispatch.rs, make an interface more general
* Update frame/support/src/traits/dispatch.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-12-01 21:31:57 +00:00
Enoch Chejieh
d58aeb040a
Add pallet names to Events ( #10296 )
...
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: add pallet names to events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* chore: formatted pallet name changes in events
* fix: add fix to tests for event variants
* chore: modified comments for event variants
* chore: modified comments for event variants
* chore: modified comments for event variants
* chore: modified comments for event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: modified system pallet event variants
* chore: updated transaction-storage pallet event variants
* chore: updated transaction-storage pallet event variants
* chore: formatted contracts pallet
* chore: update treasury event variants
2021-11-30 21:03:06 +01:00
Tomasz Drwięga
08c2d0d4c6
Emit log on Runtime Code change. ( #9580 )
...
* Emit digest item on Runtime Code changes.
* Add tests.
* cargo +nightly fmt --all
* Rename.
* Add comment.
* Move generic parameter to the trait.
* cargo +nightly fmt --all
* Elaborate in doc.
* Revert to RuntimeUpdated name
* cargo +nightly fmt --all
* Rename to RuntimeEnvironmentUpdated
2021-09-15 08:07:06 +00:00
Squirrel
aafe64315a
Remove extra commas made redundent after rustfmt ( #9404 )
...
* Remove extra commas made redundent after rustfmt
2021-07-22 11:06:17 +01:00
Bastian Köcher
7b56ab15b4
Run cargo fmt on the whole code base ( #9394 )
...
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com >
2021-07-21 14:32:32 +00:00
Bastian Köcher
2b282a9435
Remove IncRefError, DecRefError and StoredMapError ( #9384 )
...
All of them are a subset of `DispatchError` anyway, no need to have
special errors IMHO.
2021-07-20 10:39:26 +02:00
Sergei Shulepov
0849bcce0e
Embed runtime version as a custom section ( #8688 )
...
* emit a custom section from impl_runtime_apis!
This change emits a custom section from the impl_runtime_apis! proc macro.
Each implemented API will result to emitting a link section `runtime_apis`.
During linking all sections with this name will be concatenated and
placed into the final wasm binary under the same name.
* Introduce `runtime_version` proc macro
This macro takes an existing `RuntimeVersion` const declaration, parses
it and emits the version information in form of a linking section.
Ultimately such a linking section will result into a custom wasm
section.
* Parse custom wasm section for runtime version
* Apply suggestions from code review
Co-authored-by: David <dvdplm@gmail.com >
* Fix sc-executor integration tests
* Nits
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Refactor apis section deserialization
* Fix version decoding
* Reuse uncompressed value for CallInWasm
* Log on decompression error
* Simplify if
* Reexport proc-macro from sp_version
* Merge ReadRuntimeVersionExt
* Export `read_embedded_version`
* Fix test
* Simplify searching for custom section
Co-authored-by: David <dvdplm@gmail.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-05-12 13:39:08 +00:00
Shaun Wang
ad584733e9
frame system: add event util functions for tests. ( #8734 )
...
* frame system: add event util functions for tests.
* URemove unused fn.
* Apply review suggestions.
2021-05-12 12:17:03 +00:00
Falco Hirschenberger
24311eee3e
Change assert(is_err()) to assert_noop to check state consistency on errors ( #8587 )
...
* Change is_err() asserts in tests to assert_noop to check state consistency
fixes #8545
* Update frame/transaction-payment/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/democracy/src/benchmarking.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/transaction-payment/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Don't assert no-changing state.
see: https://github.com/paritytech/substrate/pull/8587#issuecomment-817137906
* fix expected error
* Fix non-extrinsic-call asserts
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-04-13 10:44:27 +00:00
Gavin Wood
e993f884fc
Self-sufficient account ref-counting ( #8221 )
...
* Self-sufficient account ref-counting
* Fixes
* Update frame/system/src/lib.rs
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* fix build
* Update frame/system/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-03-03 22:28:05 +01:00
Guillaume Thiolliere
0ed683ca13
Use construct_runtime in tests ( #8059 )
...
* impl some more
* add serde
* remove unused
* fix staking fuzz
* fix system bench
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-06 20:12:46 +00:00
Andrew Jones
71ef82afbc
Migrate frame-system to pallet attribute macro ( #7898 )
...
* PRINT_PALLET_UPGRADE=1 cargo check -p frame-system
* Copy attributes, imports, mods and type defs
* Copy Config trait
* Annotate constants
* Tabify
* Migrate hooks
* Upgrade template rename interface to hooks
* Migrate pallet call
* Migrate Event
* Migrate Error
* Migrate Origin
* Remove optional validate_unsigned
* Remove remaining TODO_MAYBE_WHERE_CLAUSE
* Overwrite original lib.rs with migrated lib2.rs.
* Add required Event IsType constraint
* Add disable supertrait check
* Fix leftover Trait trait
* Add missing pallet prefix for weight attributes
* Add missing Error type parameter
* Add missing Hooks type parameter
* Private call visibility, restore original helper types and helpers etc
* Fix hooks type parameter
* Rename RawEvent to Event
* Add missing storage type annotations
* Remove unused imports
* Add GenesisConfig helpers for compat
* Fix unused import warnings
* Update frame/support/procedural/src/storage/print_pallet_upgrade.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Fix test errors and warnings
* Fix remaining errors and warnings
* Apply review suggestion: fix formatting
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Apply review suggestion: annotate BlockLength as constant
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Apply review suggestion: add triling comma
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Apply review suggestion: add triling comma
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Apply review suggestion: add trailing comma
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Apply review suggestion: fix storage type indentation
* Apply review suggestion: remove redundant Origin type alias
* Add missing codec derives for BlockLength
* Restore module docs
* Module -> Pallet renamel
* Revert "Update frame/support/procedural/src/storage/print_pallet_upgrade.rs"
This reverts commit d2a2d5b6
* Apply review suggestion: merge crate imports
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Revert "Upgrade template rename interface to hooks"
This reverts commit 306f0239
* Single line import
* Refactor generated genesis build
* Import sp_io::storage
* Revert previous, fully qualify sp_io::storage
* Fix ui tests
* Fix errors after merge, missing changes
* Set UpgradedToDualRefCount to true in genesis build
* Annotated Runtime version with constant, exposing it via metadata
* Add metadata attribute
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2021-01-20 10:48:19 +00:00
Gavin Wood
f1d36a7103
Introduces account existence providers reference counting ( #7363 )
...
* Initial draft
* Latest changes
* Final bits.
* Fixes
* Fixes
* Test fixes
* Fix tests
* Fix babe tests
* Fix
* Fix
* Fix
* Fix
* Fix
* fix warnings in assets
* Fix UI tests
* fix line width
* Fix
* Update frame/system/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/system/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Fix
* fix unused warnings
* Fix
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Fix
* fix slash and comprehensive slash test
* fix reserved slash and comprehensive tests
* check slash on non-existent account
* Revert "Fix UI tests"
This reverts commit e0002c0f13442f7d0c95a054a6c515536328a4a0.
* Fix
* Fix utility tests
* keep dispatch error backwards compatible
* Fix
* Fix
* fix ui test
* Companion checker shouldn't be so anal.
* Fix
* Fix
* Fix
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/balances/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* return correct slash info when failing gracefully
* fix missing import
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Fix
* Update frame/balances/src/tests_local.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Fixes
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
2021-01-16 18:47:28 +01:00
Bastian Köcher
e3e651f72c
Happy new year ( #7814 )
...
* Happy new year
Updates the copyright years and fixes wrong license headers.
* Fix the template
* Split HEADER into HEADER-APACHE & HEADER-GPL
2021-01-04 09:03:13 +00:00
Bastian Köcher
ce97b6e5c4
Make it possible to calculate the storage root as often as you want ( #7714 )
...
* Make it possible to calculate the storage as often as you want
So, until now each Substrate based blockchain has calculated the storage
root once, at the end of the block. Now there is Frontier that wants to
calculate some intermediate storage root. However this failed on block
import. The problem with that was the extrinsics root. When building the
block we stored `Default::default()` as extrinsics root, because yeah,
we don't know the extrinsics root before finishing the block. At the end
this extrinsics root was then calculated. But on block import we passed
the already known extrinsics root. This was no problem, as we removed
this value at the end of the block. However when you all the storage
root in between, that changes the storage root between block building
and block import.
This pr changes this behavior. It removes the `ExtrinsicsRoot` storage
entry and also doesn't pass it anymore to `System::initialize`. By doing
it, we remove the difference in the storage and fix the storage root mismatch.
* Fix bug with incorrectly calculating the extrinscs root
* Review feedback
2020-12-21 18:08:22 +01:00
Wei Tang
ac8de557d6
Better handling of stable-only build ( #6569 )
...
* Better handling of stable-only build
* Fix node template build
* Fix wasm builder node-template version mismatch
* Fix load_spec error
* Add , in parameter
* Add descrptive panic messages in tests
* Add descriptive tests in node/executor benches
* Fix missing compact_code_unwrap
* Add missing wasm_binary_unwrap function for executor integration test
* Only define import_sp_io in no_std
* Small Cargo.toml styling fix
* Bump wasm-builder to 2.0.0
* Fix all `with_wasm_builder_from_crates` version in Substrate
* Use `with_wasm_builder_from_crates` for node-template
Co-authored-by: Gavin Wood <gavin@parity.io >
2020-07-22 21:40:11 +02:00
Tomasz Drwięga
fb56eacd8d
Extract frame_system SignedExtensions into separate files. ( #6474 )
...
* Split the code.
* Restructure.
* Split tests.
* Self-review.
* Break lines.
* Move tests out.
* Rename CheckEra -> CheckMortality but keep backwards compatibility
* Update frame/system/src/extensions/check_mortality.rs
* Don't rename the IDENTIFIER for now.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-06-24 17:01:42 +02:00