-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Derive DecodeWithMemTracking for Block
#7655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
48578f1
923490b
d14e62b
a31606e
f81b482
db8f988
e58c1c7
5215d7a
3282f2c
46ae4c4
c836733
4d87acb
9303d44
ea10f10
51d32d4
69d6769
1a7ca91
0593a4e
6c9c497
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,4 @@ crates: | |
| - name: frame-support-procedural | ||
| bump: major | ||
| - name: bridge-hub-westend-runtime | ||
| bump: none | ||
| bump: patch | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When working on the prdoc for this PR I realized that I also derived |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
| # See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
|
||
| title: derive `DecodeWithMemTracking` for `Block` | ||
|
|
||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| This PR adds `DecodeWithMemTracking` as a trait bound for `Header`, `Block` and `TransactionExtension` and | ||
| derives it for all the types that implement these traits in `polkadot-sdk`. | ||
| All the external types that implement these traits will need to implement `DecodeWithMemTracking` as well. | ||
|
|
||
| crates: | ||
| - name: sp-runtime | ||
| bump: major | ||
| - name: bp-runtime | ||
| bump: major | ||
| - name: bridge-runtime-common | ||
| bump: patch | ||
| - name: frame-support | ||
| bump: patch | ||
| - name: frame-system | ||
| bump: patch | ||
| - name: pallet-verify-signature | ||
| bump: patch | ||
| - name: pallet-transaction-payment | ||
| bump: patch | ||
| - name: pallet-sudo | ||
| bump: patch | ||
| - name: polkadot-runtime-common | ||
| bump: patch | ||
| - name: cumulus-pallet-weight-reclaim | ||
| bump: patch | ||
| - name: cumulus-primitives-storage-weight-reclaim | ||
| bump: patch | ||
| - name: frame-benchmarking-cli | ||
| bump: patch | ||
| - name: frame-metadata-hash-extension | ||
| bump: patch | ||
| - name: pallet-asset-tx-payment | ||
| bump: patch | ||
| - name: pallet-bridge-relayers | ||
| bump: patch | ||
| - name: pallet-asset-conversion-tx-payment | ||
| bump: patch | ||
| - name: pallet-revive | ||
| bump: patch | ||
| - name: pallet-skip-feeless-payment | ||
| bump: patch | ||
| - name: bp-polkadot-bulletin | ||
| bump: patch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ | |
|
|
||
| use core::{fmt, marker::PhantomData}; | ||
|
|
||
| use codec::{Decode, Encode}; | ||
| use codec::{Decode, DecodeWithMemTracking, Encode}; | ||
| use frame_support::{pallet_prelude::TransactionSource, traits::OriginTrait, Parameter}; | ||
| use scale_info::TypeInfo; | ||
| use sp_runtime::{ | ||
|
|
@@ -38,7 +38,7 @@ use sp_runtime::{ | |
| use crate::pallet_coownership::{Config, Origin}; | ||
|
|
||
| /// Helper struct to organize the data needed for signature verification of both parties involved. | ||
| #[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo)] | ||
| #[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] | ||
| pub struct AuthCredentials<Signer, Signature> { | ||
| first: (Signer, Signature), | ||
| second: (Signer, Signature), | ||
|
|
@@ -49,7 +49,7 @@ pub struct AuthCredentials<Signer, Signature> { | |
| /// data that follows this extension in the `TransactionExtension` pipeline, their implications and | ||
| /// the call. Essentially re-sign the transaction from this point onwards in the pipeline by using | ||
| /// the `inherited_implication`, as shown below. | ||
| #[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo)] | ||
| #[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] | ||
| #[scale_info(skip_type_params(T))] | ||
| pub struct AuthorizeCoownership<T, Signer, Signature> { | ||
| inner: Option<AuthCredentials<Signer, Signature>>, | ||
|
|
@@ -84,8 +84,13 @@ impl<T: Config, Signer, Signature> fmt::Debug for AuthorizeCoownership<T, Signer | |
| impl<T: Config + Send + Sync, Signer, Signature> TransactionExtension<T::RuntimeCall> | ||
| for AuthorizeCoownership<T, Signer, Signature> | ||
| where | ||
| Signer: IdentifyAccount<AccountId = T::AccountId> + Parameter + Send + Sync + 'static, | ||
| Signature: Verify<Signer = Signer> + Parameter + Send + Sync + 'static, | ||
| Signer: IdentifyAccount<AccountId = T::AccountId> | ||
| + Parameter | ||
| + DecodeWithMemTracking | ||
|
||
| + Send | ||
| + Sync | ||
| + 'static, | ||
| Signature: Verify<Signer = Signer> + Parameter + DecodeWithMemTracking + Send + Sync + 'static, | ||
| { | ||
| const IDENTIFIER: &'static str = "AuthorizeCoownership"; | ||
| type Implicit = (); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.