mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Display RawEvent data in hex (#168)
So that printing the RawEvent won't comsume more than the whole screen.
This commit is contained in:
+10
-1
@@ -52,7 +52,6 @@ use crate::{
|
||||
};
|
||||
|
||||
/// Raw bytes for an Event
|
||||
#[derive(Debug)]
|
||||
pub struct RawEvent {
|
||||
/// The name of the module from whence the Event originated
|
||||
pub module: String,
|
||||
@@ -62,6 +61,16 @@ pub struct RawEvent {
|
||||
pub data: Vec<u8>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for RawEvent {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
f.debug_struct("RawEvent")
|
||||
.field("module", &self.module)
|
||||
.field("variant", &self.variant)
|
||||
.field("data", &hex::encode(&self.data))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
/// Events decoder.
|
||||
#[derive(Debug)]
|
||||
pub struct EventsDecoder<T> {
|
||||
|
||||
Reference in New Issue
Block a user