Skip to content

Commit 843eb1d

Browse files
committed
fix(deps): migrate manifest_event + transport to nostr 0.44 API
PR #726 introduced new code using old nostr 0.36 patterns: - EventBuilder::new() 3-arg form → 2-arg + .tags() - PublicKey::serialize() → .to_bytes() - Tag::parse(&[...]) → Tag::parse([...]) in e2e_git tests
1 parent 2e3000e commit 843eb1d

3 files changed

Lines changed: 16 additions & 22 deletions

File tree

crates/sprout-relay/src/api/git/manifest_event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn build_ref_state_event(
109109
// p-tag: sprout extension (pusher or owner pubkey).
110110
tags.push(Tag::public_key(actor));
111111

112-
let event = EventBuilder::new(Kind::Custom(30618), "", tags)
112+
let event = EventBuilder::new(Kind::Custom(30618), "").tags(tags)
113113
.sign_with_keys(relay_keys)
114114
.map_err(|e| BuildError::Sign(e.to_string()))?;
115115

crates/sprout-relay/src/api/git/transport.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ async fn finalize_push(state: &Arc<AppState>, ctx: PushContext) -> Response {
762762
repo_id: &ctx.repo_id,
763763
head: &success.manifest.head,
764764
refs: &success.manifest.refs,
765-
actor_pubkey_hex: &hex::encode(ctx.pusher.serialize()),
765+
actor_pubkey_hex: &hex::encode(ctx.pusher.to_bytes()),
766766
};
767767
match build_ref_state_event(&inputs, &state.relay_keypair) {
768768
Ok(event) => match state.db.insert_event(&event, None).await {

crates/sprout-test-client/tests/e2e_git.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,13 @@ async fn git_clone_push_fetch_force_roundtrip() {
201201
let s3 = GitS3Probe::from_env();
202202

203203
// Announce the repo (kind:30617) so the relay creates the bare repo + hook.
204-
let announce = EventBuilder::new(
205-
Kind::from(30617),
206-
"",
207-
vec![
208-
Tag::parse(&["d", &repo]).unwrap(),
209-
Tag::parse(&["name", "e2e git repo"]).unwrap(),
210-
],
211-
)
212-
.sign_with_keys(&owner)
213-
.unwrap();
204+
let announce = EventBuilder::new(Kind::from(30617), "")
205+
.tags(vec![
206+
Tag::parse(["d", &repo]).unwrap(),
207+
Tag::parse(["name", "e2e git repo"]).unwrap(),
208+
])
209+
.sign_with_keys(&owner)
210+
.unwrap();
214211
post_event(&announce).await;
215212
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
216213

@@ -341,16 +338,13 @@ async fn git_concurrent_push_one_wins_and_repo_recovers() {
341338
let repo = format!("e2e-git-concurrent-{}", std::process::id());
342339
let s3 = GitS3Probe::from_env();
343340

344-
let announce = EventBuilder::new(
345-
Kind::from(30617),
346-
"",
347-
vec![
348-
Tag::parse(&["d", &repo]).unwrap(),
349-
Tag::parse(&["name", "e2e concurrent git repo"]).unwrap(),
350-
],
351-
)
352-
.sign_with_keys(&owner)
353-
.unwrap();
341+
let announce = EventBuilder::new(Kind::from(30617), "")
342+
.tags(vec![
343+
Tag::parse(["d", &repo]).unwrap(),
344+
Tag::parse(["name", "e2e concurrent git repo"]).unwrap(),
345+
])
346+
.sign_with_keys(&owner)
347+
.unwrap();
354348
post_event(&announce).await;
355349
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
356350

0 commit comments

Comments
 (0)