Skip to content

Commit 2da2e2e

Browse files
committed
test miner service implementation of latest changes
1 parent 8a34bbc commit 2da2e2e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crates/rpc/src/v1/tests/helpers/miner_service.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ impl MinerService for TestMinerService {
254254
.map(|tx| Arc::new(VerifiedTransaction::from_pending_block_transaction(tx)))
255255
}
256256

257+
fn transaction_if_readable(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>> {
258+
self.pending_transactions
259+
.try_lock()?
260+
.get(hash)
261+
.cloned()
262+
.map(|tx| Arc::new(VerifiedTransaction::from_pending_block_transaction(tx)))
263+
}
264+
257265
fn remove_transaction(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>> {
258266
self.pending_transactions
259267
.lock()
@@ -401,4 +409,6 @@ impl MinerService for TestMinerService {
401409
}
402410
}
403411
}
412+
413+
404414
}

0 commit comments

Comments
 (0)