remove as_pallet_extrinsic and as_pallet_event (#953)

This commit is contained in:
James Wilson
2023-05-12 17:12:47 +01:00
committed by GitHub
parent 6087dc0002
commit 13b2943c08
4 changed files with 11 additions and 124 deletions
-13
View File
@@ -35,19 +35,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
// Or we can attempt to decode them into a specific arbitraty pallet enum
// (We could also set the output type to Value to dynamically decode, here):
println!("Event details for Balances pallet:");
for event in events.iter() {
let event = event?;
if let Ok(ev) = event.as_pallet_event::<polkadot::balances::Event>() {
println!("{ev:?}");
} else {
continue;
}
}
// Or we can look for specific events which match our statically defined ones:
let transfer_event = events.find_first::<polkadot::balances::events::Transfer>()?;
if let Some(ev) = transfer_event {