stable futures fixes (#1124)

* Fix eth1 update functions

* Fix genesis and client

* Fix beacon node lib

* Return appropriate runtimes from environment

* Fix test rig

* Refactor eth1 service update
This commit is contained in:
Pawan Dhananjay
2020-05-10 15:25:06 +05:30
committed by GitHub
parent 4617db64fa
commit addde163c4
9 changed files with 223 additions and 228 deletions

View File

@@ -143,17 +143,14 @@ mod eth1_cache {
eth1.ganache.evm_mine().await.expect("should mine block");
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should update deposit cache");
service
.update_block_cache()
Service::update_block_cache(service.clone())
.await
.expect("should update block cache");
service
.update_block_cache()
Service::update_block_cache(service.clone())
.await
.expect("should update cache when nothing has changed");
@@ -205,12 +202,10 @@ mod eth1_cache {
eth1.ganache.evm_mine().await.expect("should mine block")
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should update deposit cache");
service
.update_block_cache()
Service::update_block_cache(service.clone())
.await
.expect("should update block cache");
@@ -251,12 +246,10 @@ mod eth1_cache {
for _ in 0..cache_len / 2 {
eth1.ganache.evm_mine().await.expect("should mine block")
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should update deposit cache");
service
.update_block_cache()
Service::update_block_cache(service.clone())
.await
.expect("should update block cache");
}
@@ -295,12 +288,15 @@ mod eth1_cache {
eth1.ganache.evm_mine().await.expect("should mine block")
}
futures::try_join!(
service.update_deposit_cache(),
service.update_deposit_cache()
Service::update_deposit_cache(service.clone()),
Service::update_deposit_cache(service.clone())
)
.expect("should perform two simultaneous updates of deposit cache");
futures::try_join!(service.update_block_cache(), service.update_block_cache())
.expect("should perform two simultaneous updates of block 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");
assert!(service.block_cache_len() >= n, "should grow the cache");
}
@@ -344,13 +340,11 @@ mod deposit_tree {
.expect("should perform a deposit");
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should perform update");
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should perform update when nothing has changed");
@@ -419,8 +413,8 @@ mod deposit_tree {
}
futures::try_join!(
service.update_deposit_cache(),
service.update_deposit_cache()
Service::update_deposit_cache(service.clone()),
Service::update_deposit_cache(service.clone())
)
.expect("should perform two updates concurrently");
@@ -657,8 +651,7 @@ mod fast {
eth1.ganache.evm_mine().await.expect("should mine block");
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should perform update");
@@ -725,8 +718,7 @@ mod persist {
.expect("should perform a deposit");
}
service
.update_deposit_cache()
Service::update_deposit_cache(service.clone())
.await
.expect("should perform update");
@@ -737,8 +729,7 @@ mod persist {
let deposit_count = service.deposit_cache_len();
service
.update_block_cache()
Service::update_block_cache(service.clone())
.await
.expect("should perform update");