From db1fefe7c1a7ed79e674d7f0b108a952ba9d318a Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 6 Mar 2023 08:20:01 -0500 Subject: [PATCH] Update tendermint/node to latest substrate --- substrate/node/src/service.rs | 2 +- substrate/tendermint/client/src/tendermint.rs | 4 ++-- substrate/tendermint/client/src/validators.rs | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/substrate/node/src/service.rs b/substrate/node/src/service.rs index d4a6b4f9..24457e29 100644 --- a/substrate/node/src/service.rs +++ b/substrate/node/src/service.rs @@ -202,7 +202,7 @@ pub async fn new_full(mut config: Configuration) -> Result TendermintImport { let err = self .client .runtime_api() - .check_inherents(&BlockId::Hash(self.client.info().finalized_hash), block, inherent_data) + .check_inherents(self.client.info().finalized_hash, block, inherent_data) .map_err(|_| Error::Other(BlockError::Fatal.into()))?; if err.ok() { diff --git a/substrate/tendermint/client/src/validators.rs b/substrate/tendermint/client/src/validators.rs index d60f179e..c38b2f29 100644 --- a/substrate/tendermint/client/src/validators.rs +++ b/substrate/tendermint/client/src/validators.rs @@ -11,7 +11,7 @@ use sp_application_crypto::{ use sp_keystore::CryptoStore; use sp_staking::SessionIndex; -use sp_api::{BlockId, ProvideRuntimeApi}; +use sp_api::ProvideRuntimeApi; use sc_client_api::HeaderBackend; @@ -34,8 +34,8 @@ impl TendermintValidatorsStruct { fn from_module(client: &Arc) -> Self { let last = client.info().finalized_hash; let api = client.runtime_api(); - let session = api.current_session(&BlockId::Hash(last)).unwrap(); - let validators = api.validators(&BlockId::Hash(last)).unwrap(); + let session = api.current_session(last).unwrap(); + let validators = api.validators(last).unwrap(); Self { session, @@ -59,8 +59,7 @@ impl Refresh { // If the session has changed, re-create the struct with the data on it fn refresh(&self) { let session = self._refresh.read().unwrap().session; - let current_block = BlockId::Hash(self.client.info().finalized_hash); - if session != self.client.runtime_api().current_session(¤t_block).unwrap() { + if session != self.client.runtime_api().current_session(self.client.info().finalized_hash).unwrap() { *self._refresh.write().unwrap() = TendermintValidatorsStruct::from_module::(&self.client); } }