Skip to content

Commit

Permalink
pytest: don't hand a string for an integer value.
Browse files Browse the repository at this point in the history
lightningd is happy, but our schema won't be.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Apr 1, 2022
1 parent 5d8fc84 commit 1b6f4e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 1b6f4e7

Please sign in to comment.