mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
declone and close the door (#12035)
* declone and close the door * cargo fmt * remove brackets
This commit is contained in:
@@ -387,7 +387,7 @@ fn should_push_watchers_during_maintenance() {
|
||||
let header_hash = header.hash();
|
||||
block_on(pool.maintain(block_event(header)));
|
||||
|
||||
let event = ChainEvent::Finalized { hash: header_hash.clone(), tree_route: Arc::from(vec![]) };
|
||||
let event = ChainEvent::Finalized { hash: header_hash, tree_route: Arc::from(vec![]) };
|
||||
block_on(pool.maintain(event));
|
||||
|
||||
// then
|
||||
@@ -398,24 +398,24 @@ fn should_push_watchers_during_maintenance() {
|
||||
futures::executor::block_on_stream(watcher0).collect::<Vec<_>>(),
|
||||
vec![
|
||||
TransactionStatus::Ready,
|
||||
TransactionStatus::InBlock(header_hash.clone()),
|
||||
TransactionStatus::Finalized(header_hash.clone())
|
||||
TransactionStatus::InBlock(header_hash),
|
||||
TransactionStatus::Finalized(header_hash)
|
||||
],
|
||||
);
|
||||
assert_eq!(
|
||||
futures::executor::block_on_stream(watcher1).collect::<Vec<_>>(),
|
||||
vec![
|
||||
TransactionStatus::Ready,
|
||||
TransactionStatus::InBlock(header_hash.clone()),
|
||||
TransactionStatus::Finalized(header_hash.clone())
|
||||
TransactionStatus::InBlock(header_hash),
|
||||
TransactionStatus::Finalized(header_hash)
|
||||
],
|
||||
);
|
||||
assert_eq!(
|
||||
futures::executor::block_on_stream(watcher2).collect::<Vec<_>>(),
|
||||
vec![
|
||||
TransactionStatus::Ready,
|
||||
TransactionStatus::InBlock(header_hash.clone()),
|
||||
TransactionStatus::Finalized(header_hash.clone())
|
||||
TransactionStatus::InBlock(header_hash),
|
||||
TransactionStatus::Finalized(header_hash)
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -573,7 +573,7 @@ fn fork_aware_finalization() {
|
||||
for (canon_watcher, h) in canon_watchers {
|
||||
let mut stream = futures::executor::block_on_stream(canon_watcher);
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(h.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(h)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(h)));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
@@ -581,22 +581,22 @@ fn fork_aware_finalization() {
|
||||
{
|
||||
let mut stream = futures::executor::block_on_stream(from_dave_watcher);
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(c2.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(c2)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Retracted(c2)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(e1)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(e1.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(e1)));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
|
||||
{
|
||||
let mut stream = futures::executor::block_on_stream(from_bob_watcher);
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(d2.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(d2)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Retracted(d2)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(e1)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(e1.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(e1)));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
}
|
||||
@@ -646,9 +646,9 @@ fn prune_and_retract_tx_at_same_time() {
|
||||
{
|
||||
let mut stream = futures::executor::block_on_stream(watcher);
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Ready));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(b1.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(b1)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Retracted(b1)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(b2.clone())));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::InBlock(b2)));
|
||||
assert_eq!(stream.next(), Some(TransactionStatus::Finalized(b2)));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
@@ -781,7 +781,7 @@ fn resubmit_from_retracted_fork() {
|
||||
let e1 = {
|
||||
let _ = block_on(pool.submit_and_watch(&BlockId::number(1), SOURCE, tx4.clone()))
|
||||
.expect("1. Imported");
|
||||
let header = pool.api().push_block_with_parent(d1.clone(), vec![tx4.clone()], true);
|
||||
let header = pool.api().push_block_with_parent(d1, vec![tx4.clone()], true);
|
||||
assert_eq!(pool.status().ready, 2);
|
||||
header.hash()
|
||||
};
|
||||
@@ -790,7 +790,7 @@ fn resubmit_from_retracted_fork() {
|
||||
let f1_header = {
|
||||
let _ = block_on(pool.submit_and_watch(&BlockId::number(1), SOURCE, tx5.clone()))
|
||||
.expect("1. Imported");
|
||||
let header = pool.api().push_block_with_parent(e1.clone(), vec![tx5.clone()], true);
|
||||
let header = pool.api().push_block_with_parent(e1, vec![tx5.clone()], true);
|
||||
// Don't announce the block event to the pool directly, because we will
|
||||
// re-org to this block.
|
||||
assert_eq!(pool.status().ready, 3);
|
||||
|
||||
Reference in New Issue
Block a user