diff --git a/src/accountant_skel.rs b/src/accountant_skel.rs index 1d213cb731..c08e86620d 100644 --- a/src/accountant_skel.rs +++ b/src/accountant_skel.rs @@ -43,7 +43,6 @@ pub struct AccountantSkel { pub enum Request { Transaction(Transaction), GetBalance { key: PublicKey }, - GetLastId, Subscribe { subscriptions: Vec }, } @@ -75,7 +74,6 @@ type SharedSkel = Arc; pub enum Response { Balance { key: PublicKey, val: Option }, EntryInfo(EntryInfo), - LastId { id: Hash }, } impl AccountantSkel { @@ -216,12 +214,6 @@ impl AccountantSkel { let val = self.acc.lock().unwrap().get_balance(&key); Some((Response::Balance { key, val }, rsp_addr)) } - Request::GetLastId => Some(( - Response::LastId { - id: self.acc.lock().unwrap().last_id(), - }, - rsp_addr, - )), Request::Transaction(_) => unreachable!(), Request::Subscribe { subscriptions } => { for subscription in subscriptions { diff --git a/src/accountant_stub.rs b/src/accountant_stub.rs index b782c614e7..48ba9c5c17 100644 --- a/src/accountant_stub.rs +++ b/src/accountant_stub.rs @@ -57,9 +57,6 @@ impl AccountantStub { Response::Balance { key, val } => { self.balances.insert(key, val); } - Response::LastId { id } => { - self.last_id = Some(id); - } Response::EntryInfo(entry_info) => { self.last_id = Some(entry_info.id); self.num_events += entry_info.num_events; @@ -111,15 +108,10 @@ impl AccountantStub { /// Request the last Entry ID from the server. This method blocks /// until the server sends a response. pub fn get_last_id(&mut self) -> FutureResult { - let req = Request::GetLastId; - let data = serialize(&req).expect("serialize GetId"); - self.socket - .send_to(&data, &self.addr) - .expect("buffer error"); let mut done = false; while !done { let resp = self.recv_response().expect("recv response"); - if let &Response::LastId { .. } = &resp { + if let &Response::EntryInfo { .. } = &resp { done = true; } self.process_response(resp);