lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit d7126a4a89142d6c949000d63adfee4d344d851e
parent 3484cc562c4f6a806fea47fbb57874ef6c3f8151
Author: triesap <tyson@radroots.org>
Date:   Mon, 13 Jul 2026 05:54:16 +0000

transport: rename generic signed event surfaces

- rename runtime transport payloads to SignedEvent
- rename transport publish event wire DTOs
- remove the generic SignedNostrEvent protocol surface
- validate runtime, protocol, and source-boundary lanes

Diffstat:
Mcrates/runtime/src/transport.rs | 4++--
Mcrates/transport_publish_protocol/src/lib.rs | 10+++++-----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/crates/runtime/src/transport.rs b/crates/runtime/src/transport.rs @@ -56,14 +56,14 @@ impl From<RadrootsTransportError> for RadrootsRuntimeTransportError { #[derive(Clone, Debug, PartialEq, Eq)] pub enum RadrootsRuntimeTransportPayload { - SignedNostrEvent(RadrootsSignedEvent), + SignedEvent(RadrootsSignedEvent), OpaqueBytes { label: String, bytes: Vec<u8> }, } impl RadrootsRuntimeTransportPayload { pub fn transport_payload(&self) -> Result<RadrootsTransportPayload, RadrootsTransportError> { match self { - Self::SignedNostrEvent(event) => { + Self::SignedEvent(event) => { RadrootsTransportPayload::signed_event_json(&event.id, &event.raw_json) } Self::OpaqueBytes { label, bytes } => { diff --git a/crates/transport_publish_protocol/src/lib.rs b/crates/transport_publish_protocol/src/lib.rs @@ -257,7 +257,7 @@ impl std::error::Error for TransportPublishProtocolError {} #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(deny_unknown_fields))] #[derive(Clone, Debug, PartialEq, Eq)] -pub struct SignedNostrEventWire { +pub struct SignedEventWire { pub id: String, pub pubkey: String, pub created_at: u64, @@ -267,7 +267,7 @@ pub struct SignedNostrEventWire { pub sig: String, } -impl SignedNostrEventWire { +impl SignedEventWire { pub fn validate(&self) -> Result<(), TransportPublishProtocolError> { validate_lower_hex("id", self.id.as_str(), 64)?; validate_lower_hex("pubkey", self.pubkey.as_str(), 64)?; @@ -647,7 +647,7 @@ fn validate_required_target_fingerprints( #[cfg_attr(feature = "serde", serde(deny_unknown_fields))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct TransportPublishEventRequest { - pub event: SignedNostrEventWire, + pub event: SignedEventWire, pub target_policy: TransportPublishTargetPolicy, pub delivery_policy: TransportPublishDeliveryPolicy, #[cfg_attr( @@ -1358,8 +1358,8 @@ fn validate_job_status_state( mod tests { use super::*; - fn event() -> SignedNostrEventWire { - SignedNostrEventWire { + fn event() -> SignedEventWire { + SignedEventWire { id: "0".repeat(64), pubkey: "1".repeat(64), created_at: 1_700_000_000,