mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
pytest: don't hand a string for an integer value.
lightningd is happy, but our schema won't be. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
5d8fc84675
commit
1b6f4e7026
3 changed files with 6 additions and 6 deletions
|
@ -186,7 +186,7 @@ def test_connection_moved(node_factory, executor):
|
|||
log = l1.daemon.wait_for_log('listening for connections')
|
||||
match = re.search(r'on port (\d*)', log)
|
||||
assert match and len(match.groups()) == 1
|
||||
hang_port = match.groups()[0]
|
||||
hang_port = int(match.groups()[0])
|
||||
|
||||
# Attempt connection
|
||||
fut_hang = executor.submit(l1.rpc.connect, l2.info['id'],
|
||||
|
|
|
@ -15,7 +15,7 @@ def test_invoice(node_factory, chainparams):
|
|||
addr1 = l2.rpc.newaddr('bech32')['bech32']
|
||||
addr2 = l2.rpc.newaddr('p2sh-segwit')['p2sh-segwit']
|
||||
before = int(time.time())
|
||||
inv = l1.rpc.invoice(123000, 'label', 'description', '3700', [addr1, addr2])
|
||||
inv = l1.rpc.invoice(123000, 'label', 'description', 3700, [addr1, addr2])
|
||||
after = int(time.time())
|
||||
b11 = l1.rpc.decodepay(inv['bolt11'])
|
||||
assert b11['currency'] == chainparams['bip173_prefix']
|
||||
|
@ -55,7 +55,7 @@ def test_invoice(node_factory, chainparams):
|
|||
assert 'warning_capacity' in inv
|
||||
|
||||
# Test cltv option.
|
||||
inv = l1.rpc.invoice(123000, 'label3', 'description', '3700', cltv=99)
|
||||
inv = l1.rpc.invoice(123000, 'label3', 'description', 3700, cltv=99)
|
||||
b11 = l1.rpc.decodepay(inv['bolt11'])
|
||||
assert b11['min_final_cltv_expiry'] == 99
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ def test_pay_optional_args(node_factory, compat):
|
|||
# root of a payment tree with the bolt11 invoice).
|
||||
|
||||
anyinv = l2.rpc.invoice('any', 'any_pay', 'desc')['bolt11']
|
||||
l1.dev_pay(anyinv, label='desc', msatoshi='500', use_shadow=False)
|
||||
l1.dev_pay(anyinv, label='desc', msatoshi=500, use_shadow=False)
|
||||
payment3 = l1.rpc.listsendpays(anyinv)['payments']
|
||||
assert len(payment3) == 1
|
||||
assert payment3[0]['label'] == 'desc'
|
||||
|
@ -539,7 +539,7 @@ def test_pay_maxfee_shadow(node_factory):
|
|||
# maxfeepercent.
|
||||
amount = 20000
|
||||
bolt11 = l2.rpc.invoice(amount, "big.{}".format(i), "bigger")["bolt11"]
|
||||
pay_status = l1.rpc.pay(bolt11, maxfeepercent="0.000001")
|
||||
pay_status = l1.rpc.pay(bolt11, maxfeepercent=0.001)
|
||||
assert pay_status["amount_msat"] == Millisatoshi(amount)
|
||||
|
||||
|
||||
|
@ -5220,7 +5220,7 @@ def test_pay_manual_exclude(node_factory, bitcoind):
|
|||
chan23 = l2.rpc.listpeers(l3_id)['peers'][0]['channels'][0]
|
||||
scid12 = chan12['short_channel_id'] + '/' + str(chan12['direction'])
|
||||
scid23 = chan23['short_channel_id'] + '/' + str(chan23['direction'])
|
||||
inv = l3.rpc.invoice(msatoshi='123000', label='label1', description='desc')['bolt11']
|
||||
inv = l3.rpc.invoice(msatoshi=123000, label='label1', description='desc')['bolt11']
|
||||
# Exclude the payer node id
|
||||
with pytest.raises(RpcError, match=r'Payer is manually excluded'):
|
||||
l1.rpc.pay(inv, exclude=[l1_id])
|
||||
|
|
Loading…
Add table
Reference in a new issue