Skip to content

Commit 8e1704c

Browse files
committed
Merge #15559: doc: correct analyzepsbt rpc doc
335931d rpc: return a number for estimated_feerate in analyzepsbt (fanquake) a4d0fd0 doc: correct analysepsbt rpc doc (fanquake) Pull request description: Even though `missing` is optional, all its field are also all optional. `estimated_vsize` is optional (calculate alongside `estimated_feerate`). Make `estimated_feerate` output numeric. Tree-SHA512: 5e063bcfbca73d3d08d29c5d1f59bc1791757f69248da4a9c70fe4b2fe82807ec4ed9fca48d439101d66ba924916fa5da9232167d74ea2b967fc04f0a36f190e
2 parents c3b1cb9 + 335931d commit 8e1704c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,21 +1862,21 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
18621862
" \"has_utxo\" : true|false (boolean) Whether a UTXO is provided\n"
18631863
" \"is_final\" : true|false (boolean) Whether the input is finalized\n"
18641864
" \"missing\" : { (json object, optional) Things that are missing that are required to complete this input\n"
1865-
" \"pubkeys\" : [ (array)\n"
1865+
" \"pubkeys\" : [ (array, optional)\n"
18661866
" \"keyid\" (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing\n"
18671867
" ]\n"
1868-
" \"signatures\" : [ (array)\n"
1868+
" \"signatures\" : [ (array, optional)\n"
18691869
" \"keyid\" (string) Public key ID, hash160 of the public key, of a public key whose signature is missing\n"
18701870
" ]\n"
1871-
" \"redeemscript\" : \"hash\" (string) Hash160 of the redeemScript that is missing\n"
1872-
" \"witnessscript\" : \"hash\" (string) SHA256 of the witnessScript that is missing\n"
1871+
" \"redeemscript\" : \"hash\" (string, optional) Hash160 of the redeemScript that is missing\n"
1872+
" \"witnessscript\" : \"hash\" (string, optional) SHA256 of the witnessScript that is missing\n"
18731873
" }\n"
1874-
" \"next\" : \"role\" (string) Role of the next person that this input needs to go to\n"
1874+
" \"next\" : \"role\" (string, optional) Role of the next person that this input needs to go to\n"
18751875
" }\n"
18761876
" ,...\n"
18771877
" ]\n"
1878-
" \"estimated_vsize\" : vsize (numeric) Estimated vsize of the final signed transaction\n"
1879-
" \"estimated_feerate\" : feerate (numeric, optional) Estimated feerate of the final signed transaction. Shown only if all UTXO slots in the PSBT have been filled.\n"
1878+
" \"estimated_vsize\" : vsize (numeric, optional) Estimated vsize of the final signed transaction\n"
1879+
" \"estimated_feerate\" : feerate (numeric, optional) Estimated feerate of the final signed transaction in " + CURRENCY_UNIT + "/kB. Shown only if all UTXO slots in the PSBT have been filled.\n"
18801880
" \"fee\" : fee (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled.\n"
18811881
" \"next\" : \"role\" (string) Role of the next person that this psbt needs to go to\n"
18821882
"}\n"
@@ -2021,7 +2021,7 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
20212021
result.pushKV("estimated_vsize", (int)size);
20222022
// Estimate fee rate
20232023
CFeeRate feerate(fee, size);
2024-
result.pushKV("estimated_feerate", feerate.ToString());
2024+
result.pushKV("estimated_feerate", ValueFromAmount(feerate.GetFeePerK()));
20252025
}
20262026
result.pushKV("fee", ValueFromAmount(fee));
20272027

test/functional/rpc_psbt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def run_test(self):
355355
assert analyzed['inputs'][0]['has_utxo'] and not analyzed['inputs'][0]['is_final'] and analyzed['inputs'][0]['next'] == 'signer' and analyzed['next'] == 'signer' and analyzed['inputs'][0]['missing']['signatures'][0] == addrinfo['embedded']['witness_program']
356356

357357
# Check fee and size things
358-
assert analyzed['fee'] == Decimal('0.001') and analyzed['estimated_vsize'] == 134 and analyzed['estimated_feerate'] == '0.00746268 BTC/kB'
358+
assert analyzed['fee'] == Decimal('0.001') and analyzed['estimated_vsize'] == 134 and analyzed['estimated_feerate'] == Decimal('0.00746268')
359359

360360
# After signing and finalizing, needs extracting
361361
signed = self.nodes[1].walletprocesspsbt(updated)['psbt']

0 commit comments

Comments
 (0)