Skip to content

Commit

Permalink
refactor: simplify Message::serialize_data_into
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Aug 26, 2022
1 parent c0c6713 commit 9830008
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions snarkos/network/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ impl<N: Network> Message<N> {
Self::Ping => Ok(()),
Self::Pong(block_height) => Ok(writer.write_all(&block_height.to_le_bytes())?),
Self::BlockRequest(block_height) => Ok(writer.write_all(&block_height.to_le_bytes())?),
Self::BlockResponse(block) => Ok(writer.write_all(&block.to_bytes_le()?)?),
Self::BlockResponse(block) | Self::BlockBroadcast(block) => Ok(writer.write_all(&block.to_bytes_le()?)?),
Self::TransactionBroadcast(transaction) => Ok(writer.write_all(&transaction.to_bytes_le()?)?),
Self::BlockBroadcast(block) => Ok(writer.write_all(&block.to_bytes_le()?)?),
}
}

Expand Down

0 comments on commit 9830008

Please sign in to comment.