Merge pull request #1294 from gakonst/fix/self-instead-of-service

fix(eth1/service): use self instead of Service
This commit is contained in:
Paul Hauner
2020-06-29 10:18:36 +10:00
committed by GitHub
3 changed files with 84 additions and 77 deletions

View File

@@ -145,14 +145,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");
@@ -205,10 +208,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");
@@ -250,10 +255,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");
}
@@ -293,15 +300,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");
}
@@ -346,11 +350,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");
@@ -420,8 +426,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");
@@ -661,7 +667,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");
@@ -728,7 +735,8 @@ mod persist {
.expect("should perform a deposit");
}
Service::update_deposit_cache(service.clone())
service
.update_deposit_cache()
.await
.expect("should perform update");
@@ -739,7 +747,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");