offers: make it the default.

Changelog-Changed: offers: bolt12 now enabled by default (finally!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-11-18 13:42:32 +10:30 committed by Vincenzo Palazzo
parent 05fbcb4d9b
commit ca41414da4
3 changed files with 2 additions and 25 deletions

View File

@ -75,9 +75,6 @@ struct config {
/* How long before we give up waiting for INIT msg */
u32 connection_timeout_secs;
/* EXPERIMENTAL: offers support */
bool exp_offers;
/* Allow dust reserves (including 0) when being called via
* `fundchannel` or in the `openchannel` hook. This is a
* slight spec incompatibility, but implementations do this

View File

@ -1030,8 +1030,6 @@ static const struct config testnet_config = {
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,
.exp_offers = false,
.allowdustreserve = false,
.require_confirmed_inputs = false,
@ -1110,8 +1108,6 @@ static const struct config mainnet_config = {
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,
.exp_offers = false,
.allowdustreserve = false,
.require_confirmed_inputs = false,
@ -1316,7 +1312,7 @@ static char *opt_set_anchor_zero_fee_htlc_tx(struct lightningd *ld)
static char *opt_set_offers(struct lightningd *ld)
{
ld->config.exp_offers = true;
/* FIXME: Deprecate */
return NULL;
}
@ -2066,7 +2062,7 @@ void add_config_deprecated(struct lightningd *ld,
->bits[INIT_FEATURE],
OPT_ONION_MESSAGES));
} else if (opt->cb == (void *)opt_set_offers) {
json_add_bool(response, name0, ld->config.exp_offers);
json_add_bool(response, name0, true);
} else if (opt->cb == (void *)opt_set_shutdown_wrong_funding) {
json_add_bool(response, name0,
feature_offered(ld->our_features

View File

@ -4225,22 +4225,6 @@ def test_mpp_overload_payee(node_factory, bitcoind):
l1.rpc.pay(inv)
@unittest.skipIf(TEST_NETWORK != 'regtest', "Canned offer is network specific")
def test_offer_needs_option(node_factory):
"""Make sure we don't make offers without offer command"""
l1 = node_factory.get_node()
with pytest.raises(RpcError, match='experimental-offers not enabled'):
l1.rpc.call('offer', {'amount': '1msat', 'description': 'test'})
with pytest.raises(RpcError, match='experimental-offers not enabled'):
l1.rpc.call('invoicerequest', {'amount': '2msat',
'description': 'simple test'})
with pytest.raises(RpcError, match='experimental-offers not enabled'):
l1.rpc.call('fetchinvoice', {'offer': 'lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5pr5v4ehg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s'})
# Decode still works though
assert l1.rpc.decode('lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5pr5v4ehg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s')['valid']
def test_offer(node_factory, bitcoind):
plugin = os.path.join(os.path.dirname(__file__), 'plugins/currencyUSDAUD5000.py')
l1 = node_factory.get_node(options={'plugin': plugin, 'experimental-offers': None})