mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Add serde support for NodeRecord primitive type (#617)
* Add serde support to NodeRecord * Move NodeRecord to primitives along with NodeKey and Octets * Reexport NodeRecord from discv4 * Move NodeKey and kad_key back to discv4::node Also, move NodeRecord::key functionality to a helper function: discv4::node::record_key. This avoids the discv5 dependency in the primitives crate. * Fix NodeRecord (de)serializing The default derive macros work with a dictionary like display. Changed that to serde_with macros, that use Display and FromStr traits. * Add some tests for NodeRecord (de)serializing * Hide NodeKey struct * Move Octets after NodeRecord * Replace record_key with From trait * Fix clippy error unnecessary into()
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
|
||||
use crate::error::NetworkError;
|
||||
use futures::StreamExt;
|
||||
use reth_discv4::{DiscoveryUpdate, Discv4, Discv4Config, NodeRecord};
|
||||
use reth_primitives::{ForkId, PeerId};
|
||||
use reth_discv4::{DiscoveryUpdate, Discv4, Discv4Config};
|
||||
use reth_primitives::{ForkId, NodeRecord, PeerId};
|
||||
use secp256k1::SecretKey;
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap, VecDeque},
|
||||
|
||||
Reference in New Issue
Block a user