forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_runes.py
495 lines (418 loc) · 23 KB
/
test_runes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from pyln.client import RpcError
from utils import only_one
import base64
import os
import pytest
import time
import unittest
def test_createrune(node_factory):
l1 = node_factory.get_node()
# l1's master rune secret is edb8893c04fdeef8f5f06ed70edef309a5c83f20624594e136e392504a270c40
rune1 = l1.rpc.createrune()
assert rune1['rune'] == 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA=='
assert rune1['unique_id'] == '0'
rune2 = l1.rpc.createrune(restrictions="readonly")
assert rune2['rune'] == 'zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl'
assert rune2['unique_id'] == '1'
rune3 = l1.rpc.createrune(restrictions=[["time>1656675211"]])
assert rune3['rune'] == 'mxHwVsC_W-PH7r79wXQWqxBNHaHncIqIjEPyP_vGOsE9MiZ0aW1lPjE2NTY2NzUyMTE='
assert rune3['unique_id'] == '2'
rune4 = l1.rpc.createrune(restrictions=[["id^022d223620a359a47ff7"], ["method=listpeers"]])
assert rune4['rune'] == 'YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz'
assert rune4['unique_id'] == '3'
rune5 = l1.rpc.commando_rune(rune4['rune'], [["pnamelevel!", "pnamelevel/io"]])
assert rune5['rune'] == 'Zm7A2mKkLnd5l6Er_OMAHzGKba97ij8lA-MpNYMw9nk9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8='
assert rune5['unique_id'] == '3'
rune6 = l1.rpc.commando_rune(rune5['rune'], [["parr1!", "parr1/io"]])
assert rune6['rune'] == 'm_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv'
assert rune6['unique_id'] == '3'
rune7 = l1.rpc.createrune(restrictions=[["pnum=0"]])
assert rune7['rune'] == 'enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA='
assert rune7['unique_id'] == '4'
rune8 = l1.rpc.createrune(rune7['rune'], [["rate=3"]])
assert rune8['rune'] == '_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z'
assert rune8['unique_id'] == '4'
rune9 = l1.rpc.createrune(rune8['rune'], [["rate=1"]])
assert rune9['rune'] == 'U1GDXqXRvfN1A4WmDVETazU9YnvMsDyt7WwNzpY0khE9NCZwbnVtPTAmcmF0ZT0zJnJhdGU9MQ=='
assert rune9['unique_id'] == '4'
# Test rune with \|.
weirdrune = l1.rpc.createrune(restrictions=[["method=invoice"],
["pnamedescription=@tipjar|[email protected]"]])
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=weirdrune['rune'],
method='invoice',
params={"amount_msat": "any",
"label": "lbl",
"description": "@tipjar\\|[email protected]"})
assert exc_info.value.error['code'] == 0x5de
assert l1.rpc.checkrune(nodeid=l1.info['id'],
rune=weirdrune['rune'],
method='invoice',
params={"amount_msat": "any",
"label": "lbl",
"description": "@tipjar|[email protected]"})['valid'] is True
runedecodes = ((rune1, []),
(rune2, [{'alternatives': ['method^list', 'method^get', 'method=summary'],
'summary': "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'"},
{'alternatives': ['method/listdatastore'],
'summary': "method (of command) unequal to 'listdatastore'"}]),
(rune4, [{'alternatives': ['id^022d223620a359a47ff7'],
'summary': "id (of commanding peer) starts with '022d223620a359a47ff7'"},
{'alternatives': ['method=listpeers'],
'summary': "method (of command) equal to 'listpeers'"}]),
(rune5, [{'alternatives': ['id^022d223620a359a47ff7'],
'summary': "id (of commanding peer) starts with '022d223620a359a47ff7'"},
{'alternatives': ['method=listpeers'],
'summary': "method (of command) equal to 'listpeers'"},
{'alternatives': ['pnamelevel!', 'pnamelevel/io'],
'summary': "pnamelevel (object parameter 'level') is missing OR pnamelevel (object parameter 'level') unequal to 'io'"}]),
(rune6, [{'alternatives': ['id^022d223620a359a47ff7'],
'summary': "id (of commanding peer) starts with '022d223620a359a47ff7'"},
{'alternatives': ['method=listpeers'],
'summary': "method (of command) equal to 'listpeers'"},
{'alternatives': ['pnamelevel!', 'pnamelevel/io'],
'summary': "pnamelevel (object parameter 'level') is missing OR pnamelevel (object parameter 'level') unequal to 'io'"},
{'alternatives': ['parr1!', 'parr1/io'],
'summary': "parr1 (array parameter #1) is missing OR parr1 (array parameter #1) unequal to 'io'"}]),
(rune7, [{'alternatives': ['pnum=0'],
'summary': "pnum (number of command parameters) equal to 0"}]),
(rune8, [{'alternatives': ['pnum=0'],
'summary': "pnum (number of command parameters) equal to 0"},
{'alternatives': ['rate=3'],
'summary': "rate (max per minute) equal to 3"}]),
(rune9, [{'alternatives': ['pnum=0'],
'summary': "pnum (number of command parameters) equal to 0"},
{'alternatives': ['rate=3'],
'summary': "rate (max per minute) equal to 3"},
{'alternatives': ['rate=1'],
'summary': "rate (max per minute) equal to 1"}]))
for decode in runedecodes:
rune = decode[0]
restrictions = decode[1]
decoded = l1.rpc.decode(rune['rune'])
assert decoded['type'] == 'rune'
assert decoded['unique_id'] == rune['unique_id']
assert decoded['valid'] is True
assert decoded['restrictions'] == restrictions
# Time handling is a bit special, since we annotate the timestamp with how far away it is.
decoded = l1.rpc.decode(rune3['rune'])
assert decoded['type'] == 'rune'
assert decoded['unique_id'] == rune3['unique_id']
assert decoded['valid'] is True
assert len(decoded['restrictions']) == 1
assert decoded['restrictions'][0]['alternatives'] == ['time>1656675211']
assert decoded['restrictions'][0]['summary'].startswith("time (in seconds since 1970) greater than 1656675211 (")
# Replace rune3 with a more useful timestamp!
expiry = int(time.time()) + 15
rune3 = l1.rpc.createrune(restrictions=[["time<{}".format(expiry)]])
successes = ((rune1, "listpeers", {}),
(rune2, "listpeers", {}),
(rune2, "getinfo", {}),
(rune2, "getinfo", {}),
(rune3, "getinfo", {}),
(rune7, "listpeers", []),
(rune7, "getinfo", {}),
(rune9, "getinfo", {}),
(rune8, "getinfo", {}),
(rune8, "getinfo", {}))
failures = ((rune2, "withdraw", {}),
(rune2, "plugin", {'subcommand': 'list'}),
(rune3, "getinfo", {}),
(rune4, "listnodes", {}),
(rune5, "listpeers", {'id': l1.info['id'], 'level': 'io'}),
(rune6, "listpeers", [l1.info['id'], 'io']),
(rune7, "listpeers", [l1.info['id']]),
(rune7, "listpeers", {'id': l1.info['id']}))
for rune, cmd, params in successes:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune['rune'],
method=cmd,
params=params)['valid'] is True
while time.time() < expiry:
time.sleep(1)
for rune, cmd, params in failures:
print("{} {}".format(cmd, params))
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune['rune'],
method=cmd,
params=params)
assert exc_info.value.error['code'] == 0x5de
# Now, this can flake if we cross a minute boundary! So wait until
# It succeeds again.
while True:
try:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune8['rune'],
method='getinfo')
break
except RpcError as e:
assert e.error['code'] == 0x5de
time.sleep(1)
# This fails immediately, since we've done one.
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune9['rune'],
method='getinfo',
params={})
assert exc_info.value.error['code'] == 0x5de
# Two more succeed for rune8.
for _ in range(2):
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune8['rune'],
method='getinfo',
params={})
assert exc_info.value.error['code'] == 0x5de
# Now we've had 3 in one minute, this will fail.
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune8['rune'],
method='getinfo',
params={})
assert exc_info.value.error['code'] == 0x5de
# rune5 can only be used by l2:
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune5['rune'],
method="listpeers",
params={})
assert exc_info.value.error['code'] == 0x5de
# Now wait for ratelimit expiry, ratelimits should reset.
time.sleep(61)
for rune, cmd, params in ((rune9, "getinfo", {}),
(rune8, "getinfo", {}),
(rune8, "getinfo", {})):
assert l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune['rune'],
method=cmd,
params=params)['valid'] is True
def test_showrunes(node_factory):
l1 = node_factory.get_node()
rune1 = l1.rpc.createrune()
assert rune1 == {
'rune': 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
'unique_id': '0',
'warning_unrestricted_rune': 'WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don\'t trust. Consider using the restrictions parameter to only allow access to specific rpc methods.'
}
showrunes = l1.rpc.showrunes()
assert len(l1.rpc.showrunes()) == 1
l1.rpc.createrune()
showrunes = l1.rpc.showrunes()
assert len(showrunes['runes']) == 2
assert showrunes == {
'runes': [
{
'rune': 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
'unique_id': '0',
'restrictions': [],
'restrictions_as_english': ''
},
{
'rune': 'geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==',
'unique_id': '1',
'restrictions': [],
'restrictions_as_english': ''
}
]
}
our_unstored_rune = l1.rpc.showrunes(rune='lI6iPwM1R9OkcRW25SH0a06PscPDinTfLFAjzSGFGE09OQ==')['runes'][0]
assert our_unstored_rune['unique_id'] == '9'
assert our_unstored_rune['stored'] is False
not_our_rune = l1.rpc.showrunes(rune='oNJAqigqDrHBGzsm7gV3z87oGpzq-KqFlOxx2O9iEQk9MA==')['runes'][0]
assert not_our_rune['stored'] is False
assert not_our_rune['our_rune'] is False
def test_blacklistrune(node_factory):
l1 = node_factory.get_node()
rune0 = l1.rpc.createrune()
assert rune0['unique_id'] == '0'
rune1 = l1.rpc.createrune()
assert rune1['unique_id'] == '1'
# Make sure runes work!
assert l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune0['rune'],
'method': 'getinfo'})['valid'] is True
assert l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune1['rune'],
'method': 'getinfo'})['valid'] is True
blacklist = l1.rpc.blacklistrune(start=1)
assert blacklist == {'blacklist': [{'start': 1, 'end': 1}]}
# Make sure rune id 1 does not work!
with pytest.raises(RpcError, match='Not authorized: Blacklisted rune') as exc_info:
l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune1['rune'],
'method': 'getinfo'})
assert exc_info.value.error['code'] == 0x5df
# But, other rune still works!
assert l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune0['rune'],
'method': 'getinfo'})['valid'] is True
blacklist = l1.rpc.blacklistrune(start=2)
assert blacklist == {'blacklist': [{'start': 1, 'end': 2}]}
blacklist = l1.rpc.blacklistrune(start=6)
assert blacklist == {'blacklist': [{'start': 1, 'end': 2},
{'start': 6, 'end': 6}]}
blacklist = l1.rpc.blacklistrune(start=3, end=5)
assert blacklist == {'blacklist': [{'start': 1, 'end': 6}]}
blacklist = l1.rpc.blacklistrune(start=9)
assert blacklist == {'blacklist': [{'start': 1, 'end': 6},
{'start': 9, 'end': 9}]}
blacklist = l1.rpc.blacklistrune(start=0)
assert blacklist == {'blacklist': [{'start': 0, 'end': 6},
{'start': 9, 'end': 9}]}
# # Now both runes fail!
with pytest.raises(RpcError, match='Not authorized: Blacklisted rune') as exc_info:
l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune0['rune'],
'method': 'getinfo'})
assert exc_info.value.error['code'] == 0x5df
with pytest.raises(RpcError, match='Not authorized: Blacklisted rune') as exc_info:
l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune1['rune'],
'method': 'getinfo'})
assert exc_info.value.error['code'] == 0x5df
blacklist = l1.rpc.blacklistrune()
assert blacklist == {'blacklist': [{'start': 0, 'end': 6},
{'start': 9, 'end': 9}]}
blacklisted_rune = l1.rpc.showrunes(rune='geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==')['runes'][0]['blacklisted']
assert blacklisted_rune is True
def test_badrune(node_factory):
"""Test invalid UTF-8 encodings in rune: used to make us kill the offers plugin which implements decode, as it gave bad utf8!"""
l1 = node_factory.get_node()
l1.rpc.decode('5zi6-ugA6hC4_XZ0R7snl5IuiQX4ugL4gm9BQKYaKUU9gCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl')
rune = l1.rpc.createrune(restrictions="readonly")
binrune = base64.urlsafe_b64decode(rune['rune'])
# Mangle each part, try decode. Skip most of the boring chars
# (just '|', '&', '#').
for i in range(32, len(binrune)):
for span in (range(0, 32), (124, 38, 35), range(127, 256)):
for c in span:
modrune = binrune[:i] + bytes([c]) + binrune[i + 1:]
try:
l1.rpc.decode(base64.urlsafe_b64encode(modrune).decode('utf8'))
except RpcError:
pass
def test_checkrune(node_factory):
l1 = node_factory.get_node()
rune1 = l1.rpc.createrune()
rune2 = l1.rpc.createrune(restrictions="readonly")
res1 = l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune1['rune'],
method='invoice',
params={'amount_msat': '10000'})
assert res1['valid'] is True
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.call(method='checkrune',
payload={'nodeid': l1.info['id'],
'rune': rune2['rune'],
'method': 'invoice',
'params': {"amount_msat": "1000", "label": "lbl", "description": "tipjar"}})
assert exc_info.value.error['code'] == 0x5de
def test_rune_pay_amount(node_factory):
l1, l2 = node_factory.line_graph(2)
# This doesn't really work, since amount_msat is illegal if invoice
# includes an amount, and runes aren't smart enough to decode bolt11!
rune = l1.rpc.createrune(restrictions=[['method=pay'],
['pnameamountmsat<10000']])['rune']
inv1 = l2.rpc.invoice(amount_msat=12300, label='inv1', description='description1')['bolt11']
inv2 = l2.rpc.invoice(amount_msat='any', label='inv2', description='description2')['bolt11']
# Rune requires amount_msat < 10,000!
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params={'bolt11': inv1})
assert exc_info.value.error['code'] == 0x5de
# As a named parameter!
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params=[inv1])
assert exc_info.value.error['code'] == 0x5de
# Can't get around it this way!
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params=[inv2, 12000])
assert exc_info.value.error['code'] == 0x5de
# Nor this way, using a string!
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params={'bolt11': inv2, 'amount_msat': '10000sat'})
assert exc_info.value.error['code'] == 0x5de
# Too much!
with pytest.raises(RpcError, match='Not permitted:') as exc_info:
l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params={'bolt11': inv2, 'amount_msat': 12000})
assert exc_info.value.error['code'] == 0x5de
# This works
res = l1.rpc.checkrune(nodeid=l1.info['id'],
rune=rune,
method='pay',
params={'bolt11': inv2, 'amount_msat': 9999})
assert res['valid'] is True
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Depends on canned sqlite3 db")
@unittest.skipIf(TEST_NETWORK != 'regtest', 'canned sqlite3 db is regtest')
def test_commando_rune_migration(node_factory):
"""Test migration from commando's datastore using db from test_commando_listrunes"""
l1 = node_factory.get_node(dbfile='commando_listrunes.sqlite3.xz',
options={'database-upgrade': True})
# This happens really early in logs!
l1.daemon.logsearch_start = 0
l1.daemon.wait_for_logs(['Transferring commando rune to db: '] * 2)
# datastore should be empty:
assert l1.rpc.listdatastore(['commando']) == {'datastore': []}
# Should match commando results!
assert l1.rpc.showrunes() == {'runes': [{'rune':
'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
'unique_id': '0', 'restrictions':
[], 'restrictions_as_english': ''},
{'rune':
'geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==',
'unique_id': '1', 'restrictions':
[], 'restrictions_as_english': ''}]}
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Depends on canned sqlite3 db")
@unittest.skipIf(TEST_NETWORK != 'regtest', 'canned sqlite3 db is regtest')
def test_commando_blacklist_migration(node_factory):
"""Test migration from commando's datastore using db from test_commando_blacklist"""
l1 = node_factory.get_node(dbfile='commando_blacklist.sqlite3.xz',
options={'database-upgrade': True})
# This happens really early in logs!
l1.daemon.logsearch_start = 0
l1.daemon.wait_for_logs(['Transferring commando blacklist to db: '] * 2)
# datastore should be empty:
assert l1.rpc.listdatastore(['commando']) == {'datastore': []}
# Should match commando results!
assert l1.rpc.blacklistrune() == {'blacklist': [{'start': 0, 'end': 6},
{'start': 9, 'end': 9}]}
def test_showrune_id(node_factory):
l1 = node_factory.get_node()
rune = l1.rpc.createrune()['rune']
# Won't have stored: false
assert 'stored' not in only_one(l1.rpc.showrunes(rune)['runes'])
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The DB migration is network specific due to the chain var.")
def test_id_migration(node_factory):
"""Database was taken from test_createrune"""
l1 = node_factory.get_node(dbfile='runes_bad_id.sqlite3.xz',
options={'database-upgrade': True})
for rune in ('OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
'zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl',
'mxHwVsC_W-PH7r79wXQWqxBNHaHncIqIjEPyP_vGOsE9MiZ0aW1lPjE2NTY2NzUyMTE=',
'YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz',
'enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA='):
assert 'stored' not in only_one(l1.rpc.showrunes(rune)['runes'])