| 477 | |
| 478 | |
| 479 | def test_checkrune(node_factory): |
| 480 | l1 = node_factory.get_node() |
| 481 | rune1 = l1.rpc.createrune() |
| 482 | rune2 = l1.rpc.createrune(restrictions="readonly") |
| 483 | |
| 484 | res1 = l1.rpc.checkrune(nodeid=l1.info['id'], |
| 485 | rune=rune1['rune'], |
| 486 | method='invoice', |
| 487 | params={'amount_msat': '10000'}) |
| 488 | |
| 489 | assert res1['valid'] is True |
| 490 | |
| 491 | with pytest.raises(RpcError, match='Not permitted:') as exc_info: |
| 492 | l1.rpc.call(method='checkrune', |
| 493 | payload={'nodeid': l1.info['id'], |
| 494 | 'rune': rune2['rune'], |
| 495 | 'method': 'invoice', |
| 496 | 'params': {"amount_msat": "1000", "label": "lbl", "description": "tipjar"}}) |
| 497 | assert exc_info.value.error['code'] == 0x5de |
| 498 | |
| 499 | |
| 500 | def test_rune_pay_amount(node_factory): |