more clippy
This commit is contained in:
@@ -16,7 +16,7 @@ pub fn encode_node_info(
|
||||
.reborrow()
|
||||
.init_envelope_support(node_info.envelope_support().len() as u32);
|
||||
if let Some(s) = es_builder.as_slice() {
|
||||
s.clone_from_slice(&node_info.envelope_support());
|
||||
s.clone_from_slice(node_info.envelope_support());
|
||||
}
|
||||
|
||||
let mut cs_builder = builder
|
||||
@@ -100,7 +100,7 @@ pub fn decode_node_info(reader: &veilid_capnp::node_info::Reader) -> Result<Node
|
||||
if envelope_support.len() > MAX_ENVELOPE_VERSIONS {
|
||||
return Err(RPCError::protocol("too many envelope versions"));
|
||||
}
|
||||
if envelope_support.len() == 0 {
|
||||
if envelope_support.is_empty() {
|
||||
return Err(RPCError::protocol("no envelope versions"));
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ pub fn decode_node_info(reader: &veilid_capnp::node_info::Reader) -> Result<Node
|
||||
if crypto_support.len() > MAX_CRYPTO_KINDS {
|
||||
return Err(RPCError::protocol("too many crypto kinds"));
|
||||
}
|
||||
if crypto_support.len() == 0 {
|
||||
if crypto_support.is_empty() {
|
||||
return Err(RPCError::protocol("no crypto kinds"));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,22 +31,22 @@ impl RPCAnswer {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum RPCAnswerDetail {
|
||||
StatusA(RPCOperationStatusA),
|
||||
FindNodeA(RPCOperationFindNodeA),
|
||||
AppCallA(RPCOperationAppCallA),
|
||||
GetValueA(RPCOperationGetValueA),
|
||||
SetValueA(RPCOperationSetValueA),
|
||||
WatchValueA(RPCOperationWatchValueA),
|
||||
StatusA(Box<RPCOperationStatusA>),
|
||||
FindNodeA(Box<RPCOperationFindNodeA>),
|
||||
AppCallA(Box<RPCOperationAppCallA>),
|
||||
GetValueA(Box<RPCOperationGetValueA>),
|
||||
SetValueA(Box<RPCOperationSetValueA>),
|
||||
WatchValueA(Box<RPCOperationWatchValueA>),
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
SupplyBlockA(RPCOperationSupplyBlockA),
|
||||
SupplyBlockA(Box<RPCOperationSupplyBlockA>),
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
FindBlockA(RPCOperationFindBlockA),
|
||||
FindBlockA(Box<RPCOperationFindBlockA>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
StartTunnelA(RPCOperationStartTunnelA),
|
||||
StartTunnelA(Box<RPCOperationStartTunnelA>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
CompleteTunnelA(RPCOperationCompleteTunnelA),
|
||||
CompleteTunnelA(Box<RPCOperationCompleteTunnelA>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
CancelTunnelA(RPCOperationCancelTunnelA),
|
||||
CancelTunnelA(Box<RPCOperationCancelTunnelA>),
|
||||
}
|
||||
|
||||
impl RPCAnswerDetail {
|
||||
@@ -98,62 +98,62 @@ impl RPCAnswerDetail {
|
||||
veilid_capnp::answer::detail::StatusA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationStatusA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::StatusA(out)
|
||||
RPCAnswerDetail::StatusA(Box::new(out))
|
||||
}
|
||||
veilid_capnp::answer::detail::FindNodeA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationFindNodeA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::FindNodeA(out)
|
||||
RPCAnswerDetail::FindNodeA(Box::new(out))
|
||||
}
|
||||
veilid_capnp::answer::detail::AppCallA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationAppCallA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::AppCallA(out)
|
||||
RPCAnswerDetail::AppCallA(Box::new(out))
|
||||
}
|
||||
veilid_capnp::answer::detail::GetValueA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationGetValueA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::GetValueA(out)
|
||||
RPCAnswerDetail::GetValueA(Box::new(out))
|
||||
}
|
||||
veilid_capnp::answer::detail::SetValueA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationSetValueA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::SetValueA(out)
|
||||
RPCAnswerDetail::SetValueA(Box::new(out))
|
||||
}
|
||||
veilid_capnp::answer::detail::WatchValueA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationWatchValueA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::WatchValueA(out)
|
||||
RPCAnswerDetail::WatchValueA(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
veilid_capnp::answer::detail::SupplyBlockA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationSupplyBlockA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::SupplyBlockA(out)
|
||||
RPCAnswerDetail::SupplyBlockA(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
veilid_capnp::answer::detail::FindBlockA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationFindBlockA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::FindBlockA(out)
|
||||
RPCAnswerDetail::FindBlockA(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::answer::detail::StartTunnelA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationStartTunnelA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::StartTunnelA(out)
|
||||
RPCAnswerDetail::StartTunnelA(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::answer::detail::CompleteTunnelA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationCompleteTunnelA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::CompleteTunnelA(out)
|
||||
RPCAnswerDetail::CompleteTunnelA(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::answer::detail::CancelTunnelA(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationCancelTunnelA::decode(&op_reader)?;
|
||||
RPCAnswerDetail::CancelTunnelA(out)
|
||||
RPCAnswerDetail::CancelTunnelA(Box::new(out))
|
||||
}
|
||||
};
|
||||
Ok(out)
|
||||
|
||||
@@ -2,9 +2,9 @@ use super::*;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum RPCOperationKind {
|
||||
Question(RPCQuestion),
|
||||
Statement(RPCStatement),
|
||||
Answer(RPCAnswer),
|
||||
Question(Box<RPCQuestion>),
|
||||
Statement(Box<RPCStatement>),
|
||||
Answer(Box<RPCAnswer>),
|
||||
}
|
||||
|
||||
impl RPCOperationKind {
|
||||
@@ -30,17 +30,17 @@ impl RPCOperationKind {
|
||||
veilid_capnp::operation::kind::Which::Question(r) => {
|
||||
let q_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCQuestion::decode(&q_reader)?;
|
||||
RPCOperationKind::Question(out)
|
||||
RPCOperationKind::Question(Box::new(out))
|
||||
}
|
||||
veilid_capnp::operation::kind::Which::Statement(r) => {
|
||||
let q_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCStatement::decode(&q_reader)?;
|
||||
RPCOperationKind::Statement(out)
|
||||
RPCOperationKind::Statement(Box::new(out))
|
||||
}
|
||||
veilid_capnp::operation::kind::Which::Answer(r) => {
|
||||
let q_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCAnswer::decode(&q_reader)?;
|
||||
RPCOperationKind::Answer(out)
|
||||
RPCOperationKind::Answer(Box::new(out))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ impl RPCOperation {
|
||||
op_id: OperationId::new(get_random_u64()),
|
||||
opt_sender_peer_info: sender_peer_info.opt_sender_peer_info,
|
||||
target_node_info_ts: sender_peer_info.target_node_info_ts,
|
||||
kind: RPCOperationKind::Question(question),
|
||||
kind: RPCOperationKind::Question(Box::new(question)),
|
||||
}
|
||||
}
|
||||
pub fn new_statement(statement: RPCStatement, sender_peer_info: SenderPeerInfo) -> Self {
|
||||
@@ -81,7 +81,7 @@ impl RPCOperation {
|
||||
op_id: OperationId::new(get_random_u64()),
|
||||
opt_sender_peer_info: sender_peer_info.opt_sender_peer_info,
|
||||
target_node_info_ts: sender_peer_info.target_node_info_ts,
|
||||
kind: RPCOperationKind::Statement(statement),
|
||||
kind: RPCOperationKind::Statement(Box::new(statement)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ impl RPCOperation {
|
||||
op_id: request.op_id,
|
||||
opt_sender_peer_info: sender_peer_info.opt_sender_peer_info,
|
||||
target_node_info_ts: sender_peer_info.target_node_info_ts,
|
||||
kind: RPCOperationKind::Answer(answer),
|
||||
kind: RPCOperationKind::Answer(Box::new(answer)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ impl RPCOperation {
|
||||
builder.set_op_id(self.op_id.as_u64());
|
||||
if let Some(sender_peer_info) = &self.opt_sender_peer_info {
|
||||
let mut pi_builder = builder.reborrow().init_sender_peer_info();
|
||||
encode_peer_info(&sender_peer_info, &mut pi_builder)?;
|
||||
encode_peer_info(sender_peer_info, &mut pi_builder)?;
|
||||
}
|
||||
builder.set_target_node_info_ts(self.target_node_info_ts.as_u64());
|
||||
let mut k_builder = builder.reborrow().init_kind();
|
||||
|
||||
@@ -122,7 +122,7 @@ impl RPCOperationSetValueA {
|
||||
value: Option<SignedValueData>,
|
||||
peers: Vec<PeerInfo>,
|
||||
) -> Result<Self, RPCError> {
|
||||
if peers.len() as usize > MAX_SET_VALUE_A_PEERS_LEN {
|
||||
if peers.len() > MAX_SET_VALUE_A_PEERS_LEN {
|
||||
return Err(RPCError::protocol(
|
||||
"encoded SetValueA peers length too long",
|
||||
));
|
||||
|
||||
@@ -36,7 +36,7 @@ impl RPCOperationStatusQ {
|
||||
) -> Result<(), RPCError> {
|
||||
if let Some(ns) = &self.node_status {
|
||||
let mut ns_builder = builder.reborrow().init_node_status();
|
||||
encode_node_status(&ns, &mut ns_builder)?;
|
||||
encode_node_status(ns, &mut ns_builder)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -98,11 +98,11 @@ impl RPCOperationStatusA {
|
||||
) -> Result<(), RPCError> {
|
||||
if let Some(ns) = &self.node_status {
|
||||
let mut ns_builder = builder.reborrow().init_node_status();
|
||||
encode_node_status(&ns, &mut ns_builder)?;
|
||||
encode_node_status(ns, &mut ns_builder)?;
|
||||
}
|
||||
if let Some(si) = &self.sender_info {
|
||||
let mut si_builder = builder.reborrow().init_sender_info();
|
||||
encode_sender_info(&si, &mut si_builder)?;
|
||||
encode_sender_info(si, &mut si_builder)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ impl RPCOperationWatchValueQ {
|
||||
watcher: PublicKey,
|
||||
signature: Signature,
|
||||
) -> Result<Self, RPCError> {
|
||||
if subkeys.len() as usize > MAX_WATCH_VALUE_Q_SUBKEYS_LEN {
|
||||
if subkeys.len() > MAX_WATCH_VALUE_Q_SUBKEYS_LEN {
|
||||
return Err(RPCError::protocol("WatchValueQ subkeys length too long"));
|
||||
}
|
||||
Ok(Self {
|
||||
@@ -38,7 +38,7 @@ impl RPCOperationWatchValueQ {
|
||||
// signature covers: key, subkeys, expiration, count, using watcher key
|
||||
fn make_signature_data(&self) -> Vec<u8> {
|
||||
let mut sig_data =
|
||||
Vec::with_capacity(PUBLIC_KEY_LENGTH + 4 + (self.subkeys.len() as usize * 8) + 8 + 4);
|
||||
Vec::with_capacity(PUBLIC_KEY_LENGTH + 4 + (self.subkeys.len() * 8) + 8 + 4);
|
||||
sig_data.extend_from_slice(&self.key.kind.0);
|
||||
sig_data.extend_from_slice(&self.key.value.bytes);
|
||||
for sk in self.subkeys.ranges() {
|
||||
|
||||
@@ -43,22 +43,22 @@ impl RPCQuestion {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum RPCQuestionDetail {
|
||||
StatusQ(RPCOperationStatusQ),
|
||||
FindNodeQ(RPCOperationFindNodeQ),
|
||||
AppCallQ(RPCOperationAppCallQ),
|
||||
GetValueQ(RPCOperationGetValueQ),
|
||||
SetValueQ(RPCOperationSetValueQ),
|
||||
WatchValueQ(RPCOperationWatchValueQ),
|
||||
StatusQ(Box<RPCOperationStatusQ>),
|
||||
FindNodeQ(Box<RPCOperationFindNodeQ>),
|
||||
AppCallQ(Box<RPCOperationAppCallQ>),
|
||||
GetValueQ(Box<RPCOperationGetValueQ>),
|
||||
SetValueQ(Box<RPCOperationSetValueQ>),
|
||||
WatchValueQ(Box<RPCOperationWatchValueQ>),
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
SupplyBlockQ(RPCOperationSupplyBlockQ),
|
||||
SupplyBlockQ(Box<RPCOperationSupplyBlockQ>),
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
FindBlockQ(RPCOperationFindBlockQ),
|
||||
FindBlockQ(Box<RPCOperationFindBlockQ>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
StartTunnelQ(RPCOperationStartTunnelQ),
|
||||
StartTunnelQ(Box<RPCOperationStartTunnelQ>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
CompleteTunnelQ(RPCOperationCompleteTunnelQ),
|
||||
CompleteTunnelQ(Box<RPCOperationCompleteTunnelQ>),
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
CancelTunnelQ(RPCOperationCancelTunnelQ),
|
||||
CancelTunnelQ(Box<RPCOperationCancelTunnelQ>),
|
||||
}
|
||||
|
||||
impl RPCQuestionDetail {
|
||||
@@ -111,62 +111,62 @@ impl RPCQuestionDetail {
|
||||
veilid_capnp::question::detail::StatusQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationStatusQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::StatusQ(out)
|
||||
RPCQuestionDetail::StatusQ(Box::new(out))
|
||||
}
|
||||
veilid_capnp::question::detail::FindNodeQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationFindNodeQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::FindNodeQ(out)
|
||||
RPCQuestionDetail::FindNodeQ(Box::new(out))
|
||||
}
|
||||
veilid_capnp::question::detail::Which::AppCallQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationAppCallQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::AppCallQ(out)
|
||||
RPCQuestionDetail::AppCallQ(Box::new(out))
|
||||
}
|
||||
veilid_capnp::question::detail::GetValueQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationGetValueQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::GetValueQ(out)
|
||||
RPCQuestionDetail::GetValueQ(Box::new(out))
|
||||
}
|
||||
veilid_capnp::question::detail::SetValueQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationSetValueQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::SetValueQ(out)
|
||||
RPCQuestionDetail::SetValueQ(Box::new(out))
|
||||
}
|
||||
veilid_capnp::question::detail::WatchValueQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationWatchValueQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::WatchValueQ(out)
|
||||
RPCQuestionDetail::WatchValueQ(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
veilid_capnp::question::detail::SupplyBlockQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationSupplyBlockQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::SupplyBlockQ(out)
|
||||
RPCQuestionDetail::SupplyBlockQ(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-blockstore")]
|
||||
veilid_capnp::question::detail::FindBlockQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationFindBlockQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::FindBlockQ(out)
|
||||
RPCQuestionDetail::FindBlockQ(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::question::detail::StartTunnelQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationStartTunnelQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::StartTunnelQ(out)
|
||||
RPCQuestionDetail::StartTunnelQ(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::question::detail::CompleteTunnelQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationCompleteTunnelQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::CompleteTunnelQ(out)
|
||||
RPCQuestionDetail::CompleteTunnelQ(Box::new(out))
|
||||
}
|
||||
#[cfg(feature = "unstable-tunnels")]
|
||||
veilid_capnp::question::detail::CancelTunnelQ(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationCancelTunnelQ::decode(&op_reader)?;
|
||||
RPCQuestionDetail::CancelTunnelQ(out)
|
||||
RPCQuestionDetail::CancelTunnelQ(Box::new(out))
|
||||
}
|
||||
};
|
||||
Ok(out)
|
||||
|
||||
@@ -34,12 +34,12 @@ impl RPCStatement {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum RPCStatementDetail {
|
||||
ValidateDialInfo(RPCOperationValidateDialInfo),
|
||||
Route(RPCOperationRoute),
|
||||
ValueChanged(RPCOperationValueChanged),
|
||||
Signal(RPCOperationSignal),
|
||||
ReturnReceipt(RPCOperationReturnReceipt),
|
||||
AppMessage(RPCOperationAppMessage),
|
||||
ValidateDialInfo(Box<RPCOperationValidateDialInfo>),
|
||||
Route(Box<RPCOperationRoute>),
|
||||
ValueChanged(Box<RPCOperationValueChanged>),
|
||||
Signal(Box<RPCOperationSignal>),
|
||||
ReturnReceipt(Box<RPCOperationReturnReceipt>),
|
||||
AppMessage(Box<RPCOperationAppMessage>),
|
||||
}
|
||||
|
||||
impl RPCStatementDetail {
|
||||
@@ -71,32 +71,32 @@ impl RPCStatementDetail {
|
||||
veilid_capnp::statement::detail::ValidateDialInfo(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationValidateDialInfo::decode(&op_reader)?;
|
||||
RPCStatementDetail::ValidateDialInfo(out)
|
||||
RPCStatementDetail::ValidateDialInfo(Box::new(out))
|
||||
}
|
||||
veilid_capnp::statement::detail::Route(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationRoute::decode(&op_reader)?;
|
||||
RPCStatementDetail::Route(out)
|
||||
RPCStatementDetail::Route(Box::new(out))
|
||||
}
|
||||
veilid_capnp::statement::detail::ValueChanged(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationValueChanged::decode(&op_reader)?;
|
||||
RPCStatementDetail::ValueChanged(out)
|
||||
RPCStatementDetail::ValueChanged(Box::new(out))
|
||||
}
|
||||
veilid_capnp::statement::detail::Signal(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationSignal::decode(&op_reader)?;
|
||||
RPCStatementDetail::Signal(out)
|
||||
RPCStatementDetail::Signal(Box::new(out))
|
||||
}
|
||||
veilid_capnp::statement::detail::ReturnReceipt(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationReturnReceipt::decode(&op_reader)?;
|
||||
RPCStatementDetail::ReturnReceipt(out)
|
||||
RPCStatementDetail::ReturnReceipt(Box::new(out))
|
||||
}
|
||||
veilid_capnp::statement::detail::AppMessage(r) => {
|
||||
let op_reader = r.map_err(RPCError::protocol)?;
|
||||
let out = RPCOperationAppMessage::decode(&op_reader)?;
|
||||
RPCStatementDetail::AppMessage(out)
|
||||
RPCStatementDetail::AppMessage(Box::new(out))
|
||||
}
|
||||
};
|
||||
Ok(out)
|
||||
|
||||
@@ -41,7 +41,7 @@ pub fn decode_peer_info(reader: &veilid_capnp::peer_info::Reader) -> Result<Peer
|
||||
node_ids.add(decode_typed_key(&nid_reader)?);
|
||||
}
|
||||
let signed_node_info = decode_signed_node_info(&sni_reader)?;
|
||||
if node_ids.len() == 0 {
|
||||
if node_ids.is_empty() {
|
||||
return Err(RPCError::protocol("no verified node ids"));
|
||||
}
|
||||
Ok(PeerInfo::new(node_ids, signed_node_info))
|
||||
|
||||
@@ -53,11 +53,11 @@ pub fn encode_route_hop(
|
||||
match &route_hop.node {
|
||||
RouteNode::NodeId(ni) => {
|
||||
let mut ni_builder = node_builder.init_node_id();
|
||||
encode_key256(&ni, &mut ni_builder);
|
||||
encode_key256(ni, &mut ni_builder);
|
||||
}
|
||||
RouteNode::PeerInfo(pi) => {
|
||||
let mut pi_builder = node_builder.init_peer_info();
|
||||
encode_peer_info(&pi, &mut pi_builder)?;
|
||||
encode_peer_info(pi, &mut pi_builder)?;
|
||||
}
|
||||
}
|
||||
if let Some(rhd) = &route_hop.next_hop {
|
||||
|
||||
Reference in New Issue
Block a user