refactor: clean up reth node (#450)

* feat: parse genesis block from a json spec

* refactor: clean up `init_genesis`
This commit is contained in:
Bjerg
2022-12-15 16:09:31 +01:00
committed by GitHub
parent 9208f2fd9b
commit f509213cb4
8 changed files with 26817 additions and 47 deletions

View File

@@ -1,20 +1,20 @@
use crate::{H256, U256};
use reth_codecs::{main_codec, Compact};
/// Account saved in database
/// An Ethereum account.
#[main_codec]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub struct Account {
/// Nonce.
/// Account nonce.
pub nonce: u64,
/// Account balance.
pub balance: U256,
/// Hash of the bytecode.
/// Hash of the account's bytecode.
pub bytecode_hash: Option<H256>,
}
impl Account {
/// Does account has a bytecode.
/// Whether the account has bytecode.
pub fn has_bytecode(&self) -> bool {
self.bytecode_hash.is_some()
}

View File

@@ -83,6 +83,11 @@ mod __reexport {
pub use tiny_keccak;
}
/// Various utilities
pub mod utils {
pub use ethers_core::types::serde_helpers;
}
// Useful reexports
pub use __reexport::*;