use fuel_core_chain_config::{
AddTable,
AsTable,
StateConfig,
StateConfigBuilder,
TableEntry,
};
use fuel_core_storage::{
Mappable,
blueprint::plain::Plain,
codec::{
postcard::Postcard,
primitive::Primitive,
raw::Raw,
},
structured_storage::TableWithBlueprint,
};
use fuel_core_types::{
blockchain::{
block::CompressedBlock,
consensus::Consensus,
},
fuel_tx::{
Transaction,
TxId,
},
fuel_types::BlockHeight,
};
pub struct OldFuelBlocks;
impl Mappable for OldFuelBlocks {
type Key = Self::OwnedKey;
type OwnedKey = BlockHeight;
type Value = Self::OwnedValue;
type OwnedValue = CompressedBlock;
}
impl TableWithBlueprint for OldFuelBlocks {
type Blueprint = Plain<Primitive<4>, Postcard>;
type Column = super::Column;
fn column() -> Self::Column {
Self::Column::OldFuelBlocks
}
}
#[cfg(test)]
fuel_core_storage::basic_storage_tests!(
OldFuelBlocks,
<OldFuelBlocks as Mappable>::Key::default(),
<OldFuelBlocks as Mappable>::Value::default()
);
pub struct OldFuelBlockConsensus;
impl Mappable for OldFuelBlockConsensus {
type Key = Self::OwnedKey;
type OwnedKey = BlockHeight;
type Value = Self::OwnedValue;
type OwnedValue = Consensus;
}
impl TableWithBlueprint for OldFuelBlockConsensus {
type Blueprint = Plain<Primitive<4>, Postcard>;
type Column = super::Column;
fn column() -> Self::Column {
Self::Column::OldFuelBlockConsensus
}
}
#[cfg(test)]
fuel_core_storage::basic_storage_tests!(
OldFuelBlockConsensus,
<OldFuelBlockConsensus as Mappable>::Key::default(),
<OldFuelBlockConsensus as Mappable>::Value::default()
);
pub struct OldTransactions;
impl Mappable for OldTransactions {
type Key = Self::OwnedKey;
type OwnedKey = TxId;
type Value = Self::OwnedValue;
type OwnedValue = Transaction;
}
impl TableWithBlueprint for OldTransactions {
type Blueprint = Plain<Raw, Postcard>;
type Column = super::Column;
fn column() -> Self::Column {
Self::Column::OldTransactions
}
}
#[cfg(test)]
fuel_core_storage::basic_storage_tests!(
OldTransactions,
<OldTransactions as Mappable>::Key::default(),
<OldTransactions as Mappable>::Value::default()
);
impl AsTable<OldFuelBlocks> for StateConfig {
fn as_table(&self) -> Vec<TableEntry<OldFuelBlocks>> {
Vec::new() }
}
impl AddTable<OldFuelBlocks> for StateConfigBuilder {
fn add(&mut self, _entries: Vec<TableEntry<OldFuelBlocks>>) {
}
}
impl AsTable<OldFuelBlockConsensus> for StateConfig {
fn as_table(&self) -> Vec<TableEntry<OldFuelBlockConsensus>> {
Vec::new() }
}
impl AddTable<OldFuelBlockConsensus> for StateConfigBuilder {
fn add(&mut self, _entries: Vec<TableEntry<OldFuelBlockConsensus>>) {
}
}
impl AsTable<OldTransactions> for StateConfig {
fn as_table(&self) -> Vec<TableEntry<OldTransactions>> {
Vec::new() }
}
impl AddTable<OldTransactions> for StateConfigBuilder {
fn add(&mut self, _entries: Vec<TableEntry<OldTransactions>>) {
}
}