From 481780974a5938959e95cc9138d8420394ff6305 Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Mon, 1 Aug 2022 22:10:42 -0300 Subject: [PATCH 1/2] fix: Fix JSON serialization of genesis key delegation --- src/mapper/map.rs | 3 +-- src/model.rs | 2 +- src/sinks/terminal/format.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mapper/map.rs b/src/mapper/map.rs index 25ca0f52..9c5dc677 100644 --- a/src/mapper/map.rs +++ b/src/mapper/map.rs @@ -358,9 +358,8 @@ impl EventWriter { }, } } - // TODO: not likely, leaving for later - Certificate::GenesisKeyDelegation(..) => EventData::GenesisKeyDelegation, + Certificate::GenesisKeyDelegation(..) => EventData::GenesisKeyDelegation {}, } } diff --git a/src/model.rs b/src/model.rs index 10199312..4168a429 100644 --- a/src/model.rs +++ b/src/model.rs @@ -338,7 +338,7 @@ pub enum EventData { pool: String, epoch: u64, }, - GenesisKeyDelegation, + GenesisKeyDelegation {}, MoveInstantaneousRewardsCert { from_reserves: bool, from_treasury: bool, diff --git a/src/sinks/terminal/format.rs b/src/sinks/terminal/format.rs index 848cee4d..e513b71e 100644 --- a/src/sinks/terminal/format.rs +++ b/src/sinks/terminal/format.rs @@ -266,7 +266,7 @@ impl LogLine { source, max_width, }, - EventData::GenesisKeyDelegation => LogLine { + EventData::GenesisKeyDelegation { } => LogLine { prefix: "GENESIS", color: Color::Magenta, content: "{{ ... }}".to_string(), From 656c3d8ba8119ce5abd2eeec9b8b508d8dab301e Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Mon, 1 Aug 2022 22:15:41 -0300 Subject: [PATCH 2/2] Fix missing change --- src/filters/fingerprint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters/fingerprint.rs b/src/filters/fingerprint.rs index b3d18a56..291d6bdd 100644 --- a/src/filters/fingerprint.rs +++ b/src/filters/fingerprint.rs @@ -204,7 +204,7 @@ fn build_fingerprint(event: &Event, seed: u32) -> Result { .with_prefix("reti") .append_optional(&event.context.tx_hash)? .append_optional_to_string(&event.context.certificate_idx)?, - EventData::GenesisKeyDelegation => b + EventData::GenesisKeyDelegation { .. } => b .with_slot(&event.context.slot) .with_prefix("gene") .append_optional(&event.context.tx_hash)?