Skip to content

Commit

Permalink
newaddr: various fixes for msggen and docs
Browse files Browse the repository at this point in the history
Changelog-None
  • Loading branch information
daywalker90 authored and cdecker committed Apr 17, 2024
1 parent 9ad5c6b commit 507c2de
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 31 deletions.
6 changes: 0 additions & 6 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@
"NewaddrAddresstype": {
"all": 2,
"bech32": 0,
"p2sh-segwit": 1,
"p2tr": 3
},
"PayStatus": {
Expand Down Expand Up @@ -1562,7 +1561,6 @@
},
"NewaddrResponse": {
"NewAddr.bech32": 1,
"NewAddr.p2sh-segwit": 2,
"NewAddr.p2tr": 3
},
"OfferRecurrence": {
Expand Down Expand Up @@ -5621,10 +5619,6 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"NewAddr.p2sh-segwit": {
"added": "pre-v0.10.1",
"deprecated": "v23.02"
},
"NewAddr.p2tr": {
"added": "v23.08",
"deprecated": false
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ lightning-cli newaddr

`lightningd` will register the funds once the transaction is confirmed.

You may need to generate a p2sh-segwit address if the faucet does not support bech32:
Alternatively you can generate a taproot address should your source of funds support it:

```bash
# Return a p2sh-segwit address
lightning-cli newaddr p2sh-segwit
# Return a taproot address
lightning-cli newaddr p2tr
```

Confirm `lightningd` got funds by:
Expand Down
20 changes: 10 additions & 10 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions contrib/pyln-testing/pyln/testing/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ def newaddr(self, addresstype=None):
payload = clnpb.NewaddrRequest(addresstype=atype)
res = grpc2py.newaddr2py(self.stub.NewAddr(payload))

# Need to remap the bloody spelling of p2sh-segwit to match
# addresstype.
if 'p2sh_segwit' in res:
res['p2sh-segwit'] = res['p2sh_segwit']
del res['p2sh_segwit']
return res

def listfunds(self, spent=None):
Expand Down
6 changes: 3 additions & 3 deletions doc/beginners-guide/opening-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ lightning-cli newaddr

`lightningd` will register the funds once the transaction is confirmed.

You may need to generate a p2sh-segwit address if the faucet does not support bech32:
Alternatively you can generate a taproot address should your source of funds support it:

```shell
# Return a p2sh-segwit address
lightning-cli newaddr p2sh-segwit
# Return a taproot address
lightning-cli newaddr p2tr
```


Expand Down
7 changes: 3 additions & 4 deletions doc/lightningd.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ elided, specify it if you selected your own *lightning-dir*):

$ lightning-cli newaddr

This will provide a native SegWit bech32 address. In case all your money
is in services that do not support native SegWit and have to use
P2SH-wrapped addresses, instead use:
This will provide a native SegWit bech32 address. Alternatively you can
generate a taproot address with:

$ lightning-cli newaddr p2sh-segwit
$ lightning-cli newaddr p2tr

Transfer a small amount of onchain funds to the given address. Check the
status of all your funds (onchain and on-Lightning) via
Expand Down
1 change: 1 addition & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,7 @@ def test_newaddr(node_factory, chainparams):
both = l1.rpc.newaddr('all')
assert 'p2sh-segwit' not in both
assert both['bech32'].startswith(chainparams['bip173_prefix'])
assert both['p2tr'].startswith(chainparams['bip173_prefix'])


def test_bitcoind_fail_first(node_factory, bitcoind):
Expand Down

0 comments on commit 507c2de

Please sign in to comment.