mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
test(eth1/service): make tests use references
This commit is contained in:
@@ -143,14 +143,17 @@ mod eth1_cache {
|
||||
eth1.ganache.evm_mine().await.expect("should mine block");
|
||||
}
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should update deposit cache");
|
||||
Service::update_block_cache(service.clone())
|
||||
service
|
||||
.update_block_cache()
|
||||
.await
|
||||
.expect("should update block cache");
|
||||
|
||||
Service::update_block_cache(service.clone())
|
||||
service
|
||||
.update_block_cache()
|
||||
.await
|
||||
.expect("should update cache when nothing has changed");
|
||||
|
||||
@@ -202,10 +205,12 @@ mod eth1_cache {
|
||||
eth1.ganache.evm_mine().await.expect("should mine block")
|
||||
}
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should update deposit cache");
|
||||
Service::update_block_cache(service.clone())
|
||||
service
|
||||
.update_block_cache()
|
||||
.await
|
||||
.expect("should update block cache");
|
||||
|
||||
@@ -246,10 +251,12 @@ mod eth1_cache {
|
||||
for _ in 0..cache_len / 2 {
|
||||
eth1.ganache.evm_mine().await.expect("should mine block")
|
||||
}
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should update deposit cache");
|
||||
Service::update_block_cache(service.clone())
|
||||
service
|
||||
.update_block_cache()
|
||||
.await
|
||||
.expect("should update block cache");
|
||||
}
|
||||
@@ -288,15 +295,12 @@ mod eth1_cache {
|
||||
eth1.ganache.evm_mine().await.expect("should mine block")
|
||||
}
|
||||
futures::try_join!(
|
||||
Service::update_deposit_cache(service.clone()),
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service.update_deposit_cache(),
|
||||
service.update_deposit_cache()
|
||||
)
|
||||
.expect("should perform two simultaneous updates of deposit cache");
|
||||
futures::try_join!(
|
||||
Service::update_block_cache(service.clone()),
|
||||
Service::update_block_cache(service.clone())
|
||||
)
|
||||
.expect("should perform two simultaneous updates of block cache");
|
||||
futures::try_join!(service.update_block_cache(), service.update_block_cache())
|
||||
.expect("should perform two simultaneous updates of block cache");
|
||||
|
||||
assert!(service.block_cache_len() >= n, "should grow the cache");
|
||||
}
|
||||
@@ -340,11 +344,13 @@ mod deposit_tree {
|
||||
.expect("should perform a deposit");
|
||||
}
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should perform update");
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should perform update when nothing has changed");
|
||||
|
||||
@@ -413,8 +419,8 @@ mod deposit_tree {
|
||||
}
|
||||
|
||||
futures::try_join!(
|
||||
Service::update_deposit_cache(service.clone()),
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service.update_deposit_cache(),
|
||||
service.update_deposit_cache()
|
||||
)
|
||||
.expect("should perform two updates concurrently");
|
||||
|
||||
@@ -651,7 +657,8 @@ mod fast {
|
||||
eth1.ganache.evm_mine().await.expect("should mine block");
|
||||
}
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should perform update");
|
||||
|
||||
@@ -718,7 +725,8 @@ mod persist {
|
||||
.expect("should perform a deposit");
|
||||
}
|
||||
|
||||
Service::update_deposit_cache(service.clone())
|
||||
service
|
||||
.update_deposit_cache()
|
||||
.await
|
||||
.expect("should perform update");
|
||||
|
||||
@@ -729,7 +737,8 @@ mod persist {
|
||||
|
||||
let deposit_count = service.deposit_cache_len();
|
||||
|
||||
Service::update_block_cache(service.clone())
|
||||
service
|
||||
.update_block_cache()
|
||||
.await
|
||||
.expect("should perform update");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user