upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/nostr/policy
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-08 00:50:54 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-08 00:50:54 +0000
commitf75e1c59aacf5ce668fd327e4e3d827511661c2a (patch)
tree867926c7503e7c587e86c67896a9e7347600447b /src/nostr/policy
parent3f14f998d64b5fa15bdddd7570b4f72874eb9f29 (diff)
chore: cargo fmt
Diffstat (limited to 'src/nostr/policy')
-rw-r--r--src/nostr/policy/pr_event.rs1
-rw-r--r--src/nostr/policy/state.rs10
2 files changed, 6 insertions, 5 deletions
diff --git a/src/nostr/policy/pr_event.rs b/src/nostr/policy/pr_event.rs
index 9942a6a..00e09c3 100644
--- a/src/nostr/policy/pr_event.rs
+++ b/src/nostr/policy/pr_event.rs
@@ -237,5 +237,4 @@ impl PrEventPolicy {
237 237
238 Ok(repo_paths) 238 Ok(repo_paths)
239 } 239 }
240
241} 240}
diff --git a/src/nostr/policy/state.rs b/src/nostr/policy/state.rs
index 7bbb379..acb76a3 100644
--- a/src/nostr/policy/state.rs
+++ b/src/nostr/policy/state.rs
@@ -9,8 +9,8 @@ use nostr_relay_builder::builder::WritePolicyResult;
9use nostr_relay_builder::prelude::Event; 9use nostr_relay_builder::prelude::Event;
10 10
11use super::PolicyContext; 11use super::PolicyContext;
12use crate::git::authorization::fetch_repository_data;
13use crate::git; 12use crate::git;
13use crate::git::authorization::fetch_repository_data;
14use crate::nostr::events::{validate_state, RepositoryAnnouncement, RepositoryState}; 14use crate::nostr::events::{validate_state, RepositoryAnnouncement, RepositoryState};
15 15
16/// Result of state policy evaluation 16/// Result of state policy evaluation
@@ -48,7 +48,11 @@ impl StatePolicy {
48 /// * `is_synced` - True if this event came from proactive sync (vs user-submitted) 48 /// * `is_synced` - True if this event came from proactive sync (vs user-submitted)
49 /// 49 ///
50 /// Returns the true if git data already availale or false if added to purgatory 50 /// Returns the true if git data already availale or false if added to purgatory
51 pub async fn process_state_event(&self, event: &Event, is_synced: bool) -> Result<WritePolicyResult> { 51 pub async fn process_state_event(
52 &self,
53 event: &Event,
54 is_synced: bool,
55 ) -> Result<WritePolicyResult> {
52 // Parse state to get HEAD and branch info 56 // Parse state to get HEAD and branch info
53 let state = 57 let state =
54 RepositoryState::from_event(event.clone()).context("Failed to parse state event")?; 58 RepositoryState::from_event(event.clone()).context("Failed to parse state event")?;
@@ -155,8 +159,6 @@ impl StatePolicy {
155 }) 159 })
156 } 160 }
157 } 161 }
158
159
160} 162}
161 163
162fn find_repo_with_git_data( 164fn find_repo_with_git_data(