Fix validator contract syncing (#4789) (#5011)

* make validator set aware of various states

* fix updater build

* clean up contract call

* failing sync test

* adjust tests

* nicer indent [ci skip]

* revert bound divisor
This commit is contained in:
keorn
2017-03-23 19:39:51 +00:00
committed by Arkadiy Paronyan
parent 1164193019
commit c1da49bbc4
15 changed files with 259 additions and 178 deletions

View File

@@ -247,7 +247,7 @@ impl Updater {
if let Some(ops_addr) = self.client.upgrade().and_then(|c| c.registry_address("operations".into())) {
trace!(target: "updater", "Found operations at {}", ops_addr);
let client = self.client.clone();
*self.operations.lock() = Some(Operations::new(ops_addr, move |a, d| client.upgrade().ok_or("No client!".into()).and_then(|c| c.call_contract(a, d))));
*self.operations.lock() = Some(Operations::new(ops_addr, move |a, d| client.upgrade().ok_or("No client!".into()).and_then(|c| c.call_contract(BlockId::Latest, a, d))));
} else {
// No Operations contract - bail.
return;
@@ -340,7 +340,7 @@ impl fetch::urlhint::ContractClient for Updater {
fn call(&self, address: Address, data: Bytes) -> Result<Bytes, String> {
self.client.upgrade().ok_or_else(|| "Client not available".to_owned())?
.call_contract(address, data)
.call_contract(BlockId::Latest, address, data)
}
}