From 8d4bd593ebced40055785132dbe24588782dca8a Mon Sep 17 00:00:00 2001 From: acerone85 Date: Mon, 30 Sep 2024 18:00:05 +0100 Subject: [PATCH] Improvements to modifications_history --- .../modifications_history.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/fuel-core/src/state/historical_rocksdb/modifications_history.rs b/crates/fuel-core/src/state/historical_rocksdb/modifications_history.rs index 811be3ede8f..80218a06d33 100644 --- a/crates/fuel-core/src/state/historical_rocksdb/modifications_history.rs +++ b/crates/fuel-core/src/state/historical_rocksdb/modifications_history.rs @@ -18,14 +18,15 @@ use fuel_core_storage::{ /// is used to specify the version. /// This allows to define different [`TableWithBlueprint`] /// implementations for V1 and V2 of the modification history. -pub struct ModificationsHistoryVersion( +pub struct ModificationsHistoryVersion( core::marker::PhantomData, ) where Description: DatabaseDescription; /// [`ModificationsHistoryVersion`] keys and values for all versions. -impl Mappable for ModificationsHistoryVersion +impl Mappable + for ModificationsHistoryVersion where Description: DatabaseDescription, { @@ -37,9 +38,14 @@ where type OwnedValue = Self::Value; } +pub type ModificationsHistoryV1 = + ModificationsHistoryVersion; +pub type ModificationsHistoryV2 = + ModificationsHistoryVersion; + /// Blueprint for Modifications History V1. Keys are stored in little endian order /// using the `Column::HistoryColumn` column family. -impl TableWithBlueprint for ModificationsHistoryVersion +impl TableWithBlueprint for ModificationsHistoryV1 where Description: DatabaseDescription, { @@ -54,7 +60,7 @@ where /// Blueprint for Modifications History V2. Keys are stored in big endian order /// using the `Column::HistoryColumnV2` column family. -impl TableWithBlueprint for ModificationsHistoryVersion +impl TableWithBlueprint for ModificationsHistoryV2 where Description: DatabaseDescription, { @@ -66,8 +72,3 @@ where Column::HistoryV2Column } } - -pub type ModificationsHistoryV1 = - ModificationsHistoryVersion; -pub type ModificationsHistoryV2 = - ModificationsHistoryVersion;