Merge branch 'bug608' into 'main'
msg::{CreateFast/CreatedFast}: Rename accessor to (into_)body() Closes #608 See merge request tpo/core/arti!948
This commit is contained in:
commit
21670d3aaf
|
@ -302,7 +302,7 @@ fixed_len_handshake! {
|
|||
}
|
||||
impl CreateFast {
|
||||
/// Return the content of this handshake
|
||||
pub fn body(&self) -> &[u8] {
|
||||
pub fn handshake(&self) -> &[u8] {
|
||||
&self.handshake
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ fixed_len_handshake! {
|
|||
}
|
||||
impl CreatedFast {
|
||||
/// Consume this message and return the content of this handshake
|
||||
pub fn into_body(self) -> Vec<u8> {
|
||||
pub fn into_handshake(self) -> Vec<u8> {
|
||||
self.handshake
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ fn test_create_fast() {
|
|||
|
||||
fbody(cmd, body, &msg::CreateFast::new(handshake.clone()).into());
|
||||
let create_fast = msg::CreateFast::new(handshake.clone());
|
||||
assert_eq!(create_fast.body(), &handshake[..]);
|
||||
assert_eq!(create_fast.handshake(), &handshake[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -221,7 +221,7 @@ fn test_created_fast() {
|
|||
|
||||
fbody(cmd, body, &msg::CreatedFast::new(handshake.clone()).into());
|
||||
let created_fast = msg::CreatedFast::new(handshake.clone());
|
||||
assert_eq!(created_fast.into_body(), handshake);
|
||||
assert_eq!(created_fast.into_handshake(), handshake);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
BREAKING: Deprecated CreateFast::body(), CreatedFast::into_body() methods
|
||||
MODIFIED: Added CreateFast::handshake(), CreatedFast::into_handshake() methods
|
|
@ -592,7 +592,7 @@ impl CreateHandshakeWrap for CreateFastWrap {
|
|||
fn decode_chanmsg(&self, msg: CreateResponse) -> Result<Vec<u8>> {
|
||||
use CreateResponse::*;
|
||||
match msg {
|
||||
CreatedFast(m) => Ok(m.into_body()),
|
||||
CreatedFast(m) => Ok(m.into_handshake()),
|
||||
Destroy(_) => Err(Error::CircRefused(
|
||||
"Relay replied to CREATE_FAST with DESTROY.",
|
||||
)),
|
||||
|
@ -769,7 +769,7 @@ mod test {
|
|||
ChanMsg::CreateFast(cf) => cf,
|
||||
_ => panic!(),
|
||||
};
|
||||
let (_, rep) = CreateFastServer::server(&mut rng, &[()], cf.body()).unwrap();
|
||||
let (_, rep) = CreateFastServer::server(&mut rng, &[()], cf.handshake()).unwrap();
|
||||
CreateResponse::CreatedFast(CreatedFast::new(rep))
|
||||
} else {
|
||||
let c2 = match create_cell.msg() {
|
||||
|
|
Loading…
Reference in New Issue