From 422c783a47b399425673e4d51ed1518bef245018 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Wed, 25 Sep 2019 14:53:13 -0700 Subject: [PATCH] Rename Message::Inventory -> Message::Inv I don't feel super strongly about this change, so I'm happy to drop it, but it makes the parsing match statements line up nicely and aligns naming with the naming used in Bitcoin. --- zebra-network/src/protocol/codec.rs | 4 ++-- zebra-network/src/protocol/message.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zebra-network/src/protocol/codec.rs b/zebra-network/src/protocol/codec.rs index d5c5df888..029310f89 100644 --- a/zebra-network/src/protocol/codec.rs +++ b/zebra-network/src/protocol/codec.rs @@ -126,7 +126,7 @@ impl Encoder for Codec { GetBlocks { .. } => b"getblocks\0\0\0", Headers { .. } => b"headers\0\0\0\0\0", GetHeaders { .. } => b"getheaders\0\0", - Inventory { .. } => b"inv\0\0\0\0\0\0\0\0\0", // XXX Inventory -> Inv ? + Inv { .. } => b"inv\0\0\0\0\0\0\0\0\0", GetData { .. } => b"getdata\0\0\0\0\0", NotFound { .. } => b"notfound\0\0\0\0", Tx { .. } => b"tx\0\0\0\0\0\0\0\0\0\0", @@ -422,7 +422,7 @@ impl Codec { hashes.push(InventoryHash::zcash_deserialize(&mut reader)?); } - Ok(Message::Inventory(hashes)) + Ok(Message::Inv(hashes)) } fn read_getdata(&self, mut _reader: R) -> Result { diff --git a/zebra-network/src/protocol/message.rs b/zebra-network/src/protocol/message.rs index 08449cf22..457202a2b 100644 --- a/zebra-network/src/protocol/message.rs +++ b/zebra-network/src/protocol/message.rs @@ -163,7 +163,7 @@ pub enum Message { // XXX the bitcoin reference above suggests this can be 1.8 MB in bitcoin -- maybe // larger in Zcash, since Zcash objects could be bigger (?) -- does this tilt towards // having serialization be async? - Inventory(Vec), + Inv(Vec), /// A `getdata` message. ///