JSON: don't print deprecated amount fields any more

A small change in one routine creates a lot of changes!  We actually
recommended moving away from these in v0.7.0 (2019-02-28), but never
deprecated them formally.

Changelog-Deprecated: JSON-RPC: `pay`, `decode`, `decodepay`, `getroute`, `listinvoices`, `listpays` and `listsendpays` `msatoshi` fields (use `amount_msat`).
Changelog-Deprecated: JSON-RPC: `getinfo` `msatoshi_fees_collected` field (use `fees_collected_msat`).
Changelog-Deprecated: JSON-RPC: `listpeers` `channels`: `msatoshi_to_us`, `msatoshi_to_us_min`, `msatoshi_to_us_max`, `msatoshi_total`, `dust_limit_satoshis`, `our_channel_reserve_satoshis`, `their_channel_reserve_satoshis`, `spendable_msatoshi`, `receivable_msatoshi`, `in_msatoshi_offered`, `in_msatoshi_fulfilled`, `out_msatoshi_offered`, `out_msatoshi_fulfilled`, `max_htlc_value_in_flight_msat` and `htlc_minimum_msat` (use `to_us_msat`, `min_to_us_msat`, `max_to_us_msat`, `total_msat`, `dust_limit_msat`, `our_reserve_msat`, `their_reserve_msat`, `spendable_msat`, `receivable_msat`, `in_offered_msat`, `in_fulfilled_msat`, `out_offered_msat`, `out_fulfilled_msat`, `max_total_htlc_in_msat` and `minimum_htlc_in_msat`).
Changelog-Deprecated: JSON-RPC: `listinvoices` and `pay` `msatoshi_received` and `msatoshi_sent` (use `amount_received_msat`, `amount_sent_msat`)
Changelog-Deprecated: JSON-RPC: `listpays` and `listsendpays` `msatoshi_sent` (use `amount_sent_msat`)
Changelog-Deprecated: JSON-RPC: `listforwards` `in_msatoshi`, `out_msatoshi` and `fee` (use `in_msat`, `out_msat` and `fee_msat`)
Changelog-Deprecated: JSON-RPC: `listfunds` `outputs` `value` (use `amount_msat`)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-06-20 19:52:09 +09:30
parent 6afc0affef
commit c3efba16ff
7 changed files with 11 additions and 25 deletions

View File

@@ -1292,11 +1292,9 @@ def test_forward_pad_fees_and_cltv(node_factory, bitcoind):
assert route[1]['delay'] == 9
# Modify so we overpay, overdo the cltv.
route[0]['msatoshi'] += 2000
route[0]['amount_msat'] = Millisatoshi(route[0]['msatoshi'])
route[0]['amount_msat'] += 2000
route[0]['delay'] += 20
route[1]['msatoshi'] += 1000
route[1]['amount_msat'] = Millisatoshi(route[1]['msatoshi'])
route[1]['amount_msat'] += 1000
route[1]['delay'] += 10
# This should work.
@@ -2174,13 +2172,11 @@ def test_setchannel_routing(node_factory, bitcoind):
# 1337 + 4000000 * 137 / 1000000 = 1885
route_ok = l1.rpc.getroute(l3.info['id'], 4000000, 1)["route"]
assert len(route_ok) == 2
assert route_ok[0]['msatoshi'] == 4001885
assert route_ok[1]['msatoshi'] == 4000000
assert route_ok[0]['amount_msat'] == 4001885
assert route_ok[1]['amount_msat'] == 4000000
# Make variant that tries to pay more than allowed htlc!
route_bad = copy.deepcopy(route_ok)
route_bad[0]['msatoshi'] = 4001887
route_bad[1]['msatoshi'] = 4000001
route_bad[0]['amount_msat'] = Millisatoshi(4001887)
route_bad[1]['amount_msat'] = Millisatoshi(4000001)
assert route_bad != route_ok
@@ -2211,8 +2207,6 @@ def test_setchannel_routing(node_factory, bitcoind):
assert route_ok[1]['amount_msat'] == 17
route_bad = copy.deepcopy(route_ok)
route_bad[0]['msatoshi'] = 1337 + 16
route_bad[1]['msatoshi'] = 16
route_bad[0]['amount_msat'] = Millisatoshi(1337 + 16)
route_bad[1]['amount_msat'] = Millisatoshi(16)
assert route_bad != route_ok