Don't double hash: use the same hash in ExtrinsicDetails and ExtrinsicDetails (#1917)

* Don't double hash: use the same hash in ExtrinsicDetails and ExtrinsicEvents

* clippy
This commit is contained in:
James Wilson
2025-02-03 17:47:31 +00:00
committed by GitHub
parent 29bf00e209
commit d924ece39a
+2 -2
View File
@@ -5,7 +5,7 @@
use crate::{
blocks::block_types::{get_events, CachedEvents},
client::{OfflineClientT, OnlineClientT},
config::{Config, Hasher},
config::Config,
error::Error,
events,
};
@@ -250,7 +250,7 @@ where
/// The events associated with the extrinsic.
pub async fn events(&self) -> Result<ExtrinsicEvents<T>, Error> {
let events = get_events(&self.client, self.block_hash, &self.cached_events).await?;
let ext_hash = T::Hasher::hash_of(&self.bytes());
let ext_hash = self.inner.hash();
Ok(ExtrinsicEvents::new(ext_hash, self.index(), events))
}
}