Wrap the subxt::events::Events type to avoid exposing subxt_core errors and types unnecessarily (#1948)

* Wrap the subxt::events::Events type to avoid exposing subxt_core errors and types unnecessarily (#1947)

* Actually import module and fix issues

* Remove a couple of unnecessary conversions now

* Test
This commit is contained in:
James Wilson
2025-03-06 16:30:47 +00:00
committed by GitHub
parent c29edf6fef
commit 49c66a0fd5
4 changed files with 173 additions and 16 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ pub trait StaticEvent: DecodeAsFields {
/// A collection of events obtained from a block, bundled with the necessary
/// information needed to decode and iterate over them.
#[derive_where(Clone)]
pub struct Events<T: Config> {
pub struct Events<T> {
metadata: Metadata,
// Note; raw event bytes are prefixed with a Compact<u32> containing
// the number of events to be decoded. The start_idx reflects that, so
@@ -87,7 +87,7 @@ pub struct Events<T: Config> {
}
// Ignore the Metadata when debug-logging events; it's big and distracting.
impl<T: Config> core::fmt::Debug for Events<T> {
impl<T> core::fmt::Debug for Events<T> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("Events")
.field("event_bytes", &self.event_bytes)