diff --git a/tests/test_wallet.py b/tests/test_wallet.py index dee189ef2..fa1914d60 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -937,7 +937,7 @@ def test_transaction_annotations(node_factory, bitcoind): assert(len(txs) == 1) tx = txs[0] output = tx['outputs'][idx] - assert(output['type'] == 'deposit' and output['satoshis'] == '1000000000msat') + assert(output['type'] == 'deposit' and output['msat'] == Millisatoshi(1000000000)) # ... and all other output should be change, and have no annotations types = [] diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 8bf0f6cce..96f33e7cb 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -506,7 +506,7 @@ static void json_transaction_details(struct json_stream *response, json_object_start(response, NULL); json_add_txid(response, "hash", &tx->id); json_add_hex_talarr(response, "rawtx", tx->rawtx); - json_add_u64(response, "blockheight", tx->blockheight); + json_add_num(response, "blockheight", tx->blockheight); json_add_num(response, "txindex", tx->txindex); #if EXPERIMENTAL_FEATURES if (tx->annotation.type != 0) @@ -556,7 +556,9 @@ static void json_transaction_details(struct json_stream *response, json_object_start(response, NULL); json_add_u32(response, "index", i); - json_add_amount_sat_only(response, "satoshis", sat); + if (deprecated_apis) + json_add_amount_sat_only(response, "satoshis", sat); + json_add_amount_sat_only(response, "msat", sat); #if EXPERIMENTAL_FEATURES struct tx_annotation *ann = &tx->output_annotations[i];