Skip to content

Commit

Permalink
Merge pull request #1936 from dusk-network/rename_getinv
Browse files Browse the repository at this point in the history
Rename GetInv to Inv
  • Loading branch information
fed-franz authored Aug 26, 2024
2 parents 08fb392 + d23da59 commit 7083344
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions node-data/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl Serializable for Message {
Payload::Block(p) => p.write(w),
Payload::Transaction(p) => p.write(w),
Payload::GetMempool(p) => p.write(w),
Payload::GetInv(p) => p.write(w),
Payload::Inv(p) => p.write(w),
Payload::GetBlocks(p) => p.write(w),
Payload::GetResource(p) => p.write(w),
Payload::Ratification(p) => p.write(w),
Expand Down Expand Up @@ -144,7 +144,7 @@ impl Serializable for Message {
Topics::GetMempool => {
Message::new_get_mempool(payload::GetMempool::read(r)?)
}
Topics::GetInv => Message::new_inv(payload::Inv::read(r)?),
Topics::Inv => Message::new_inv(payload::Inv::read(r)?),
Topics::Unknown => {
return Err(io::Error::new(
io::ErrorKind::InvalidData,
Expand Down Expand Up @@ -210,8 +210,8 @@ impl Message {
/// Creates topics.Inv (inventory) message
pub fn new_inv(p: payload::Inv) -> Message {
Self {
topic: Topics::GetInv,
payload: Payload::GetInv(p),
topic: Topics::Inv,
payload: Payload::Inv(p),
..Default::default()
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ pub enum Payload {
Block(Box<ledger::Block>),
Transaction(Box<ledger::Transaction>),
GetMempool(payload::GetMempool),
GetInv(payload::Inv),
Inv(payload::Inv),
GetBlocks(payload::GetBlocks),
GetResource(payload::GetResource),

Expand Down Expand Up @@ -1059,7 +1059,7 @@ pub enum Topics {
GetResource = 8,
GetBlocks = 9,
GetMempool = 13, // NB: This is aliased as Mempool in the golang impl
GetInv = 14, // NB: This is aliased as Inv in the golang impl
Inv = 14,

// Fire-and-forget messaging
Tx = 10,
Expand Down Expand Up @@ -1094,7 +1094,7 @@ impl From<u8> for Topics {
map_topic!(v, Topics::Tx);
map_topic!(v, Topics::Block);
map_topic!(v, Topics::GetMempool);
map_topic!(v, Topics::GetInv);
map_topic!(v, Topics::Inv);
map_topic!(v, Topics::Candidate);
map_topic!(v, Topics::Validation);
map_topic!(v, Topics::Ratification);
Expand Down
6 changes: 3 additions & 3 deletions node/src/databroker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tracing::{debug, info, warn};
const TOPICS: &[u8] = &[
Topics::GetBlocks as u8,
Topics::GetMempool as u8,
Topics::GetInv as u8,
Topics::Inv as u8,
Topics::GetResource as u8,
];

Expand Down Expand Up @@ -203,8 +203,8 @@ impl DataBrokerSrv {
let msg = Self::handle_get_mempool(db).await?;
Ok(Response::new_from_msg(msg, recv_peer))
}
// Handle GetInv requests
Payload::GetInv(m) => {
// Handle Inv messages
Payload::Inv(m) => {
let msg =
Self::handle_inv(db, m, conf.max_inv_entries, this_peer)
.await?;
Expand Down

0 comments on commit 7083344

Please sign in to comment.