Skip to content

Commit

Permalink
Fixed emulator test crash
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Jan 4, 2025
1 parent 719ead9 commit fef585f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import org.kodein.di.DI
import org.kodein.di.DIAware
import org.kodein.di.instance
import rust.nostr.sdk.Alphabet
import rust.nostr.sdk.Client
import rust.nostr.sdk.Coordinate
import rust.nostr.sdk.Event
import rust.nostr.sdk.Filter
Expand All @@ -58,6 +57,7 @@ import java.time.Duration
import java.time.Instant
import java.time.ZoneId
import java.util.Locale
import rust.nostr.sdk.Client as NostrClient

private const val YOUTUBE_CHANNEL_ID_ATTR = "data-channel-external-id"

Expand All @@ -66,7 +66,10 @@ class FeedParser(override val di: DI) : DIAware {
private val goFeedAdapter = GoFeedAdapter()

// Initializing the Nostr Client
private val nostrClient = Client()
// This can crash in emulator tests so initialize it lazily.
private val nostrClient by lazy {
NostrClient()
}

// The default relays to get info from, separated by purpose.
private val defaultFetchRelays = listOf("wss://relay.nostr.band", "wss://relay.damus.io")
Expand Down

0 comments on commit fef585f

Please sign in to comment.