Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,719 changes: 2,719 additions & 0 deletions crates/buzz-test-client/src/loadgen/desktop.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/buzz-test-client/src/loadgen/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use nostr::{EventBuilder, JsonUtil, Keys, Kind, SecretKey, Tag};
use sha2::{Digest, Sha256};

/// Role of a derived identity; part of the derivation so roles never collide.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Role {
Owner,
Human,
Expand Down
1 change: 1 addition & 0 deletions crates/buzz-test-client/src/loadgen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! scenario's `run_id`, so independent shards (`--shard i/n`) agree on the
//! fixture without sharing state.

pub mod desktop;
pub mod identity;
pub mod net;
pub mod run;
Expand Down
12 changes: 12 additions & 0 deletions crates/buzz-test-client/src/loadgen/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ impl Net {
Ok((status, response.text().await?))
}

/// `GET {base}/` for the relay's NIP-11 information document.
pub async fn relay_info(&self, base: &str) -> anyhow::Result<(reqwest::StatusCode, String)> {
let response = self
.http
.get(self.transport_url(&format!("{base}/")))
.header("Accept", "application/nostr+json")
.send()
.await?;
let status = response.status();
Ok((status, response.text().await?))
}

/// Submits `event` through HTTP `/events`; errors unless the relay accepted it.
pub async fn submit(
&self,
Expand Down
Loading
Loading