Skip to content

Commit

Permalink
fixup! Remove clone() calls on PublicKey for using to_peer_id
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jul 18, 2021
1 parent 06450f2 commit cb2a3e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl From<MessageAuthenticity> for PublishConfig {
match authenticity {
MessageAuthenticity::Signed(keypair) => {
let public_key = keypair.public();
let key_enc = public_key.clone().to_protobuf_encoding();
let key_enc = public_key.to_protobuf_encoding();
let key = if key_enc.len() <= 42 {
// The public key can be inlined in [`rpc_proto::Message::from`], so we don't include it
// specifically in the [`rpc_proto::Message::key`] field.
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl GossipsubCodec {
};

// The key must match the peer_id
if source != public_key.clone().to_peer_id() {
if source != public_key.to_peer_id() {
warn!("Signature verification failed: Public key doesn't match source peer id");
return false;
}
Expand Down

0 comments on commit cb2a3e6

Please sign in to comment.