Extract PatchSeries module and remove require_relay_accepted helper
This commit is contained in:
@@ -21,9 +21,7 @@ use crate::bootstrap::{
|
||||
};
|
||||
use crate::git_store::Mirrors;
|
||||
use crate::inbox::Inbox;
|
||||
use crate::push::{
|
||||
PushOutcome, grasp_base_url, grasp_clone_url, push_staged_to_grasps, require_relay_accepted,
|
||||
};
|
||||
use crate::push::{PushOutcome, grasp_base_url, grasp_clone_url, push_staged_to_grasps};
|
||||
use crate::repos::RepoListStore;
|
||||
|
||||
pub const USER_KEYRING: &str = "Signed Safe Storage";
|
||||
@@ -464,7 +462,16 @@ impl Backend {
|
||||
cx.background_spawn(async move {
|
||||
let event = builder.finalize_async(&signer).await?;
|
||||
let output = client.send_event(&event).broadcast().await?;
|
||||
require_relay_accepted(output, event)?;
|
||||
|
||||
if output.success.is_empty() && !output.failed.is_empty() {
|
||||
let reasons = output
|
||||
.failed
|
||||
.values()
|
||||
.cloned()
|
||||
.collect::<Vec<String>>()
|
||||
.join(", ");
|
||||
bail!("event not accepted by any relay: {reasons}");
|
||||
}
|
||||
|
||||
Ok::<(), anyhow::Error>(())
|
||||
})
|
||||
@@ -1202,12 +1209,18 @@ async fn announce_repository_and_push(
|
||||
client.add_relay(url).and_connect().await.ok();
|
||||
}
|
||||
|
||||
let event = {
|
||||
let builder = announcement.into_event_builder();
|
||||
let event = builder.finalize_async(signer).await?;
|
||||
let output = client.send_event(&event).broadcast().await?;
|
||||
require_relay_accepted(output, event)?
|
||||
};
|
||||
let event = announcement.finalize_async(signer).await?;
|
||||
let output = client.send_event(&event).broadcast().await?;
|
||||
|
||||
if output.success.is_empty() && !output.failed.is_empty() {
|
||||
let reasons = output
|
||||
.failed
|
||||
.values()
|
||||
.cloned()
|
||||
.collect::<Vec<String>>()
|
||||
.join(", ");
|
||||
bail!("event not accepted by any relay: {reasons}");
|
||||
}
|
||||
|
||||
// The state event is the push authorization.
|
||||
let outcome = if refs.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user