Commit Graph

8072 Commits

Author SHA1 Message Date
Liam Aharon c628742506 migration(tips): unreserve deposits (#14241)
* unreserve all tip funds migration

* improve test

* fix comment

* implement weights

* saturating_accrue

* remove unnecessary collect

* prefer ensure

* use assert

* use saturating_add

* use saturating_accrue

* test pre_upgrade and post_upgrade

* remove pallet_treasury bound

* resolve pr comments

* rename migration

* kick ci

* kick ci
2023-06-05 09:15:15 +00:00
Squirrel 8ae7d6923c Remove unrequired check (#14298)
* Remove unrequired check

The get_pool_account function no longer relies on a `_trucating` function,
and there is a test in place
should someone alter the function to create pool collisions.

* test needed in this case.
2023-06-04 21:17:51 +00:00
Bastian Köcher 57e6b21935 frame_system::remark: Allow any kind of origin (#14260)
* frame_system::remark: Allow any kind of origin

There should be no downside in allowing any kind of origin for `remark`.

* Fix tests
2023-06-04 23:15:16 +02:00
Gavin Wood 643f8d76cd Frame: Introduce TryConvert and MaybeConvert family of traits (#14297)
* Frame: Introduce TryConvert and TryConvertBack

* Update primitives/runtime/src/traits.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* 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>

* Add MaybeEquivalence

* Docs

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-04 18:06:03 +01:00
Bastian Köcher e7a27a31b1 sp-api: Remove requirement on Get*BlockType (#14299)
Remove the requirement on `GetNodeBlockType` and `GetRuntimeBlockType`. Actually this wasn't already
used anymore and only referenced in tests.
2023-06-04 09:55:53 +01:00
Bastian Köcher 51c87d8525 sc-transaction-pool: Always use best block to check if we should skip enactment (#14285)
We will calculate the tree route always against the best block and thus, we also should use this one
to check if we should skip the checks.
2023-06-02 19:37:35 +01:00
PG Herveou 9dedddafad frame-support Add translate_next (#14043)
* Frame Add translate_next

This works similarly to to `translate` but only translate a single entry.
This function will be useful in the context of multi-block migration.

* Add test

* add None return case

* fixes

* PR comment use `?`
2023-06-02 14:11:11 +00:00
Andrew Jones 31f9593324 Bump version of pallet-contracts-primitives for release (#14288)
* Bump version of `pallet-contracts-primitives` for release

* Cargo.lock
2023-06-02 15:01:45 +01:00
Squirrel 28afa48006 asset-conversion pallet: Generalise integrity test (#14289)
* integrity test was only working for u32 asset ids.

* cargo fmt

* Update frame/asset-conversion/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-06-02 12:54:01 +00:00
jserrat 50d5b94225 add test locking removed when amount is zero (#14284)
* add test locking removed when amount is zero

* add test set lock with withdraw reasons empty removes lock

* fix test set lock with withdraw reasons
2023-06-02 12:07:05 +00:00
cuteolaf 0a62a31eff pallet-uniques: remove #[transactional] macro for buy_item (#14277)
* remove #[transactional] macro for buy_item

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
2023-06-02 02:15:49 +01:00
Aten Jin b09017ca5e print error info for database error (#14248) 2023-06-02 00:45:48 +01:00
Gavin Wood feb0f45d21 Runtime: Add common morph utility types (#14281) 2023-06-01 17:11:53 +01:00
Alexandru Vasile 0910390b25 frame/support: Link call documentation only in prod-modes (#14283)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-01 16:08:25 +00:00
Michal Kucharczyk dc7161276d frame: support for serde added (#14261)
* 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: Bastian Köcher <git@kchr.de>

* fix

* Cargo.lock update + missed serde/std in beefy

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-01 15:35:34 +00:00
Bastian Köcher 372708d7a2 sp-api: Make the generated code act based on std in sp-api (#14267)
* sp-api: Make the generated code act based on `std` in `sp-api`

Instead of letting the macro generate code that checks if the `std` feature is enabled, it will now
generate code that checks if the `std` feature is enabled for the `sp-api` crate. The old
implementation basically required that the crate in which the macro was used, had a `std` feature.
Now we don't have this requirement anymore and act accordingly the feature in `sp-api` directly.

* Missing feature!

---------

Co-authored-by: parity-processbot <>
2023-06-01 15:29:32 +01:00
Dmitry Markin 186423b695 Reduce logging verbosity when disconnecting an unknown peer (#14274) 2023-06-01 12:53:52 +03:00
Gavin Wood cea8f9d56f FRAME: Introduce ConvertToValue adapter (#14270) 2023-06-01 10:01:55 +01:00
dependabot[bot] 688ac3d1c7 Bump serde from 1.0.162 to 1.0.163 (#14271)
* Bump serde from 1.0.162 to 1.0.163

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.162 to 1.0.163.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.162...v1.0.163)

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

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

* bump ci

* bump ci for cumulus

* bump ci again

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
2023-05-31 17:10:00 +00:00
Liu-Cheng Xu 968795db28 Expose build_system_rpc_future and TransactionPoolAdapator in sc-service (#14238)
* Make block sync service customizable

This change allows user to have their own network block logic, for example, we'd like to disable
the builtin block sync service when using another syncing approach.

* Remove unnecessary Box

* Revert network_block

* Expose build_system_rpc_future() and TransactionPoolAdaptor

* fmt
2023-05-31 15:27:06 +01:00
PG Herveou c7c5fc709c contracts: Multi block migrations (#14045)
* Frame Add translate_next

This works similarly to to `translate` but only translate a single entry.
This function will be useful in the context of multi-block migration.

* Move to lazy migration

* Updates

* simplify MockMigration

* wip

* wip

* add bench

* add bench

* fmt

* fix bench

* add .

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* Apply suggestions from code review

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

* Scalfold v10 / v11 fix tests

* PR comment

* tweak pub use

* wip

* wip

* wip

* misc merge master

* misc merge master

* wip

* rm tmp stuff

* wip

* wip

* wip

* wip

* wip

* fixes

* add state

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* fixed compilation

* clean up logs

* wip

* Revert "Frame Add translate_next"

This reverts commit 10318fc95c42b1f7f25efeb35e6d947ea02bed88.

* Fix v10 logic

* Apply suggestions from code review

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

* wip

* fixes

* exercise del_queue

* bump sample size

* fmt

* wip

* blank line

* fix lint

* fix rustdoc job lint

* PR comment do not use dangerous into()

* Ad macros for updating mod visibility

* Add doc

* Add max_weight to integrity_test

* fix compilation

* Add no migration tests

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* fix clippy

* PR review

* Update frame/contracts/src/lib.rs

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>

* Fix master merge

* fix merge 2

* fix tryruntime

* fix lint

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: command-bot <>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
2023-05-31 14:19:31 +00:00
Adrian Catangiu b43a1b0b55 pallet-beefy-mmr: fix when using custom hashing (#14273)
`Hash` is no longer part of `pallet_mmr::Config`, but this code
would still build because it assumes we're referring to underlying
`<pallet_mmr::Config as frame_system::Config>::Hash` which is not
what we want when using different hashing between `frame_system`
and `pallet_mmr`.

Disambiguate by using correct `pallet_mmr::Config::Hashing` type.

Signed-off-by: acatangiu <adrian@parity.io>
2023-05-31 17:15:05 +03:00
Alexandru Vasile 3da9449067 Bump sp-crates from latest crates.io version + release (#14265)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-31 12:11:01 +00:00
Bastian Köcher 01c1c14687 Remove enum-as-inner pin (#14266)
* Remove `enum-as-inner` pin

The faulty version was yanked from crates.io.

* :face_palm:
2023-05-31 09:34:57 +00:00
Bastian Köcher 00e5ecdcf7 Make offchain tx pool creation reusable (#14230)
* Make offchain tx pool creation reusable

Introduces an `OffchainTransactionPoolFactory` for creating offchain transactions pools that can be
registered in the runtime externalities context. This factory will be required for a later pr to
make the creation of offchain transaction pools easier.

* Update client/transaction-pool/api/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

---------

Co-authored-by: Anton <anton.kalyaev@gmail.com>
2023-05-31 01:12:53 +00:00
Michal Kucharczyk e7e13116f7 app_crypto: macro improvements (#14263)
* app_crypto: macro improvements

During `app_crypto`  macro expansion the `cfg` feature gate was injected
  into the macro client crate. This resulted in compilation error if
`serde` or `std` was not defined in client crate. This PR fixes this
problem.

For reference, the error was:

```
  error: cannot find macro `format` in this scope
    --> /home/miszka/parity/10-genesis-config/substrate-2/primitives/consensus/aura/src/lib.rs:32:3
     |
  32 |         app_crypto!(sr25519, AURA);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
...

  error[E0433]: failed to resolve: use of undeclared type `String`
    -->
/home/miszka/parity/10-genesis-config/substrate-2/primitives/consensus/aura/src/lib.rs:32:3
     |
  32 |         app_crypto!(sr25519, AURA);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `String`
```

* app_crypto: cleanup
2023-05-30 12:15:13 +00:00
Kian Paimani 263a5d6c1e Default Pallet Config Trait / derive_impl (#13454)
* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/procedural/src/derive_impl.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* 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: Bastian Köcher <git@kchr.de>

* use explicit macro_magic::use_attr

Co-authored-by: Bastian Köcher <git@kchr.de>

* remove unneeded {}

Co-authored-by: Bastian Köcher <git@kchr.de>

* remove unneeded collect

Co-authored-by: Bastian Köcher <git@kchr.de>

* add docs for TestDefaultConfig

* remove unneeded `#[export_tokens]` on `DefaultConfig`

* add docs for auto-generated `DefaultConfig`

* no need to clone

Co-authored-by: Bastian Köcher <git@kchr.de>

* clean up combine_impls + compiling again

* remove unused dependency

* simplify struct definition

Co-authored-by: Bastian Köcher <git@kchr.de>

* fix register_default_impl docs

* reduce rightward drift / refactor

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

* fix derive_impl after keith's changes

* simplify disambiguation_path calculation

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

* compiling again

* simplify parsing of trait item

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

* rename preludes => prelude

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

* fix other places where we used preludes instead of prelude

* fix indents

* simplify PalletAttr parsing

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

* 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: Bastian Köcher <git@kchr.de>

* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* use () instead of u32 for `AccountData`

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

* use ConstU32<10> for BlockHashCount instead of ConstU64<10>

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

* people are not dummies

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* fix wording

Co-authored-by: Just van Stam <vstam1@users.noreply.github.com>

* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Just van Stam <vstam1@users.noreply.github.com>
2023-05-30 08:06:40 +00:00
dependabot[bot] a8edaf47d5 Bump quote from 1.0.27 to 1.0.28 (#14253)
* Bump quote from 1.0.27 to 1.0.28

Bumps [quote](https://github.com/dtolnay/quote) from 1.0.27 to 1.0.28.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28)

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

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

* bump ci

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
2023-05-29 18:13:48 +00:00
Dmitry Markin d4b2bf7394 Incorporate sc-peerset into sc-network (#14236) 2023-05-29 20:56:57 +03:00
Kian Paimani b8bca85e9d Improve documentation for fast-unstake pallet (#14101)
* improve documentation of fast-unstake pallet

* using Sam's crate now

* fix

* remove stuff not needed

* Some updates

* use new prelude.

* update

* some other fancy docs

* Update frame/fast-unstake/src/lib.rs

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Update frame/support/procedural/src/pallet/expand/mod.rs

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* update

* Update frame/fast-unstake/src/lib.rs

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

* update

* fix no_std issue by updating to latest version of docify

* get things compiling by adding a use for StakingInterface

* fix docify paths to their proper values, still not working because bug

* embed working 🎉

* update syn

* upgrade to docify v0.1.10 for some fixes

* Apply suggestions from code review

Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* improve docs

* Update frame/support/procedural/src/pallet/expand/doc_only.rs

Co-authored-by: Juan <juangirini@gmail.com>

* fmt

* fix

* Update frame/support/procedural/src/pallet/expand/doc_only.rs

Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>

* Update frame/support/procedural/src/pallet/expand/config.rs

Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>

* Update frame/support/procedural/src/pallet/expand/config.rs

Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>

* remove redundant

* update docify rev

* update.

* update.

* update lock file

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
Co-authored-by: parity-processbot <>
2023-05-29 17:44:42 +00:00
Jegor Sidorenko 50cf22b0bb [NFTs] Add mint price to the witness object on mint and confirm it (#14257)
* Add mint price to the witness object on mint and confirm it

* Chore

* Put the new error to the bottom

* Update frame/nfts/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2023-05-29 16:59:43 +00:00
Michal Kucharczyk f602db2d96 bounded-collections bump to 0.1.7 (#14255) 2023-05-29 16:52:03 +00:00
Gavin Wood 52ab7698e4 FRAME: Pay trait benchmark helper should use asset kind (#14259)
* Fix Pay benchmarking helpers

* Formatting
2023-05-29 16:36:00 +01:00
Michal Kucharczyk a673b7ff7c primitives: added serde feature (#14256)
serde feature added for:
- sp-statement-store
- sp-authority-discovery
2023-05-29 14:32:56 +00:00
Gavin Wood c40a4cc139 Pay trait gets Error item (#14258)
* `Pay` trait gets `Error` item

* Formatting
2023-05-29 15:29:51 +01:00
Jegor Sidorenko cb533ffa98 [NFTs] Add minting price to the pre-signed mint object (#14242)
* Add minting price to the pre-signed mint object

* Box the param
2023-05-29 11:00:00 +00:00
Alexandru Vasile 98a0550ea2 Release: Bump SP crates to release on crates.io (#14237)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-29 10:40:59 +00:00
Qinxuan Chen c45eeb5498 sp-wasm-interface: remove useless wasmi impl (#14208)
Co-authored-by: parity-processbot <>
2023-05-29 10:32:24 +00:00
Bastian Köcher 797e8c08bc sp-api: Set correct where bound in the generated code (#14252)
The where bound for the `create_metadata` function wasn't correct. This pr fixes this by using the
where bound declared at the type declaration augmented with the manual where bound.
2023-05-29 10:26:38 +00:00
Dmitry Markin ee3f2e1ebd minor: fix misleading comment in Notifications (#14239) 2023-05-29 13:16:49 +03:00
dependabot[bot] 3c3105d2ae Bump proc-macro-warning from 0.3.1 to 0.4.1 (#14171)
Bumps [proc-macro-warning](https://github.com/ggwpez/proc-macro-warning) from 0.3.1 to 0.4.1.
- [Commits](https://github.com/ggwpez/proc-macro-warning/compare/v0.3.1...v0.4.1)

---
updated-dependencies:
- dependency-name: proc-macro-warning
  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>
Co-authored-by: parity-processbot <>
2023-05-29 11:45:00 +02:00
Bastian Köcher 6947b334b4 wasm-builder: Enforce runtime_version wasm section (#14228)
* wasm-builder: Enforce `runtime_version` wasm section

This pr changes the `wasm-builder` to enforce the `runtime_version` wasm section. This wasm section
is being created by the `sp_version::runtime_version` attribute macro. This attribute macro now
exists since quite some time and `runtime_version` also is the only way for parachains to support
reading the `RuntimeVersion` from the runtime.

\# Disabling the check

By default the `WasmBuilder` will now check for this wasm section and if not found, exit with an
error. However, there are situations where you may want to disable this check (like for tests). In
this case there exists the `disable_runtime_version_section_check` function.

```
WasmBuilder::new()
   ...
   ...
   ...
   .disable_runtime_version_section_check()
   .build()
```

By using this method you get back the old behavior.

* Review comment

* Fix

* Fix issue with `enum-as-inner`
2023-05-28 23:52:10 +00:00
dependabot[bot] 5402212358 Bump lru from 0.8.1 to 0.10.0 (#14211)
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.8.1 to 0.10.0.
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.8.1...0.10.0)

---
updated-dependencies:
- dependency-name: lru
  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>
2023-05-28 13:17:10 +00:00
Alexandru Vasile ed499bdec1 chain_head: Rename runtimeUpdates flag to withRuntime (#14244)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-27 22:13:00 +02:00
Gonçalo Pestana 6d120d1890 Improves documentation on num_slashing_spans when calling withdraw_unbounded in Staking. (#14185)
* gpestana/11714-num_slashing_spans_docs

* Update frame/staking/src/pallet/mod.rs

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

* All calls that take num_slashing_span as parameters refer to comments on it

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2023-05-27 14:46:07 +00:00
Alexandru Gheorghe 3320076f8a test-utils: Fix wait_for_blocks in presence of reorgs (#14215)
In the cases where a reorg happens we might receive notifications
for different blocks at the same level, so instead of the chain having
count new blocks it has less and that will break the tests which use this
function.

So, use the block number to identify that `count` blocks have been built in the
chain.

Examples where this issue was hit:
  https://github.com/paritytech/polkadot/issues/7267

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
2023-05-26 11:34:06 +00:00
Kian Paimani dca481169e add new documentation guidelines (#14115)
* add new documentation style-guides

* update CODEOWNERS as well

* try new team

* revert

* Update docs/DOCUMENTATION_GUIDELINES.md

Co-authored-by: Juan <juangirini@gmail.com>

* Update docs/DOCUMENTATION_GUIDELINES.md

Co-authored-by: Juan <juangirini@gmail.com>

* Apply suggestions from code review

Co-authored-by: Ben Greenberg <13892277+hummusonrails@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: Ben Greenberg <13892277+hummusonrails@users.noreply.github.com>

* Update docs/DOCUMENTATION_GUIDELINES.md

* Apply suggestions from code review

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Ben Greenberg <13892277+hummusonrails@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ben Greenberg <13892277+hummusonrails@users.noreply.github.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Apply suggestions from code review

Co-authored-by: Sacha Lansky <sacha@parity.io>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* Further updates.

* note about rewrap.

* update ToC and more

* update ToC and more

* Update docs/DOCUMENTATION_GUIDELINES.md

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* storage

---------

Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: Ben Greenberg <13892277+hummusonrails@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Sacha Lansky <sacha@parity.io>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
2023-05-26 11:10:43 +00:00
Juan 34b2a56af1 Soft deprecate GenesisConfig (#14210)
* 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 <>
2023-05-26 09:42:47 +00:00
dependabot[bot] de097e23fa Bump platforms from 2.0.0 to 3.0.2 (#13625)
Bumps [platforms](https://github.com/rustsec/rustsec) from 2.0.0 to 3.0.2.
- [Release notes](https://github.com/rustsec/rustsec/releases)
- [Commits](https://github.com/rustsec/rustsec/compare/platforms/v2.0.0...platforms/v3.0.2)

---
updated-dependencies:
- dependency-name: platforms
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-26 10:41:21 +02:00
Vijayendra Gaur 64aea5e7ba Add remove_proxies API for pallet-proxies #7557 (#12714)
* Open
Add remove_proxies API for pallet-proxies
#7557

* added remove_all_proxy_delegates method

* remove all proxy implementation

* remove_all_proxy_delegate

* reverted changes

* fixed 7557

* fixed warnings

* removed println! causing build failure on ci/cd pipelines

* incorporated suggested changes

* minor change

* made suggested changes

* method comment

* Update frame/proxy/src/lib.rs

---------

Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: parity-processbot <>
2023-05-26 07:48:32 +00:00