Update nostr-sdk and adapt to new EventBuilder API
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-16 20:52:32 +07:00
parent fae72b7adb
commit ad6e00b4b9
15 changed files with 234 additions and 158 deletions
+2 -2
View File
@@ -171,7 +171,7 @@ mod tests {
.map(|t| Tag::parse(t.to_vec()).expect("valid tag"))
.collect();
EventBuilder::new(Kind::GitRepoAnnouncement, "")
EventBuilder::new(Kind::GitRepoAnnouncement)
.tags(tags)
.finalize(&keys())
.expect("signed event")
@@ -375,7 +375,7 @@ mod tests {
.iter()
.map(|t| Tag::parse(t.to_vec()).expect("valid tag"))
.collect();
EventBuilder::new(Kind::GitRepoAnnouncement, "")
EventBuilder::new(Kind::GitRepoAnnouncement)
.tags(tags)
.finalize(&keys)
.expect("signed event")
+1 -1
View File
@@ -182,7 +182,7 @@ mod tests {
}
fn signed(author: &Keys, kind: Kind, tags: Vec<Tag>) -> Event {
EventBuilder::new(kind, "")
EventBuilder::new(kind)
.tags(tags)
.finalize(author)
.expect("signed event")
+1 -1
View File
@@ -90,7 +90,7 @@ mod tests {
/// Builds a signed event with a fixed timestamp.
fn signed(author: &Keys, kind: Kind, tags: Vec<Tag>, created_at: u64) -> Event {
EventBuilder::new(kind, "")
EventBuilder::new(kind)
.tags(tags)
.custom_created_at(Timestamp::from_secs(created_at))
.finalize(author)
+1 -1
View File
@@ -152,7 +152,7 @@ mod tests {
/// Builds a signed event with a fixed timestamp.
fn signed(author: &Keys, kind: Kind, tags: Vec<Tag>, created_at: u64) -> Event {
EventBuilder::new(kind, "")
EventBuilder::new(kind)
.tags(tags)
.custom_created_at(Timestamp::from_secs(created_at))
.finalize(author)
+6 -4
View File
@@ -131,7 +131,8 @@ mod tests {
/// Builds a signed pull request event.
fn pr_event(content: &str, tags: Vec<Tag>) -> Event {
EventBuilder::new(Kind::GitPullRequest, content)
EventBuilder::new(Kind::GitPullRequest)
.content(content)
.tags(tags)
.finalize(&keys())
.expect("signed event")
@@ -139,7 +140,8 @@ mod tests {
/// Builds a signed patch event with a fixed timestamp.
fn patch_event(content: &str, tags: Vec<Tag>, created_at: u64) -> Event {
EventBuilder::new(Kind::GitPatch, content)
EventBuilder::new(Kind::GitPatch)
.content(content)
.tags(tags)
.custom_created_at(Timestamp::from(created_at))
.finalize(&keys())
@@ -214,7 +216,7 @@ mod tests {
/// Builds a signed event with a fixed timestamp.
fn signed_at(kind: Kind, tags: Vec<Tag>, created_at: u64) -> Event {
EventBuilder::new(kind, "")
EventBuilder::new(kind)
.tags(tags)
.custom_created_at(Timestamp::from(created_at))
.finalize(&keys())
@@ -268,7 +270,7 @@ mod tests {
SecretKey::from_hex("0000000000000000000000000000000000000000000000000000000000000002")
.expect("valid secret key"),
);
let stranger = EventBuilder::new(Kind::GitPullRequestUpdate, "")
let stranger = EventBuilder::new(Kind::GitPullRequestUpdate)
.tags([Tag::parse(["E", &root_hex]).expect("valid tag")])
.custom_created_at(Timestamp::from(999))
.finalize(&other)
+2 -2
View File
@@ -63,7 +63,7 @@ mod tests {
}
fn status_event(author: &Keys, kind: Kind, root: EventId, created_at: u64) -> Event {
EventBuilder::new(kind, "")
EventBuilder::new(kind)
.tags([Tag::event(root)])
.custom_created_at(Timestamp::from(created_at))
.finalize(author)
@@ -73,7 +73,7 @@ mod tests {
#[test]
fn references_root_matches_e_tag() {
let root = root_event_id();
let event = EventBuilder::new(Kind::GitStatusOpen, "")
let event = EventBuilder::new(Kind::GitStatusOpen)
.tags([Tag::event(root)])
.finalize(&keys_from_hex(
"0000000000000000000000000000000000000000000000000000000000000001",