Companion for #8615: enrich metadata with type information (#3336)

* Use beefy branch with scale-info

* Add patches

* Sprinkle some TypeInfo derives

* Add some TypeInfo deriv

* Cargo.lock

* Derive TypeInfo and skip type params for Xcm types

* Cargo.lock

* Fix up scale_info bounds attributes

* Fix up dependencies

* Use my own beefy-primitives branch

* Bump BEEFY

* Update patches

* Add some scale-info dependencies and TypeInfo derives

* More TypeInfo decoration

* Update scale-info

* Some TypeInfos and remove more Event pallet::metadata

* Moar TypeInfos

* TypeInfos galore, fix up metadata runtime API

* TypeInfo

* TypeInfos, update other runtime metadata APIs

* Fix up Kusama, comment out some `usize` QueueSize parameter types

* Remove local diener patches

* Cargo.lock

* Cargo.lock

* Update to scale-info crates.io release

* Update primitive-types branch

* Update pallet-beefy to use custom branch

* Update other parity-common deps

* Update parity-common patches

* bump a bunch of deps in parity-common

* Remove parity-common patches

* Bump finality-grandpa version

* Cargo.lock

* Update scale-info to 0.9.1

* Add recursion_limit for runtime-parachains

* Add some scale_info attributes

* Cargo.lock

* Revert finality-grandpa bump

* Cargo.lock, scale-info update

* cargo update

* Make sure using patched version of finality-grandpa

* Use patched scale-info

* Update to scale-info 0.10.0

* Update finality-grandpa

* Cargo.lock

* Update beefy deps

* Update beefy deps again

* Add scale-info dependency

* Remove deprecated pallet::metadata attributes.

* Add some missing scale-info deps and derives

* Use some variant struct call syntax

* Add missing TypeInfo impl

* Add some more TypeInfo impls

* Convert some call enum struct variant constructors

* More scale-info deps and derives

* Call enum struct variants

* TypeInfo derives

* Call enum variant structs

* scale-info deps and derives

* Call enum variant struct constructors

* Use beefy-primitives scale-info feature

* Use grandpa-bridge-gadget master branch

* Remove finality-grandpa patch

* Add missing scale_info dependency and derive

* Fix up some call variant constructors

* Add missing scale_info dependency

* Fix some test errors

* More TypeInfo derives

* More call variant structs

* Call variant structs in tests

* Cargo.lock

* Fmt

* Fix more call struct variants

* Another call struct variant

* add scale-info/std features explicitly

* More call struct variants

* Add missing scale-info dependency

* Fmt

* review: activate scale-info/std where missing

* Remove some duplicate std feature activation

* review: add scale_info bounds() attr

* More call variant structs

* Remove recursion limit

* Update beefy-primitives

* Update beefy-primitives

* Fix simnet call variant struct errors

* Fmt

* cargo update -p beefy-primitives

* Add some missing TypeInfo derives

* Fix some call variants

* Fix some call variant underscores

* Cargo.lock

* Cargo.lock

* Add missing TypeInfo derive

* Add some more missing TypeInfo derives

* Even more missing TypeInfo derives

* Add TypeInfo derives to new xcm types

* Fmt

* Cargo.lock

* Add missing TypeInfo impls

* Cargo.lock

* More missing TypeInfos

* Fixes

* Cargo.lock

* Cargo.lock

* Add TypeInfo impls to xcm v2

* Update to scale-info 1.0

* Update finality-grandpa 0.14.4, patch for now

* Update beefy

* Remove patched finality-grandpa

* Add TypeInfo impl to Outcome

* Fixes

* Call variant struct

* Call variant struct

* Fix test

* Add TypeInfo impl

* Cargo.lock

* Cargo.lock

* Cargo.lock

* git checkout master Cargo.lock

* update Substrate

* Add missing scale-info features for beefy-primitives

* Fmt

* Remove check for now

* Update beefy-primitives, removes scale-info feature

* Update beefy-primitives again

Co-authored-by: adoerr <0xad@gmx.net>
Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Andrew Jones
2021-09-15 21:38:45 +01:00
committed by GitHub
parent 44d2e9adbd
commit 4c7539cab5
95 changed files with 819 additions and 548 deletions
+29 -19
View File
@@ -141,7 +141,7 @@ pub fn native_version() -> NativeVersion {
pub struct BaseFilter;
impl Contains<Call> for BaseFilter {
fn contains(c: &Call) -> bool {
!matches!(c, Call::Registrar(paras_registrar::Call::swap(..)))
!matches!(c, Call::Registrar(paras_registrar::Call::swap { .. }))
}
}
@@ -972,7 +972,17 @@ parameter_types! {
/// The type used to represent the kinds of proxying allowed.
#[derive(
Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen,
Copy,
Clone,
Eq,
PartialEq,
Ord,
PartialOrd,
Encode,
Decode,
RuntimeDebug,
MaxEncodedLen,
scale_info::TypeInfo,
)]
pub enum ProxyType {
Any,
@@ -997,9 +1007,9 @@ impl InstanceFilter<Call> for ProxyType {
Call::System(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(pallet_indices::Call::claim(..)) |
Call::Indices(pallet_indices::Call::free(..)) |
Call::Indices(pallet_indices::Call::freeze(..)) |
Call::Indices(pallet_indices::Call::claim {..}) |
Call::Indices(pallet_indices::Call::free {..}) |
Call::Indices(pallet_indices::Call::freeze {..}) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
@@ -1019,24 +1029,24 @@ impl InstanceFilter<Call> for ProxyType {
Call::Utility(..) |
Call::Identity(..) |
Call::Society(..) |
Call::Recovery(pallet_recovery::Call::as_recovered(..)) |
Call::Recovery(pallet_recovery::Call::vouch_recovery(..)) |
Call::Recovery(pallet_recovery::Call::claim_recovery(..)) |
Call::Recovery(pallet_recovery::Call::close_recovery(..)) |
Call::Recovery(pallet_recovery::Call::remove_recovery(..)) |
Call::Recovery(pallet_recovery::Call::cancel_recovered(..)) |
Call::Recovery(pallet_recovery::Call::as_recovered {..}) |
Call::Recovery(pallet_recovery::Call::vouch_recovery {..}) |
Call::Recovery(pallet_recovery::Call::claim_recovery {..}) |
Call::Recovery(pallet_recovery::Call::close_recovery {..}) |
Call::Recovery(pallet_recovery::Call::remove_recovery {..}) |
Call::Recovery(pallet_recovery::Call::cancel_recovered {..}) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(pallet_vesting::Call::vest(..)) |
Call::Vesting(pallet_vesting::Call::vest_other(..)) |
Call::Vesting(pallet_vesting::Call::vest {..}) |
Call::Vesting(pallet_vesting::Call::vest_other {..}) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
Call::Proxy(..) |
Call::Multisig(..) |
Call::Gilt(..) |
Call::Registrar(paras_registrar::Call::register(..)) |
Call::Registrar(paras_registrar::Call::deregister(..)) |
Call::Registrar(paras_registrar::Call::register {..}) |
Call::Registrar(paras_registrar::Call::deregister {..}) |
// Specifically omitting Registrar `swap`
Call::Registrar(paras_registrar::Call::reserve(..)) |
Call::Registrar(paras_registrar::Call::reserve {..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) // Specifically omitting the entire XCM Pallet
@@ -1054,10 +1064,10 @@ impl InstanceFilter<Call> for ProxyType {
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
Call::Identity(pallet_identity::Call::provide_judgement { .. }) | Call::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::Auction => matches!(
c,
@@ -1646,7 +1656,7 @@ sp_api::impl_runtime_apis! {
impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
Runtime::metadata().into()
OpaqueMetadata::new(Runtime::metadata().into())
}
}
+4 -4
View File
@@ -79,10 +79,10 @@ fn block_cost() {
#[ignore]
fn transfer_cost_min_multiplier() {
let min_multiplier = runtime_common::MinimumMultiplier::get();
let call = <pallet_balances::Call<Runtime>>::transfer_keep_alive(
Default::default(),
Default::default(),
);
let call = pallet_balances::Call::<Runtime>::transfer_keep_alive {
dest: Default::default(),
value: Default::default(),
};
let info = call.get_dispatch_info();
// convert to outer call.
let call = Call::Balances(call);