Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
YeahNotSewerSide committed Jul 29, 2023
1 parent b318403 commit e5f96f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ use crate::{
bin2addr, dump_addresses,
packet_models::{
self, AnnounceRequest, GetAmountRequest, GetBlockByHashRequest,
GetBlockByHeightRequest, GetBlocksByHeightsRequest, GetBlocksResponse, GetNodesReponse,
GetTransactionRequest, NewBlockRequest, NewTransactionRequest, SubmitPow,
GetBlockByHeightRequest, GetBlocksByHeightsRequest, GetBlocksResponse,
GetNodesResponse, GetTransactionRequest, NewBlockRequest, NewTransactionRequest,
SubmitPow,
},
parse_ipv4, NodeContext, ReceivedPacket,
},
Expand Down Expand Up @@ -164,7 +165,7 @@ pub async fn get_nodes_request_handler(

let packet = packet_models::Packet::Response {
id: received_id,
data: packet_models::Response::GetNodes(packet_models::GetNodesReponse { ipv4, ipv6 }),
data: packet_models::Response::GetNodes(packet_models::GetNodesResponse { ipv4, ipv6 }),
};

socket
Expand Down Expand Up @@ -625,7 +626,7 @@ pub async fn new_block_request_handler(

pub async fn get_nodes_response_handler(
context: &NodeContext,
packet: &GetNodesReponse,
packet: &GetNodesResponse,
) -> Result<(), NodeError> {
if let Some(dump) = &packet.ipv4 {
let parsed = parse_ipv4(dump).map_err(NodeError::BinToAddress)?;
Expand Down
4 changes: 2 additions & 2 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub mod packet_models {
#[serde(tag = "r")]
pub enum Response {
Ok(OkResponse),
GetNodes(GetNodesReponse),
GetNodes(GetNodesResponse),
GetAmount(GetAmountResponse),
GetTransaction(GetTransactionResponse),
Ping(PingResponse),
Expand All @@ -190,7 +190,7 @@ pub mod packet_models {
}

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct GetNodesReponse {
pub struct GetNodesResponse {
pub ipv4: Option<Vec<u8>>,
pub ipv6: Option<Vec<u8>>,
}
Expand Down

0 comments on commit e5f96f6

Please sign in to comment.