Commit Graph

520 Commits

Author SHA1 Message Date
Kian Paimani 1344e43d2d Remove all stale on_runtime_upgrade hooks in the runtime (#10650)
* Remove all stale on_runtime_upgrade hooks in the runtime

* add docs

* cleanup

* fix warn

* fix more warnings

* fix offence test

* overwrite the damn UItest
2022-01-19 20:58:47 +01:00
Guillaume Thiolliere 137628b4d7 Add feature: no-metadata-doc which removes doc from metadata and full-metadata which build metadata with all doc (#10493)
* add features to remove or add doc

* fmt

* add test for event/error/call

* fmt
2022-01-17 22:21:19 +01:00
Shawn Tabrizi d511cc8cfb Improve BoundedVec API (extracted from #10195) (#10656)
* Gav wrote this code in pull #10195. Extracting to simplify that PR.

* fix potential panics

* prevent panics in slide

* update doc

* fmt

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2022-01-17 10:28:11 +01:00
Alex Pozhylenkov 03a7738ed8 add into function for PrefixIterator (#10614)
* add into function for PrefixIterator

* update with comments

* update with comments
2022-01-09 20:12:21 +01:00
Kian Paimani 02468b803f Add Ord implementation for BoundedVec (#10615)
* Add Ord implementation for BoundedVec

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-01-09 09:03:21 +00:00
Bastian Köcher e254fd59f2 frame-support: Use logging for printing corrupted state (#10612)
`runtime_print!` is printed by default using `debug`, aka not being visible. With `log::error!` it
will be printed directly to the user. Production networks like Polkadot disable logging, but for
them we run special nodes that have logging enabled.
2022-01-08 16:13:54 +00:00
Kian Paimani c3add6ee09 some improvements to bounded vec API (#10590)
* some improvements to bounded vec

* revert license tweak

* more tests

* fix

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* add the same stuff for btree map and set as well

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-01-06 10:55:21 +00:00
dependabot[bot] cabfd35649 Bump proc-macro2 from 1.0.32 to 1.0.36 (#10564)
* Bump proc-macro2 from 1.0.32 to 1.0.36

Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.32 to 1.0.36.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.32...1.0.36)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix ui tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2022-01-06 09:22:35 +00:00
Squirrel 3dd32d5255 Make clippy _a little_ more annoying (#10570)
* Clippy: +complexity

* Update client/cli/src/arg_enums.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update bin/node/inspect/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update primitives/keystore/src/testing.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/elections/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update primitives/npos-elections/fuzzer/src/reduce.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Incorporating feedback

* No need for Ok

* Additional

* Needed slice

* Wigy's suggestions on less derefs

* fix count

* reverting changes brought in by option_map_unit_fn

* add --all-targets

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2022-01-05 14:35:30 +00:00
Bastian Köcher f3662b4bba Happy new year 2022 (#10573) 2022-01-03 09:22:14 +01:00
cheme 4c651637f2 Inner hashing of value in state trie (runtime versioning). (#9732)
* starting

* Updated from other branch.

* setting flag

* flag in storage struct

* fix flagging to access and insert.

* added todo to fix

* also missing serialize meta to storage proof

* extract meta.

* Isolate old trie layout.

* failing test that requires storing in meta when old hash scheme is used.

* old hash compatibility

* Db migrate.

* runing tests with both states when interesting.

* fix chain spec test with serde default.

* export state (missing trie function).

* Pending using new branch, lacking genericity on layout resolution.

* extract and set global meta

* Update to branch 4

* fix iterator with root flag (no longer insert node).

* fix trie root hashing of root

* complete basic backend.

* Remove old_hash meta from proof that do not use inner_hashing.

* fix trie test for empty (force layout on empty deltas).

* Root update fix.

* debug on meta

* Use trie key iteration that do not include value in proofs.

* switch default test ext to use inner hash.

* small integration test, and fix tx cache mgmt in ext.
test  failing

* Proof scenario at state-machine level.

* trace for db upgrade

* try different param

* act more like iter_from.

* Bigger batches.

* Update trie dependency.

* drafting codec changes and refact

* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.

* alt hashing only for branch with value.

* fix trie tests

* Hash of value include the encoded size.

* removing fields(broken)

* fix trie_stream to also include value length in inner hash.

* triedbmut only using alt type if inner hashing.

* trie_stream to also only use alt hashing type when actually alt hashing.

* Refactor meta state, logic should work with change of trie treshold.

* Remove NoMeta variant.

* Remove state_hashed trigger specific functions.

* pending switching to using threshold, new storage root api does not
make much sense.

* refactoring to use state from backend (not possible payload changes).

* Applying from previous state

* Remove default from storage, genesis need a special build.

* rem empty space

* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
changing state.

* fix compilation

* Right logic to avoid switch on reencode when default layout.

* Clean up some todos

* remove trie meta from root upstream

* update upstream and fix benches.

* split some long lines.

* UPdate trie crate to work with new design.

* Finish update to refactored upstream.

* update to latest triedb changes.

* Clean up.

* fix executor test.

* rust fmt from master.

* rust format.

* rustfmt

* fix

* start host function driven versioning

* update state-machine part

* still need access to state version from runtime

* state hash in mem: wrong

* direction likely correct, but passing call to code exec for genesis
init seem awkward.

* state version serialize in runtime, wrong approach, just initialize it
with no threshold for core api < 4 seems more proper.

* stateversion from runtime version (core api >= 4).

* update trie, fix tests

* unused import

* clean some TODOs

* Require RuntimeVersionOf for executor

* use RuntimeVersionOf to resolve genesis state version.

* update runtime version test

* fix state-machine tests

* TODO

* Use runtime version from storage wasm with fast sync.

* rustfmt

* fmt

* fix test

* revert useless changes.

* clean some unused changes

* fmt

* removing useless trait function.

* remove remaining reference to state_hash

* fix some imports

* Follow chain state version management.

* trie update, fix and constant threshold for trie layouts.

* update deps

* Update to latest trie pr changes.

* fix benches

* Verify proof requires right layout.

* update trie_root

* Update trie deps to  latest

* Update to latest trie versioning

* Removing patch

* update lock

* extrinsic for sc-service-test using layout v0.

* Adding RuntimeVersionOf to CallExecutor works.

* fmt

* error when resolving version and no wasm in storage.

* use existing utils to instantiate runtime code.

* Patch to delay runtime switch.

* Revert "Patch to delay runtime switch."

This reverts commit 67e55fee468f1a0cda853f5362b22e0d775786da.

* useless closure

* remove remaining state_hash variables.

* Remove outdated comment

* useless inner hash

* fmt

* fmt and opt-in feature to apply state change.

* feature gate core version, use new test feature for node and test node

* Use a 'State' api version instead of Core one.

* fix merge of test function

* use blake macro.

* Fix state api (require declaring the api in runtime).

* Opt out feature, fix macro for io to select a given version
instead of latest.

* run test nodes on new state.

* fix

* Apply review change (docs and error).

* fmt

* use explicit runtime_interface in doc test

* fix ui test

* fix doc test

* fmt

* use default for path and specname when resolving version.

* small review related changes.

* doc value size requirement.

* rename old_state feature

* Remove macro changes

* feature rename

* state version as host function parameter

* remove flag for client api

* fix tests

* switch storage chain proof to V1

* host functions, pass by state version enum

* use WrappedRuntimeCode

* start

* state_version in runtime version

* rust fmt

* Update storage proof of max size.

* fix runtime version rpc test

* right intent of convert from compat

* fix doc test

* fix doc test

* split proof

* decode without replay, and remove some reexports.

* Decode with compatibility by default.

* switch state_version to u8. And remove RuntimeVersionBasis.

* test

* use api when reading embedded version

* fix decode with apis

* extract core version instead

* test fix

* unused import

* review changes.

Co-authored-by: kianenigma <kian@parity.io>
2021-12-24 08:54:07 +00:00
Kian Paimani cfac7d6832 add to (#10524) 2021-12-21 18:42:15 +01:00
Alexander Theißen 62ee43d822 Use exists host function (#10531) 2021-12-21 18:36:46 +01:00
dependabot[bot] 3c975071c8 Bump frame-metadata from 14.0.0 to 14.2.0 (#10519)
Bumps [frame-metadata](https://github.com/paritytech/frame-metadata) from 14.0.0 to 14.2.0.
- [Release notes](https://github.com/paritytech/frame-metadata/releases)
- [Changelog](https://github.com/paritytech/frame-metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paritytech/frame-metadata/commits)

---
updated-dependencies:
- dependency-name: frame-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 12:38:58 +01:00
dependabot[bot] 03d726aac3 Bump serde from 1.0.131 to 1.0.132 (#10517)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.131 to 1.0.132.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.131...v1.0.132)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 11:17:06 +01:00
dependabot[bot] 6eb6fa32fc Bump rustversion from 1.0.5 to 1.0.6 (#10516)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.5...1.0.6)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 14:10:21 +01:00
dependabot[bot] ba25029d0f Bump syn from 1.0.81 to 1.0.82 (#10505)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.81...1.0.82)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-19 11:26:37 +01:00
dependabot[bot] d2e9026444 Bump serde from 1.0.130 to 1.0.131 (#10500)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.130 to 1.0.131.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.130...v1.0.131)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-17 08:30:58 +00:00
dharjeezy 1b0be8ae06 Replace parameter_types with ConstU32 &c. (#10402)
* remove parameter types and use const type

* remove parameter types and use const type

* Delete {

* Delete count,

* refractor for beefy, benchmarking, child bounties, and collective pallets

* refractor for pallet contracts

* refractor for elections

* refractor for more pallets

* fix CI issues

* fix CI issues

* fix CI issues

* fix CI issues

* remove warning to fix CI issue

* remove warning to fix CI issue
refractor for pallet preimage

* remove warning to fix CI issue
refractor for pallet proxy

* remove warning to fix CI issue
refractor for pallet recovery
refractor for pallet randomness-collective-flip

* remove warning to fix CI issue
refractor for pallet scored-pool
refractor for pallet scheduler
refractor for pallet session

* remove warning to fix CI issue
refractor for pallet society, support, system, timestamp, tips

* remove warning to fix CI issue
refractor for pallet transaction_payment, transaction_storage, treasury, uniques, utility

* remove warning to fix CI issue

* cargo +nightly fmt

* CI fix

* more param refractor on beefy-mmr

* refractor for beefy

* Update frame/babe/src/mock.rs

* Update frame/babe/src/mock.rs

* Update frame/bounties/src/tests.rs

* Update frame/tips/src/tests.rs

* Delete mock.rs

* Update frame/examples/basic/src/tests.rs

* Apply suggestions from code review

* Update frame/im-online/src/mock.rs

* Update frame/im-online/src/mock.rs

* Update frame/offences/benchmarking/src/mock.rs

* Update frame/session/benchmarking/src/mock.rs

* Update frame/support/test/tests/pallet_compatibility.rs

* Update frame/support/test/tests/pallet_compatibility_instance.rs

* Update frame/treasury/src/tests.rs

* Update test-utils/runtime/src/lib.rs

* some cleanup

* fmt

* remove unused

Co-authored-by: Damilare <dakinlose@teamapt.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-12-16 03:06:11 +00:00
David edf73199ab Prepare sp-runtime for publication (#10451)
* Bump versions of sp-core and dependencies to v4.0.0

* Update references from `4.0.0-dev` –> `4.0.0`

* Funny whitespace

* Funny whitespace 2

* Prepare `sp-runtime` for publication
2021-12-15 12:36:17 +01:00
Bastian Köcher bc0ecf8d40 Remove cargo unleash CI job (#10482)
* Remove cargo unleash CI job

The CI job is currently breaking, because we released some crates. We also don't need the job
currently because releases are not done. So, the job currently just annoys people and eats CPU time.
This brings us to the conclusion that this job is currently not required and can be readded at a
later point when we are sure that we need it.

* Hopefully fix UI test

* Another try

* Remove `reserved_keyword` ui
2021-12-14 23:44:04 +01:00
Bastian Köcher 187663e1f1 Prepare code for rust 1.57 (#10471)
* Prepare code for rust 1.57

* CI: revert me; staging image with stable 1.57

* Revert "CI: revert me; staging image with stable 1.57 [skip CI]"

This reverts commit f3c3b8a9e877ef7126ffce6ebc4822bb4ace0379.

Co-authored-by: CI system <>
2021-12-14 13:05:47 +01:00
Gavin Wood 1e24e45ea1 Remove Default bound for AccountId (#10403)
* Remove Default for AccountId

* More removals of default

* Update frame/authorship/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/authorship/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/authorship/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/authorship/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* More work

* More work

* Remove old code

* More work

* pallet-asset-tx-payment

* tips

* sc-consensus-babe

* sc-finality-grandpa

* sc-consensus-babe-rpc

* sc-cli

* make npos crates accept non-default account (#10420)

* minimal changes to make npos pallets all work

* make this pesky reduce.rs a bit cleaner

* more work

* more work

* Tests build

* Fix imonline tests

* Formatting

* Fixes

* Fixes

* Fix bench

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Formatting

* Fixes

* Formatting

* Fixes

* Formatting

* Fixes

* Formatting

* Fixes

* Formatting

* Update client/keystore/src/local.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/finality-grandpa/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/keystore/src/local.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/keystore/src/local.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/staking/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/staking/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Formatting

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
2021-12-13 15:03:59 +01:00
Gavin Wood 5e50e0bc2c Preimage registrar and Scheduler integration (#10356)
* initial idea

* more

* fix compile

* add clear and request logic

* improve some docs

* Add and implement trait

* continuing to improve

* refcount type

* infallible system preimage upload

* fmt

* fix requests

* Make it simple

* Make it simple

* Formatting

* Initial draft

* request when scheduled

* Docs

* Scheduler good

* Scheduler good

* Scheduler tests working

* Add new files

* Missing stuff

* Repotting, add weights.

* Add some tests to preimage pallet

* More tests

* Fix benchmarks

* preimage benchmarks

* All preimage benchmarks

* Tidy cargo

* Update weights.rs

* Allow hash provision in benchmarks

* Initial work on new benchmarks for Scheduler

* Tests working, refactor looks good

* Tests for new Scheduler functionality

* Use real weight, make tests work with runtimes without Preimage

* Rename

* Update benchmarks

* Formatting

* Formatting

* Fix weird formatting

* Update frame/preimage/src/lib.rs

* Fix try-runtime build

* Fixes

* Fixes

* Update frame/support/src/traits/tokens/currency.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/traits/tokens/currency/reservable.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/traits/tokens/imbalance.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/preimage/src/mock.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update frame/scheduler/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update frame/preimage/src/lib.rs

* Fixes

* Fixes

* Formatting

* Fixes

* Fixes

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_scheduler --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/scheduler/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_preimage --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/preimage/src/weights.rs --template=./.maintain/frame-weight-template.hbs

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: Parity Bot <admin@parity.io>
2021-12-11 15:55:23 +01:00
Bastian Köcher f6f58f95e1 inspect-key: Adds support for expect-public (#10430)
* Introduce `SecretUri`

* `inspect-key`: Adds support for `expect-public`

`expect-public` can be used to check that a given secret uri corresponds to the given public key.
This is mainly useful when the secret uri is protected by a password and a new derived account
should be generated. With `--expect-public` the user can pass the public key/account-id of the
"base" secret uri aka the one without any derivation to ensure the correct password was inserted.

* Fixes

* 🤦

* Apply suggestions from code review

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Review feedback

* FMT

* Bump the versions

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2021-12-11 08:13:18 +01:00
Gavin Wood 3dd8f83a3a Insufficient asset quota and deposits (#10382)
* Allow asset accounts to exist by deposit

* Place limit on consumers (and therefore freebie asset accounts)

* Maximum number of assets

* Fixes

* Fixes

* Formatting

* Docs

* Formatting

* Destroyed assets are properly tidied

* Update frame/assets/src/types.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Docs

* Docs

* Formatting

* Docs

* Docs

* Fixes

* Fixes

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-12-09 13:22:54 +01:00
David 92dc635f3c Release sp-core 4.0.0 (#10447)
* Bump versions of sp-core and dependencies to v4.0.0

* Update references from `4.0.0-dev` –> `4.0.0`

* Funny whitespace

* Funny whitespace 2
2021-12-08 21:06:50 +01:00
Ayevbeosa Iyamu 56fb1cfbb6 Used CountedStorageMap in pallet-staking (#10233)
* Removed counters and used CountedStorageMap instead.

* Little refactoring

* Update frame/staking/src/migrations.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Removed redundant code to update counter for validator & nominator.

* Removed redundant code to update counter for validator & nominator.

* Removed unreachable code to inject the hashed prefix for nominator & validator.

* Removed redundant check for nominator & validator count.

* Generated `fn prefix_hash` for `CountedStorageMap`.

* Applied changes from `cargo fmt`

* Possible correct implementation of migration code

* Implemented fn module_prefix, storage_prefix and prefix_hash.

* Removed counted_map.rs

* Renamed `fn storage_prefix` to `storage_counter_prefix`.

* Update frame/support/src/storage/types/counted_map.rs

* Update frame/bags-list/remote-tests/src/snapshot.rs

* Update frame/support/src/storage/types/counted_map.rs

* Fixed errors.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-12-07 09:21:27 +00:00
Guillaume Thiolliere 9756615d5b Fix pallet bags list and doc (#10231)
* fix bags list

* improve doc

* doc

* inner doc

* fix test

* Update docs in frame/election-provider-support/src/lib.rs

* fix staking impl

* prepend unsafe to clear and regenerate

* fix test

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-12-03 05:58:12 +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
Guillaume Thiolliere db28ba9dfd Fix order of hook execution (#10043)
* fix order

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* format

* more accurate description

* format

* better explicit types

* fix tests

* address feedback

* add a type to ease non breaking implementation

* add comment about constraint

* fix test

* add test for generated types

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2021-12-01 00:59:09 +00:00
Alexander Popiak 3675d87f51 derive Debug for CrateVersion and StorageVersion (#10355) 2021-11-24 13:39:11 +00:00
Guillaume Thiolliere fcfb766366 Fix some doc link (#10329)
* fix some doc link

* fmt
2021-11-22 10:48:53 +00:00
dharjeezy cac9d85cb3 use proper intra doc link (#10271)
* use proper intra doc link

* use proper intra doc link

* get system path name from path module name function for the docs

* used format macro in formatting doc string for better output

* helper function to get intra doc string

* helper function to get intra doc string

* use helper function on expand_origin_pallet_conversions

* remove duplicates

* Update frame/support/procedural/src/construct_runtime/expand/origin.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* remove leading white space

Co-authored-by: Damilare <dakinlose@teamapt.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-11-21 14:42:21 +01:00
dependabot[bot] bae12f41b8 Bump structopt from 0.3.23 to 0.3.25 (#10253)
* Bump structopt from 0.3.23 to 0.3.25

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.23 to 0.3.25.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.23...v0.3.25)

---
updated-dependencies:
- dependency-name: structopt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* cargo fmt

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-11-13 02:35:07 +00:00
dependabot[bot] 67be56a39f Bump rustversion from 1.0.4 to 1.0.5 (#10243)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.4...1.0.5)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-12 14:42:26 +01:00
Arkadiy Paronyan 4cbbf0cf43 Kill the light client, CHTs and change tries. (#10080)
* Remove light client, change tries and CHTs

* Update tests

* fmt

* Restore changes_root

* Fixed benches

* Cargo fmt

* fmt

* fmt
2021-11-12 14:15:01 +01:00
dependabot[bot] 2c5337e4b2 Bump proc-macro-crate from 1.0.0 to 1.1.0 (#10237)
Bumps [proc-macro-crate](https://github.com/bkchr/proc-macro-crate) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/bkchr/proc-macro-crate/releases)
- [Commits](https://github.com/bkchr/proc-macro-crate/commits)

---
updated-dependencies:
- dependency-name: proc-macro-crate
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-11 16:58:14 +01:00
dependabot[bot] d9d4a59dc2 Bump parity-util-mem from 0.10.0 to 0.10.2 (#10236)
Bumps [parity-util-mem](https://github.com/paritytech/parity-common) from 0.10.0 to 0.10.2.
- [Release notes](https://github.com/paritytech/parity-common/releases)
- [Commits](https://github.com/paritytech/parity-common/compare/parity-util-mem-v0.10.0...parity-util-mem-v0.10.2)

---
updated-dependencies:
- dependency-name: parity-util-mem
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-11 12:02:39 -03:00
David eeb80f9e0b Upgrade jsonrpsee to v0.4.1 (#10022)
* Upgrade jsonrpsee to v0.4.1

* remove needless BlockT trait bound

* use default wss port in URL

* Fix try_runtime build

* Partially fix for "remote-tests" feature

* Review feedback

* fmt

* Sort out trait bounds for benches

* Fmt

* fmt again?

* fmt with nightly-2021-09-13

* Upgrade try-runtime as well

* fmt

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2021-11-11 11:29:28 +00:00
Kian Paimani 60a50dabed use CountedMap in pallet-bags-list (#10179)
* use CountedMap in pallet-bags-list

* Fix build

* Update frame/bags-list/src/list/mod.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* add a check as well

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-11-10 09:33:14 +00:00
Qinxuan Chen 5d5e685ebe frame_support::pallet_prelude: Add scale_info::TypeInfo (#10221)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-11-09 12:59:55 +01:00
Kian Paimani 937b6f246e put TryInto and TryFrom in sp_std::prelude (#10183)
* Switch to Rust 2021

* Update trybuild to fix errors

* half baked

* fix

* remove unused import

* remove more warnings

Co-authored-by: Bastian Köcher <info@kchr.de>
2021-11-08 00:24:53 +01:00
dependabot[bot] 27c1fe8718 Bump syn from 1.0.80 to 1.0.81 (#10182)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.80...1.0.81)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-05 15:51:54 +01:00
Bastian Köcher b08d3017a8 Switch to Rust 2021 (#10170)
* Switch to Rust 2021

* Update trybuild to fix errors
2021-11-04 19:54:48 +01:00
Guillaume Thiolliere 2755a97fa3 handle doc on type_value (#10132) 2021-11-04 10:11:39 +00:00
Alexander Samusev a46fa8461b Update CI image to the latest rustc (#10142)
* Update CI image to the latest rustc

* Update rustc error messages

* whitespace

* update test output

* updating compiler errors

* kid's finally learning to read and spots the TRYBUILD=overwrite message.

* undoing a little blessing

* imperfect error msg

* revert ci image to production

Co-authored-by: gilescope <gilescope@gmail.com>
2021-11-03 13:23:32 +01:00
Guillaume Thiolliere 20c9afcdc1 Better error for when origin filter prevent the call to be dispatched (#10134)
* better error

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove unused

* fix error

* fmt

* fix tests

* fmt

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* fix typo

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2021-11-02 14:20:00 +00:00
cheme 471e9cfbf1 Hashing proc macro utils (#9875)
* hashing macro

* fmt

* use in easy place, and fix blake sizes

* fix

* Fixes, docs.
Allow ident as input.

* fix doc tests

* update error in test (nmapkey and key are same type).

* hashing crates under sp_core

* Doc updates and format.

* use all existing hashing functions.

* return array of u8

* Update primitives/core/hashing/proc-macro/src/impls.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* ToTokeen for an array of u8

* fix

* re

* Improve impls

* complete doc tests

* fmt

* fix doctest format

* fix ui test (nmap key type alias)

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2021-11-02 09:35:23 +00:00
Guillaume Thiolliere 4292e18e50 Automatic pallet parts in construct_runtime (#9681)
* implement automatic parts

* ui tests

* rename

* remove unnecessary exclude

* better doc

* better doc

* fix genesis config

* fix UI tests

* fix UI test

* Revert "fix UI test"

This reverts commit a910351c0b24cfe42195cfd97d83a416640e3259.

* implemented used_parts

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* doc + fmt

* Update frame/support/procedural/src/construct_runtime/parse.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* add doc in the macro

* remove yet some more parts

* fix ui test

* more determnistic error message + fix ui tests

* fix ui test

* Apply suggestions from code review

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* do refactor + fix ui tests

* fmt

* fix test

* fix test

* fix ui test

* Apply suggestions from code review

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* refactor

* remove even more part in node-runtime

* fix test

* Add flow chart for the construct_runtime! execution flow

* Fix typo

* Ignore snippets that don't contain code

* Refactor some code in expand_after

* Rename expand_after to match_and_insert

* cargo fmt

* Fix rename

* Remove frame_support argument to construct_runtime_parts

* Make use of tt-call to simplify intermediate expansions

* cargo fmt

* Update match_and_insert documentation

* Reset cursor to 0 when no matching patterns are found

* Reorder struct fields on MatchAndInsertDef

* Add test for dependency renames and fix frame-support import

* Add more doc comments

* Update frame/support/test/compile_pass/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-10-31 13:55:10 +00:00