Skip to content

Commit

Permalink
core/src: tweak key ownership in SignedEnvelope constructor (libp2p#2510
Browse files Browse the repository at this point in the history
)
  • Loading branch information
laurentsenta committed Feb 14, 2022
1 parent 60666f5 commit addec85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/peer_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl PeerRecord {
};

let envelope = SignedEnvelope::new(
key,
&key,
String::from(DOMAIN_SEP),
PAYLOAD_TYPE.as_bytes().to_vec(),
payload,
Expand Down Expand Up @@ -236,7 +236,7 @@ mod tests {
};

SignedEnvelope::new(
identity_b,
&identity_b,
String::from(DOMAIN_SEP),
PAYLOAD_TYPE.as_bytes().to_vec(),
payload,
Expand Down
4 changes: 2 additions & 2 deletions core/src/signed_envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct SignedEnvelope {
impl SignedEnvelope {
/// Constructs a new [`SignedEnvelope`].
pub fn new(
key: Keypair,
key: &Keypair,
domain_separation: String,
payload_type: Vec<u8>,
payload: Vec<u8>,
Expand Down Expand Up @@ -214,7 +214,7 @@ mod tests {
let payload_type: Vec<u8> = "payload type".into();

let env = SignedEnvelope::new(
kp.clone(),
&kp,
domain_separation.clone(),
payload_type.clone(),
payload.into(),
Expand Down

0 comments on commit addec85

Please sign in to comment.