feat: A basic json dump extension to reth db list. (#2232)

Co-authored-by: andy-thomason <andy@atomicinrement.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Andy Thomson
2023-05-04 14:55:08 +01:00
committed by GitHub
parent 231d1f96bb
commit 7914d1cf76
3 changed files with 17 additions and 5 deletions

View File

@ -5,6 +5,7 @@ use crate::{
Error,
};
use reth_primitives::BlockNumber;
use serde::Serialize;
/// Number of indices in one shard.
pub const NUM_OF_INDICES_IN_SHARD: usize = 100;
@ -15,7 +16,7 @@ pub const NUM_OF_INDICES_IN_SHARD: usize = 100;
/// `Address | 200` -> data is from block 0 to 200.
///
/// `Address | 300` -> data is from block 201 to 300.
#[derive(Debug, Default, Clone, Eq, PartialEq, Ord, PartialOrd)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Ord, PartialOrd, Serialize)]
pub struct ShardedKey<T> {
/// The key for this type.
pub key: T,

View File

@ -4,7 +4,9 @@ use crate::{
table::{Decode, Encode},
Error,
};
use reth_primitives::{BlockNumber, H160, H256};
use serde::Serialize;
use super::ShardedKey;
@ -17,7 +19,7 @@ pub const NUM_OF_INDICES_IN_SHARD: usize = 100;
/// `Address | Storagekey | 200` -> data is from transition 0 to 200.
///
/// `Address | StorageKey | 300` -> data is from transition 201 to 300.
#[derive(Debug, Default, Clone, Eq, Ord, PartialOrd, PartialEq)]
#[derive(Debug, Default, Clone, Eq, Ord, PartialOrd, PartialEq, Serialize)]
pub struct StorageShardedKey {
/// Storage account address.
pub address: H160,