feat(eth-wire): derive serde traits for eth-wire types (#348)

* wip: start adding serde to stuff

* add serde traits to NewBlockHashes

* derive serde traits for the rest of the types

* derive serde traits for p2p subprotocol messages

* cargo fmt
This commit is contained in:
Dan Cline
2022-12-06 21:05:22 -05:00
committed by GitHub
parent 292f5f22bc
commit 6c91322251
15 changed files with 81 additions and 35 deletions

View File

@ -1,10 +1,11 @@
use crate::U256;
use ethers_core::types::{ParseChainError, U64};
use reth_rlp::{Decodable, Encodable};
use serde::{Deserialize, Serialize};
use std::{fmt, str::FromStr};
/// Either a named or chain id or the actual id value
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Chain {
/// Contains a known chain
Named(ethers_core::types::Chain),