Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit e88c522

Browse files
committed
Fix test assertions relying on metadata
1 parent 7e1f4cd commit e88c522

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

crates/op-rbuilder/src/tests/framework/instance.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,24 +448,23 @@ impl FlashblocksListener {
448448

449449
/// Check if any flashblock contains the given transaction hash
450450
pub fn contains_transaction(&self, tx_hash: &B256) -> bool {
451-
let tx_hash_str = format!("{tx_hash:#x}");
452451
self.flashblocks.lock().iter().any(|fb| {
453-
if let Some(receipts) = fb.metadata.get("receipts")
454-
&& let Some(receipts_obj) = receipts.as_object()
455-
{
456-
return receipts_obj.contains_key(&tx_hash_str);
457-
}
458-
false
452+
fb.diff
453+
.transactions
454+
.iter()
455+
.any(|tx| keccak256(tx) == *tx_hash)
459456
})
460457
}
461458

462459
/// Find which flashblock index contains the given transaction hash
463460
pub fn find_transaction_flashblock(&self, tx_hash: &B256) -> Option<u64> {
464-
let tx_hash_str = format!("{tx_hash:#x}");
465461
self.flashblocks.lock().iter().find_map(|fb| {
466-
if let Some(receipts) = fb.metadata.get("receipts")
467-
&& let Some(receipts_obj) = receipts.as_object()
468-
&& receipts_obj.contains_key(&tx_hash_str)
462+
if fb
463+
.diff
464+
.transactions
465+
.iter()
466+
.find(|tx| keccak256(tx) == *tx_hash)
467+
.is_some()
469468
{
470469
return Some(fb.index);
471470
}

0 commit comments

Comments
 (0)