go-nostr/helpers_test.go

26 lines
19 KiB
Go
Raw Permalink Normal View History

package nostr
import (
"testing"
2024-10-14 16:18:32 -03:00
"github.com/stretchr/testify/assert"
)
var s = []string{"wss://relay.damus.io", "wss://nostr.mom", "wss://nostr.slothy.win", "wss://relay.stoner.com", "wss://nostr.einundzwanzig.space", "wss://nos.lol", "wss://relay.nostr.band", "wss://relay.oldcity-bitcoiners.info", "wss://nostr.massmux.com", "wss://nostr-relay.schnitzel.world", "wss://relay.nostr.com.au", "wss://knostr.neutrine.com", "wss://nostr.nodeofsven.com", "wss://nostr.vulpem.com", "wss://relay.farscapian.com", "wss://relay.sovereign-stack.org", "wss://relay.lexingtonbitcoin.org", "wss://relay-pub.deschooling.us", "wss://nostr.easydns.ca", "wss://relay.dwadziesciajeden.pl", "wss://nostr.600.wtf", "wss://e.nos.lol", "wss://ragnar-relay.com", "wss://nostr.data.haus", "wss://nostr.wine", "wss://nostr.koning-degraaf.nl", "wss://nostr.cheeserobot.org", "wss://nostr.thank.eu", "wss://relay.hamnet.io", "wss://nostr.blockpower.capital", "wss://nostr.sidnlabs.nl", "wss://nostr.inosta.cc", "wss://nostr21.com", "wss://arc1.arcadelabs.co", "wss://nostr.ch3n2k.com", "wss://relay.nostrview.com", "wss://relay.nostromo.social", "wss://offchain.pub", "wss://relay.nostr.wirednet.jp", "wss://nostr.l00p.org", "wss://lightningrelay.com", "wss://bitcoinmaximalists.online", "wss://private.red.gb.net", "wss://relay.nostrid.com", "wss://nostr.uthark.com", "wss://relay.nostrcheck.me", "wss://nostrelay.yeghro.site", "wss://relay.nostr.vet", "wss://nostr.yuv.al", "wss://nostrue.com", "wss://nostr.danvergara.com", "wss://nproxy.kristapsk.lv", "wss://nostr.topeth.info", "wss://nostr.bitcoiner.social", "wss://relay.orange-crush.com", "wss://nostr.spaceshell.xyz", "wss://nostr.screaminglife.io", "wss://nostr.roundrockbitcoiners.com", "wss://relay.f7z.io", "wss://relay.nostrology.org", "wss://nostr.bch.ninja", "wss://relay.nostrati.com", "wss://nostr-relay.nokotaro.com", "wss://relay.snort.social", "wss://nostr.lu.ke", "wss://atlas.nostr.land", "wss://nostr.fmt.wiz.biz", "wss://global-relay.cesc.trade", "wss://nostr.pjv.me", "wss://relay.roli.social", "wss://brb.io", "wss://eden.nostr.land", "wss://nostr-verified.wellorder.net", "wss://nostr.noones.com", "wss://relay.nostr.nu", "wss://nostr-relay.bitcoin.ninja", "wss://deschooling.us", "wss://freespeech.casa", "wss://bitcoiner.social", "wss://nostr.1f52b.xyz", "wss://nostr.sebastix.dev", "wss://relay-verified.deschooling.us", "wss://nostr.cizmar.net", "wss://n.wingu.se", "wss://relay.nostr.hach.re", "wss://nostr.bitcoinplebs.de", "wss://nostr.corebreach.com", "wss://tmp-relay.cesc.trade", "wss://nostr.mutinywallet.com", "wss://nostr.decentony.com", "wss://nostr.tools.global.id", "wss://xmr.usenostr.org", "wss://nostr.naut.social", "wss://at.nostrworks.com", "wss://nostr.sovbit.host", "wss://nostr.1sat.org", "wss://mastodon.cloud/api/v1/streaming", "wss://nostr.256k1.dev", "wss://relay.beta.fogtype.com", "wss://rsslay.ch3n2k.com", "wss://nostr.rocketnode.space", "wss://relay.nostr.bg", "wss://nostr.malin.onl", "wss://nostr.globals.fans", "wss://nostr.primz.org", "wss://relay.johnnyasantos.com", "wss://btc.klendazu.com", "wss://relay.n057r.club", "wss://slick.mjex.me", "wss://nostr.lorentz.is", "wss://relay.nostrified.org", "wss://relay.primal.net", "wss://nostr.cercatrova.me", "wss://nostr.swiss-enigma.ch", "wss://relay.honk.pw", "wss://nostr-relay.derekross.me", "wss://puravida.nostr.land", "wss://nostr.sectiontwo.org", "wss://nostr.oxtr.dev", "wss://relay.s3x.social", "wss://eosla.com", "wss://nostr.liberty.fans", "wss://nostr.cro.social", "wss://nostrrelay.com", "wss://nostr-pub.semisol.dev", "wss://nostr.semisol.dev", "wss://misskey.io", "wss://nostr.pobblelabs.org", "wss://relay.nostr.wf", "wss://nostr.land", "wss://btcpay.kukks.org/nostr/ws", "wss://relay.mostr.pub", "wss://relay.nostrplebs.com", "wss://purplepag.es", "wss://yestr.me", "wss://relayable.org", "wss://paid.nostrified.org", "wss://nostr-02.dorafactory.org", "wss://nostr.zbd.gg", "wss://relay.hodl.ar", "wss://relay.nostr.sc", "wss://feeds.nostr.band/nostrhispano", "wss://nostr.portemonero.com", "wss://search.nos.today", "wss://relay.minds.com/nostr/v1/ws", "wss://welcome.nostr.wine", "wss://yabu.me", "wss://adult.1
func TestNamedLock(t *testing.T) {
for _, url := range s {
unlock := namedLock(url)
unlock()
}
}
2024-10-14 16:18:32 -03:00
func TestIsLower(t *testing.T) {
assert.True(t, isLowerHex("407ec11ef384327fb3e69d45fe24804e87f6b4bbc889e839fe67e2b01607fd08"))
assert.True(t, isLowerHex("07ec11ef384327fb3e69d45fe24"))
assert.False(t, isLowerHex("407ec11ef384327Fb3e69d45fe24804e87f6b4bbc889e839fe67e2b01607fd08"))
assert.False(t, isLowerHex("07Ec11ef384327fb3e69d45fe24"))
assert.False(t, isLowerHex("KJBADFLKJBASD"))
assert.False(t, isLowerHex("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))
}