Support decoding signed extensions (#1209)

* skeleton commit

* signed extension decoding

* fix some minor things

* make api more similar to Extrinsics

* defer decoding of signed extensions

* fix byte slices

* add test for nonce signed extension

* adjust test and extend for tip

* clippy

* support both  ChargeTransactionPayment and ChargeAssetTxPayment

* address PR comments

* Extend lifetimes, expose pub structs, remove as_type

* add signed extensions to block subscribing example

* make example less ugly

---------

Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
Tadeo Hepperle
2023-10-31 10:40:23 +01:00
committed by GitHub
parent e53df87e72
commit 1b88ebf78e
4 changed files with 294 additions and 43 deletions
+10
View File
@@ -48,6 +48,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!(" {pallet_name}_{event_name}");
println!(" {}", event_values);
}
println!(" Signed Extensions:");
if let Some(signed_extensions) = ext.signed_extensions() {
for signed_extension in signed_extensions.iter() {
let signed_extension = signed_extension?;
let name = signed_extension.name();
let value = signed_extension.value()?.to_string();
println!(" {name}: {value}");
}
}
}
}