From 3845d32074aa8eed4a504a412b682edefadc692f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 13 Jul 2023 06:55:21 -0700 Subject: [PATCH] test: add test data file We can organize test data in here --- damus/TestData.swift | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 damus/TestData.swift diff --git a/damus/TestData.swift b/damus/TestData.swift new file mode 100644 index 00000000..c08fe092 --- /dev/null +++ b/damus/TestData.swift @@ -0,0 +1,29 @@ +// +// TestData.swift +// damus +// +// Created by William Casarin on 2023-07-13. +// + +import Foundation + + +let test_event_holder = EventHolder(events: [], incoming: [test_event]) + +let test_event = + NostrEvent( + content: "hello there https://jb55.com/s/Oct12-150217.png https://jb55.com/red-me.jpg cool", + pubkey: "pk", + createdAt: Int64(Date().timeIntervalSince1970 - 100) + ) + +func test_damus_state() -> DamusState { + let pubkey = "3efdaebb1d8923ebd99c9e7ace3b4194ab45512e2be79c1b7d68d9243e0d2681" + let damus = DamusState.empty + + let prof = Profile(name: "damus", display_name: "damus", about: "iOS app!", picture: "https://damus.io/img/logo.png", banner: "", website: "https://damus.io", lud06: nil, lud16: "jb55@sendsats.lol", nip05: "damus.io", damus_donation: nil) + let tsprof = TimestampedProfile(profile: prof, timestamp: 0, event: test_event) + damus.profiles.add(id: pubkey, profile: tsprof) + return damus +} +