private route work

This commit is contained in:
John Smith
2022-11-01 21:05:48 -04:00
parent 5ae0bd834c
commit d96b83fb4e
15 changed files with 377 additions and 342 deletions

View File

@@ -11,7 +11,7 @@ use xx::*;
pub enum ReceiptEvent {
ReturnedOutOfBand,
ReturnedInBand { inbound_noderef: NodeRef },
ReturnedPrivate,
ReturnedPrivate { private_route: DHTKey },
Expired,
Cancelled,
}
@@ -20,7 +20,7 @@ pub enum ReceiptEvent {
pub enum ReceiptReturned {
OutOfBand,
InBand { inbound_noderef: NodeRef },
Private,
Private { private_route: DHTKey },
}
pub trait ReceiptCallback: Send + 'static {
@@ -412,7 +412,7 @@ impl ReceiptManager {
match receipt_returned {
ReceiptReturned::OutOfBand => "OutOfBand".to_owned(),
ReceiptReturned::InBand { ref inbound_noderef } => format!("InBand({})", inbound_noderef),
ReceiptReturned::Private => "Private".to_owned(),
ReceiptReturned::Private { ref private_route } => format!("Private({})", private_route),
},
if extra_data.is_empty() {
"".to_owned()
@@ -450,7 +450,9 @@ impl ReceiptManager {
} => ReceiptEvent::ReturnedInBand {
inbound_noderef: inbound_noderef.clone(),
},
ReceiptReturned::Private => ReceiptEvent::ReturnedPrivate,
ReceiptReturned::Private { ref private_route } => ReceiptEvent::ReturnedPrivate {
private_route: private_route.clone(),
},
};
let callback_future = Self::perform_callback(receipt_event, &mut record_mut);