Add a basic version of the CheckMetadataHash signed extension (#1590)

* Add a basic version of the CheckMetadataHash signed extension

* update example too

* encode None to signer payload when no hash provided

* Enable decoding txs using CheckMetadataHash, too

* Tidy up decoding CheckMetadataHash
This commit is contained in:
James Wilson
2024-05-23 10:54:53 +01:00
committed by GitHub
parent 4e53d5a4d5
commit dd343be1f3
3 changed files with 60 additions and 2 deletions
@@ -37,6 +37,7 @@ impl Config for CustomConfig {
signed_extensions::CheckMortality<Self>,
signed_extensions::ChargeAssetTxPayment<Self>,
signed_extensions::ChargeTransactionPayment,
signed_extensions::CheckMetadataHash,
// And add a new one of our own:
CustomSignedExtension,
),
@@ -83,8 +84,8 @@ impl ExtrinsicParamsEncoder for CustomSignedExtension {
pub fn custom(
params: DefaultExtrinsicParamsBuilder<CustomConfig>,
) -> <<CustomConfig as Config>::ExtrinsicParams as ExtrinsicParams<CustomConfig>>::Params {
let (a, b, c, d, e, f, g) = params.build();
(a, b, c, d, e, f, g, ())
let (a, b, c, d, e, f, g, h) = params.build();
(a, b, c, d, e, f, g, h, ())
}
#[tokio::main]