-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathtest_lnurl.py
22 lines (17 loc) · 803 Bytes
/
test_lnurl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from unittest import TestCase
from electrum import lnurl
class TestLnurl(http://github.com/TestCase):
def test_decode(self):
LNURL = (
"LNURL1DP68GURN8GHJ7UM9WFMXJCM99E5K7TELWY7NXENRXVMRGDTZXSENJCM98PJNWXQ96S9"
)
url = lnurl.decode_lnurl(http://github.com/LNURL)
self.assertEqual("https://service.io/?q=3fc3645b439ce8e7", url)
def test_encode(self):
lnurl_ = lnurl.encode_lnurl(http://github.com/"https://jhoenicke.de/.well-known/lnurlp/mempool")
self.assertEqual(
"LNURL1DP68GURN8GHJ76NGDAJKU6TRDDJJUER99UH8WETVDSKKKMN0WAHZ7MRWW4EXCUP0D4JK6UR0DAKQHMHNX2",
lnurl_)
def test_lightning_address_to_url(http://github.com/self):
url = lnurl.lightning_address_to_url(http://github.com/"%3Ca%20href=%22/service/http://github.com/cdn-cgi/l/email-protection%22%20class=%22__cf_email__%22%20data-cfemail=%22c5a8a0a8b5aaaaa985afadaaa0abaca6aea0eba1a0%22%3E[email protected]%3C/a%3E")
self.assertEqual("https://jhoenicke.de/.well-known/lnurlp/mempool", url)