Skip to content

Commit

Permalink
correct the kind
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanmontz committed Aug 20, 2023
1 parent 97b9f70 commit ad2dc97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/NostrSDK/Events/GenericRepostEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class GenericRepostEvent: NostrEvent {
}

class var kind: EventKind {
.repost
.genericRepost
}

/// The pubkey of the reposted event.
Expand Down
3 changes: 3 additions & 0 deletions Tests/NostrSDKTests/EventCreatingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ final class EventCreatingTests: XCTestCase, EventCreating, EventVerifying, Fixtu
let event = try repost(event: noteToRepost, signedBy: Keypair.test)
let repostEvent = try XCTUnwrap(event as? TextNoteRepostEvent)

XCTAssertEqual(repostEvent.kind, .repost)

XCTAssertTrue(repostEvent.tags.contains(Tag(name: .pubkey, value: "82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2")))
XCTAssertTrue(repostEvent.tags.contains(Tag(name: .event, value: "fa5ed84fc8eeb959fd39ad8e48388cfc33075991ef8e50064cfcecfd918bb91b")))

Expand Down Expand Up @@ -162,6 +164,7 @@ final class EventCreatingTests: XCTestCase, EventCreating, EventVerifying, Fixtu

let repostEvent = try repost(event: eventToRepost, signedBy: Keypair.test)
XCTAssertFalse(repostEvent is TextNoteRepostEvent)
XCTAssertEqual(repostEvent.kind, .genericRepost)

XCTAssertTrue(repostEvent.tags.contains(Tag(name: .pubkey, value: "test-pubkey")))
XCTAssertTrue(repostEvent.tags.contains(Tag(name: .event, value: "test-id")))
Expand Down

0 comments on commit ad2dc97

Please sign in to comment.