@@ -5,38 +5,6 @@ use subxt::PolkadotConfig;
55
66use super :: utils;
77
8- /// Represents a decoded event from the chain
9- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
10- pub ( crate ) struct DecodedEvent {
11- /// The pallet that emitted the event
12- pub ( crate ) pallet : String ,
13- /// The event variant name
14- pub ( crate ) variant : String ,
15- /// The block number where the event occurred
16- pub ( crate ) block_number : u32 ,
17- /// The block hash where the event occurred
18- pub ( crate ) block_hash : String ,
19- /// The event index within the block
20- pub ( crate ) event_index : u32 ,
21- /// The decoded event data as JSON
22- pub ( crate ) data : serde_json:: Value ,
23- }
24-
25- /// Filter criteria for event queries
26- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
27- pub ( crate ) struct EventFilter {
28- /// Filter by pallet name (supports partial matching)
29- pub ( crate ) pallet : Option < String > ,
30- /// Filter by event variant name (supports partial matching)
31- pub ( crate ) variant : Option < String > ,
32- /// Start block number (inclusive)
33- pub ( crate ) from_block : Option < u32 > ,
34- /// End block number (inclusive)
35- pub ( crate ) to_block : Option < u32 > ,
36- /// Maximum number of events to return
37- pub ( crate ) limit : Option < usize > ,
38- }
39-
408/// Query events from blocks
419#[ derive( Debug , Clone , Serialize , Deserialize ) ]
4210pub ( crate ) struct EventsQuery {
@@ -169,7 +137,7 @@ async fn decode_events_with_subxt(
169137
170138 // Decode event data
171139 let data = match event. field_values ( ) {
172- Ok ( fields) => format ! ( "{}" , fields ) ,
140+ Ok ( fields) => format ! ( "{fields}" ) ,
173141 Err ( e) => format ! ( "Failed to decode call arguments: {e}" ) ,
174142 } ;
175143
0 commit comments