mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
ccan: update to get rune error message fix.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1fedae4f83
commit
ba9daa468d
4 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,3 @@
|
|||
CCAN imported from http://ccodearchive.net.
|
||||
|
||||
CCAN version: init-2577-g1ae4c432
|
||||
CCAN version: init-2578-g29e55f74
|
||||
|
|
|
@ -345,6 +345,8 @@ static const char *rune_alt_single(const tal_t *ctx,
|
|||
memmem(fieldval_str, fieldval_strlen,
|
||||
alt->value, strlen(alt->value)));
|
||||
case RUNE_COND_INT_LESS:
|
||||
if (!fieldval_str && !fieldval_int)
|
||||
return tal_fmt(ctx, "%s not present", alt->fieldname);
|
||||
err = integer_compare_valid(ctx, fieldval_int,
|
||||
alt, &runeval_int);
|
||||
if (err)
|
||||
|
@ -352,6 +354,8 @@ static const char *rune_alt_single(const tal_t *ctx,
|
|||
return cond_test(ctx, alt, "is greater or equal to",
|
||||
*fieldval_int < runeval_int);
|
||||
case RUNE_COND_INT_GREATER:
|
||||
if (!fieldval_str && !fieldval_int)
|
||||
return tal_fmt(ctx, "%s not present", alt->fieldname);
|
||||
err = integer_compare_valid(ctx, fieldval_int,
|
||||
alt, &runeval_int);
|
||||
if (err)
|
||||
|
|
|
@ -2939,21 +2939,21 @@ def test_commando_rune_pay_amount(node_factory):
|
|||
inv2 = l2.rpc.invoice(amount_msat='any', label='inv2', description='description2')['bolt11']
|
||||
|
||||
# Rune requires amount_msat!
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat is not an integer field'):
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat not present'):
|
||||
l2.rpc.commando(peer_id=l1.info['id'],
|
||||
rune=rune,
|
||||
method='pay',
|
||||
params={'bolt11': inv1})
|
||||
|
||||
# As a named parameter!
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat is not an integer field'):
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat not present'):
|
||||
l2.rpc.commando(peer_id=l1.info['id'],
|
||||
rune=rune,
|
||||
method='pay',
|
||||
params=[inv1])
|
||||
|
||||
# Can't get around it this way!
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat is not an integer field'):
|
||||
with pytest.raises(RpcError, match='Invalid rune: Not permitted: pnameamountmsat not present'):
|
||||
l2.rpc.commando(peer_id=l1.info['id'],
|
||||
rune=rune,
|
||||
method='pay',
|
||||
|
|
|
@ -448,7 +448,6 @@ def test_checkrune(node_factory):
|
|||
assert exc_info.value.error['code'] == 0x5de
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_rune_pay_amount(node_factory):
|
||||
l1, l2 = node_factory.line_graph(2)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue