Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/run-tests-on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
--package acropolis_module_spo_state \
--package acropolis_module_stake_delta_filter \
--package acropolis_module_tx_submitter \
--package acropolis_module_tx_unpacker \
--package acropolis_module_upstream_chain_fetcher \
--package acropolis_module_utxo_state \
--package acropolis_process_tx_submitter_cli
Expand Down
6 changes: 3 additions & 3 deletions codec/src/map_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn map_stake_address(cred: &PallasStakeCredential, network_id: NetworkId) ->
}
};

StakeAddress::new(payload, network_id.into())
StakeAddress::new(payload, network_id)
}

/// Map a Pallas DRep to our DRepChoice
Expand Down Expand Up @@ -262,7 +262,7 @@ pub fn map_certificate(
.map(|v| {
StakeAddress::new(
StakeCredential::AddrKeyHash(v.to_vec()),
network_id.clone().into(),
network_id.clone(),
)
})
.collect(),
Expand Down Expand Up @@ -382,7 +382,7 @@ pub fn map_certificate(
.map(|v| {
StakeAddress::new(
StakeCredential::AddrKeyHash(v.to_vec()),
network_id.clone().into(),
network_id.clone(),
)
})
.collect(),
Expand Down
22 changes: 11 additions & 11 deletions modules/tx_unpacker/src/tx_unpacker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl TxUnpacker {
let tx_index = tx_index as u16;

// Parse the tx
match MultiEraTx::decode(&raw_tx) {
match MultiEraTx::decode(raw_tx) {
Ok(tx) => {
let tx_hash: TxHash = tx.hash().to_vec().try_into().expect("invalid tx hash length");
let tx_identifier = TxIdentifier::new(block_number, tx_index);
Expand Down Expand Up @@ -269,7 +269,7 @@ impl TxUnpacker {

if publish_certificates_topic.is_some() {
for ( cert_index, cert) in certs.iter().enumerate() {
match map_parameters::map_certificate(&cert, tx_identifier, cert_index, network_id.clone()) {
match map_parameters::map_certificate(cert, tx_identifier, cert_index, network_id.clone()) {
Ok(tx_cert) => {
certificates.push(tx_cert);
},
Expand Down Expand Up @@ -299,7 +299,7 @@ impl TxUnpacker {
if publish_governance_procedures_topic.is_some() {
//Self::decode_legacy_updates(&mut legacy_update_proposals, &block, &raw_tx);
if block.era >= Era::Shelley && block.era < Era::Babbage {
if let Ok(alonzo) = MultiEraTx::decode_for_era(traverse::Era::Alonzo, &raw_tx) {
if let Ok(alonzo) = MultiEraTx::decode_for_era(traverse::Era::Alonzo, raw_tx) {
if let Some(update) = alonzo.update() {
if let Some(alonzo_update) = update.as_alonzo() {
Self::decode_updates(
Expand All @@ -313,7 +313,7 @@ impl TxUnpacker {
}
}
else if block.era >= Era::Babbage && block.era < Era::Conway{
if let Ok(babbage) = MultiEraTx::decode_for_era(traverse::Era::Babbage, &raw_tx) {
if let Ok(babbage) = MultiEraTx::decode_for_era(traverse::Era::Babbage, raw_tx) {
if let Some(update) = babbage.update() {
if let Some(babbage_update) = update.as_babbage() {
Self::decode_updates(
Expand Down Expand Up @@ -345,7 +345,7 @@ impl TxUnpacker {
let mut proc_id = GovActionId { transaction_id: TxHash(*tx.hash()), action_index: 0 };
for (action_index, pallas_governance_proposals) in pp.iter().enumerate() {
match proc_id.set_action_index(action_index)
.and_then (|proc_id| map_parameters::map_governance_proposals_procedures(&proc_id, &pallas_governance_proposals))
.and_then (|proc_id| map_parameters::map_governance_proposals_procedures(proc_id, pallas_governance_proposals))
{
Ok(g) => proposal_procedures.push(g),
Err(e) => error!("Cannot decode governance proposal procedure {} idx {} in slot {}: {e}", proc_id, action_index, block.slot)
Expand Down Expand Up @@ -385,7 +385,7 @@ impl TxUnpacker {
})
));

futures.push(context.message_bus.publish(&topic, Arc::new(msg)));
futures.push(context.message_bus.publish(topic, Arc::new(msg)));
}

if let Some(ref topic) = publish_asset_deltas_topic {
Expand All @@ -397,7 +397,7 @@ impl TxUnpacker {
})
));

futures.push(context.message_bus.publish(&topic, Arc::new(msg)));
futures.push(context.message_bus.publish(topic, Arc::new(msg)));
}

if let Some(ref topic) = publish_withdrawals_topic {
Expand All @@ -408,7 +408,7 @@ impl TxUnpacker {
})
));

futures.push(context.message_bus.publish(&topic, Arc::new(msg)));
futures.push(context.message_bus.publish(topic, Arc::new(msg)));
}

if let Some(ref topic) = publish_certificates_topic {
Expand All @@ -419,7 +419,7 @@ impl TxUnpacker {
})
));

futures.push(context.message_bus.publish(&topic, Arc::new(msg)));
futures.push(context.message_bus.publish(topic, Arc::new(msg)));
}

if let Some(ref topic) = publish_governance_procedures_topic {
Expand All @@ -433,7 +433,7 @@ impl TxUnpacker {
})
)));

futures.push(context.message_bus.publish(&topic,
futures.push(context.message_bus.publish(topic,
governance_msg.clone()));
}

Expand All @@ -447,7 +447,7 @@ impl TxUnpacker {
})
));

futures.push(context.message_bus.publish(&topic, Arc::new(msg)));
futures.push(context.message_bus.publish(topic, Arc::new(msg)));
}

join_all(futures)
Expand Down
2 changes: 1 addition & 1 deletion modules/tx_unpacker/src/utxo_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl UTxORegistry {
pub fn consume(&mut self, tx_ref: &TxOutRef) -> Result<TxIdentifier> {
match self.live_map.remove(tx_ref) {
Some(id) => {
self.spent.add((tx_ref.clone(), id));
self.spent.add((*tx_ref, id));
Ok(id)
}
None => Err(anyhow::anyhow!(
Expand Down