Skip to content

Commit 21f5388

Browse files
committed
Refactor: Simplify tx_unpacker by replacing redundant TxHash conversions with tx_hash
1 parent acbeb46 commit 21f5388

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/tx_unpacker/src/tx_unpacker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl TxUnpacker {
342342
if publish_governance_procedures_topic.is_some() {
343343
if let Some(pp) = props {
344344
// Nonempty set -- governance_message.proposal_procedures will not be empty
345-
let mut proc_id = GovActionId { transaction_id: TxHash::from(*tx.hash()), action_index: 0 };
345+
let mut proc_id = GovActionId { transaction_id: tx_hash, action_index: 0 };
346346
for (action_index, pallas_governance_proposals) in pp.iter().enumerate() {
347347
match proc_id.set_action_index(action_index)
348348
.and_then (|proc_id| map_parameters::map_governance_proposals_procedures(proc_id, pallas_governance_proposals))
@@ -356,7 +356,7 @@ impl TxUnpacker {
356356
if let Some(pallas_vp) = votes {
357357
// Nonempty set -- governance_message.voting_procedures will not be empty
358358
match map_parameters::map_all_governance_voting_procedures(pallas_vp) {
359-
Ok(vp) => voting_procedures.push((TxHash::from(*tx.hash()), vp)),
359+
Ok(vp) => voting_procedures.push((tx_hash, vp)),
360360
Err(e) => error!("Cannot decode governance voting procedures in slot {}: {e}", block.slot)
361361
}
362362
}

0 commit comments

Comments
 (0)