Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Feb 20, 2025
1 parent 91a4058 commit ab913b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,8 @@ impl BlockTemplateRepository {
pub async fn save_final_block_template_if_key_unique(&self, block_template: FinalBlockTemplateData) {
let merge_mining_hash = block_template.aux_chain_mr.to_vec();
let mut b = self.blocks.write().await;
b.entry(merge_mining_hash).or_insert_with(|| {
// trace!(
// target: LOG_TARGET,
// "Saving final block template with merge mining hash: {:?}",
// hex::encode(&merge_mining_hash)
// );
BlockRepositoryItem::new(block_template)
});
b.entry(merge_mining_hash)
.or_insert_with(|| BlockRepositoryItem::new(block_template));
}

/// Store [NewBlockTemplate] at the hash value if the key does not exist.
Expand Down Expand Up @@ -359,10 +353,9 @@ pub mod test {
let hash2 = vec![2; 32];
let hash3 = vec![3; 32];
let block_template = create_block_template_data();
btr.save_final_block_template_if_key_unique(hash1.clone(), block_template.clone())
.await;
btr.save_final_block_template_if_key_unique(hash2.clone(), block_template)
btr.save_final_block_template_if_key_unique(block_template.clone())
.await;
btr.save_final_block_template_if_key_unique(block_template).await;
assert!(btr.get_final_template(hash1.clone()).await.is_some());
assert!(btr.get_final_template(hash2.clone()).await.is_some());
assert!(btr.get_final_template(hash3.clone()).await.is_none());
Expand Down
18 changes: 1 addition & 17 deletions applications/minotari_merge_mining_proxy/src/proxy/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,8 @@ impl InnerService {
details: "get_tip_info failed".to_string(),
}
})?;
let height = result
.get_ref()
.metadata
.as_ref()
.map(|meta| meta.best_block_height)
.ok_or(MmProxyError::GrpcResponseMissingField("base node metadata"))?;
}
// if result.get_ref().initial_sync_achieved != self.initial_sync_achieved.load(Ordering::SeqCst) {
// self.initial_sync_achieved
// .store(result.get_ref().initial_sync_achieved, Ordering::SeqCst);
// debug!(
// target: LOG_TARGET,
// "Minotari base node initial sync status change to {}",
// result.get_ref().initial_sync_achieved
// );
// }

info!(
info!(
target: LOG_TARGET,
"Monero height = #{}, Minotari base node height = #{}, P2pool height: #{}", monero_height, base_node_height, p2pool_height
);
Expand Down

0 comments on commit ab913b2

Please sign in to comment.