From 124f6e83d2e8e0b733939cfb632b2b89e0ee6f67 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 13 Aug 2018 12:52:37 -0600 Subject: [PATCH] Rpc get last id endpoint --- src/rpc.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rpc.rs b/src/rpc.rs index 69e546f992..29b23ba346 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -37,6 +37,9 @@ build_rpc_trait! { #[rpc(meta, name = "solana_getBalance")] fn get_balance(&self, Self::Metadata, String) -> Result; + #[rpc(meta, name = "solana_getLastId")] + fn get_last_id(&self, Self::Metadata) -> Result; + #[rpc(meta, name = "solana_getTransactionCount")] fn get_transaction_count(&self, Self::Metadata) -> Result; @@ -92,6 +95,11 @@ impl RpcSol for RpcSolImpl { } } } + fn get_last_id(&self, meta: Self::Metadata) -> Result { + let mut client = mk_client(&meta.leader.unwrap()); + let last_id = client.get_last_id(); + Ok(bs58::encode(last_id).into_string()) + } fn get_transaction_count(&self, meta: Self::Metadata) -> Result { let mut client = mk_client(&meta.leader.unwrap()); let tx_count = client.transaction_count();