Relocate PromotionResult into proto/fmp

Move the PromotionResult enum (and its impl) out of peer::mod and into
proto/fmp/core.rs, alongside the cross_connection_winner tie-break helper
that was relocated the same way. This is FMP connection-lifecycle result
vocabulary, so it belongs in the FMP subsystem home rather than the peer
module.

Behavior-neutral pure type relocation: consumers import it from
crate::proto::fmp, and the crate-root public path crate::PromotionResult
is preserved via a re-export in lib.rs (mirroring cross_connection_winner).
Full lib suite green at baseline.
This commit is contained in:
Johnathan Corgan
2026-07-10 16:52:18 +00:00
parent 1c41f73931
commit 1c1ed0d939
7 changed files with 64 additions and 68 deletions
+2 -2
View File
@@ -5,11 +5,11 @@ use crate::PeerIdentity;
use crate::node::acl::PeerAclContext;
use crate::node::reject::{HandshakeReject, RejectReason};
use crate::node::{Node, NodeError};
use crate::peer::{ActivePeer, PeerConnection, PromotionResult};
use crate::peer::{ActivePeer, PeerConnection};
use crate::proto::fmp::wire::{Msg1Header, Msg2Header, build_msg2};
use crate::proto::fmp::{
ConnAction, EstablishSnapshot, EstablishView, InboundDecision, InboundReject, OutboundDecision,
OutboundSnapshot, WireOutcome, cross_connection_winner,
OutboundSnapshot, PromotionResult, WireOutcome, cross_connection_winner,
};
use crate::transport::{Link, LinkDirection, LinkId, ReceivedPacket};
use std::time::Duration;
+1 -1
View File
@@ -1002,7 +1002,7 @@ fn build_ipv6_packet(
#[test]
fn test_identity_cache_populated_on_promote() {
use crate::peer::PromotionResult;
use crate::proto::fmp::PromotionResult;
let mut node = make_node();
let transport_id = TransportId::new(1);
+1 -1
View File
@@ -1,6 +1,6 @@
use super::*;
use crate::nostr::{BootstrapEvent, NostrRendezvous};
use crate::peer::PromotionResult;
use crate::proto::fmp::PromotionResult;
use crate::transport::udp::UdpTransport;
use crate::transport::{TransportHandle, packet_channel};
use std::sync::Arc;