damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 7b73a54de587945b88bf52463abfc65ad9fc4395
parent fdaf785869b40848ded07eee04b5ecb80bde5b2f
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 13 Jul 2023 07:01:51 -0700

test: switch to test data file

We only added the file before, let's actually use it now

Diffstat:
Mdamus.xcodeproj/project.pbxproj | 4++++
Mdamus/Views/EventView.swift | 7-------
Mdamus/Views/Profile/ProfileView.swift | 10----------
Mdamus/Views/Timeline/InnerTimelineView.swift | 2--
4 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj @@ -144,6 +144,7 @@ 4C64987E286D082C00EAE2B3 /* DirectMessagesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C64987D286D082C00EAE2B3 /* DirectMessagesModel.swift */; }; 4C649881286E0EE300EAE2B3 /* secp256k1 in Frameworks */ = {isa = PBXBuildFile; productRef = 4C649880286E0EE300EAE2B3 /* secp256k1 */; }; 4C687C212A5F7ED00092C550 /* DamusBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C687C202A5F7ED00092C550 /* DamusBackground.swift */; }; + 4C687C272A6039500092C550 /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C687C262A6039500092C550 /* TestData.swift */; }; 4C73C5142A4437C10062CAC0 /* ZapUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C73C5132A4437C10062CAC0 /* ZapUserView.swift */; }; 4C75EFA427FA577B0006080F /* PostView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C75EFA327FA577B0006080F /* PostView.swift */; }; 4C75EFA627FF87A20006080F /* Nostr.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C75EFA527FF87A20006080F /* Nostr.swift */; }; @@ -618,6 +619,7 @@ 4C64987B286D03E000EAE2B3 /* DirectMessagesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DirectMessagesView.swift; sourceTree = "<group>"; }; 4C64987D286D082C00EAE2B3 /* DirectMessagesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DirectMessagesModel.swift; sourceTree = "<group>"; }; 4C687C202A5F7ED00092C550 /* DamusBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusBackground.swift; sourceTree = "<group>"; }; + 4C687C262A6039500092C550 /* TestData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestData.swift; sourceTree = "<group>"; }; 4C73C5132A4437C10062CAC0 /* ZapUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZapUserView.swift; sourceTree = "<group>"; }; 4C75EFA327FA577B0006080F /* PostView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostView.swift; sourceTree = "<group>"; }; 4C75EFA527FF87A20006080F /* Nostr.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Nostr.swift; sourceTree = "<group>"; }; @@ -1471,6 +1473,7 @@ 4CE6DEEA27F7A08200C66700 /* Assets.xcassets */, 4CE6DEEC27F7A08200C66700 /* Preview Content */, 3A4325AA2961E11400BFCD9D /* Localizable.stringsdict */, + 4C687C262A6039500092C550 /* TestData.swift */, ); path = damus; sourceTree = "<group>"; @@ -1858,6 +1861,7 @@ 4C75EFB92804A2740006080F /* EventView.swift in Sources */, 4C8D00C829DF791C0036AF10 /* CompatibleAttribute.swift in Sources */, 4C7D09742A0AEF9000943473 /* AlbyGradient.swift in Sources */, + 4C687C272A6039500092C550 /* TestData.swift in Sources */, 3AA247FD297E3CFF0090C62D /* RepostsModel.swift in Sources */, 4C198DF229F88C6B004C165C /* BlurHashDecode.swift in Sources */, F75BA12F29A18EF500E10810 /* BookmarksView.swift in Sources */, diff --git a/damus/Views/EventView.swift b/damus/Views/EventView.swift @@ -151,10 +151,3 @@ struct EventView_Previews: PreviewProvider { } } -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) - ) - diff --git a/damus/Views/Profile/ProfileView.swift b/damus/Views/Profile/ProfileView.swift @@ -538,16 +538,6 @@ struct ProfileView_Previews: PreviewProvider { } } -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 -} - struct KeyView: View { let pubkey: String diff --git a/damus/Views/Timeline/InnerTimelineView.swift b/damus/Views/Timeline/InnerTimelineView.swift @@ -71,8 +71,6 @@ struct InnerTimelineView: View { } } -let test_event_holder = EventHolder(events: [], incoming: [test_event]) - struct InnerTimelineView_Previews: PreviewProvider { static var previews: some View { InnerTimelineView(events: test_event_holder, damus: test_damus_state(), filter: { _ in true })