Skip to content

Commit f27d5f6

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25691: RPC: Document "asm" and "hex" fields for scripts & fix getblock help
56d9244 RPC: Document "asm" and "hex" fields for scripts (Luke Dashjr) 2cdd4df Bugfix: RPC/blockchain: Correct type of "value" in getblock docs; add missing "desc" (Jon Atack) Pull request description: Inspired by #24718 ACKs for top commit: kristapsk: cr utACK 56d9244 Tree-SHA512: 2c6d0291397929f6a76b2d2998789187da123d7bfcace77375331cb81995eb0afd2600286c1e25cf68d16e35bd58706d2f672f63a3febe5e3a556a668f2175a2
2 parents 194f6dc + 56d9244 commit f27d5f6

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/rpc/blockchain.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,12 @@ const RPCResult getblock_vin{
614614
{
615615
{RPCResult::Type::BOOL, "generated", "Coinbase or not"},
616616
{RPCResult::Type::NUM, "height", "The height of the prevout"},
617-
{RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT},
617+
{RPCResult::Type::STR_AMOUNT, "value", "The value in " + CURRENCY_UNIT},
618618
{RPCResult::Type::OBJ, "scriptPubKey", "",
619619
{
620-
{RPCResult::Type::STR, "asm", "The asm"},
621-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
620+
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
621+
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
622+
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
622623
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
623624
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
624625
}},
@@ -1015,9 +1016,9 @@ static RPCHelpMan gettxout()
10151016
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
10161017
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
10171018
{RPCResult::Type::OBJ, "scriptPubKey", "", {
1018-
{RPCResult::Type::STR, "asm", "The asm"},
1019+
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
10191020
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
1020-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
1021+
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
10211022
{RPCResult::Type::STR, "type", "The type, eg pubkeyhash"},
10221023
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
10231024
}},

src/rpc/rawtransaction.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static std::vector<RPCResult> DecodeTxDoc(const std::string& txid_field_doc)
9696
{RPCResult::Type::NUM, "vout", /*optional=*/true, "The output number (if not coinbase transaction)"},
9797
{RPCResult::Type::OBJ, "scriptSig", /*optional=*/true, "The script (if not coinbase transaction)",
9898
{
99-
{RPCResult::Type::STR, "asm", "asm"},
100-
{RPCResult::Type::STR_HEX, "hex", "hex"},
99+
{RPCResult::Type::STR, "asm", "Disassembly of the signature script"},
100+
{RPCResult::Type::STR_HEX, "hex", "The raw signature script bytes, hex-encoded"},
101101
}},
102102
{RPCResult::Type::ARR, "txinwitness", /*optional=*/true, "",
103103
{
@@ -114,9 +114,9 @@ static std::vector<RPCResult> DecodeTxDoc(const std::string& txid_field_doc)
114114
{RPCResult::Type::NUM, "n", "index"},
115115
{RPCResult::Type::OBJ, "scriptPubKey", "",
116116
{
117-
{RPCResult::Type::STR, "asm", "the asm"},
117+
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
118118
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
119-
{RPCResult::Type::STR_HEX, "hex", "the hex"},
119+
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
120120
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
121121
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
122122
}},
@@ -692,9 +692,9 @@ const RPCResult decodepsbt_inputs{
692692
{RPCResult::Type::NUM, "amount", "The value in " + CURRENCY_UNIT},
693693
{RPCResult::Type::OBJ, "scriptPubKey", "",
694694
{
695-
{RPCResult::Type::STR, "asm", "The asm"},
695+
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
696696
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
697-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
697+
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
698698
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
699699
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
700700
}},
@@ -706,14 +706,14 @@ const RPCResult decodepsbt_inputs{
706706
{RPCResult::Type::STR, "sighash", /*optional=*/true, "The sighash type to be used"},
707707
{RPCResult::Type::OBJ, "redeem_script", /*optional=*/true, "",
708708
{
709-
{RPCResult::Type::STR, "asm", "The asm"},
710-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
709+
{RPCResult::Type::STR, "asm", "Disassembly of the redeem script"},
710+
{RPCResult::Type::STR_HEX, "hex", "The raw redeem script bytes, hex-encoded"},
711711
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
712712
}},
713713
{RPCResult::Type::OBJ, "witness_script", /*optional=*/true, "",
714714
{
715-
{RPCResult::Type::STR, "asm", "The asm"},
716-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
715+
{RPCResult::Type::STR, "asm", "Disassembly of the witness script"},
716+
{RPCResult::Type::STR_HEX, "hex", "The raw witness script bytes, hex-encoded"},
717717
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
718718
}},
719719
{RPCResult::Type::ARR, "bip32_derivs", /*optional=*/true, "",
@@ -727,8 +727,8 @@ const RPCResult decodepsbt_inputs{
727727
}},
728728
{RPCResult::Type::OBJ, "final_scriptSig", /*optional=*/true, "",
729729
{
730-
{RPCResult::Type::STR, "asm", "The asm"},
731-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
730+
{RPCResult::Type::STR, "asm", "Disassembly of the final signature script"},
731+
{RPCResult::Type::STR_HEX, "hex", "The raw final signature script bytes, hex-encoded"},
732732
}},
733733
{RPCResult::Type::ARR, "final_scriptwitness", /*optional=*/true, "",
734734
{
@@ -812,14 +812,14 @@ const RPCResult decodepsbt_outputs{
812812
{
813813
{RPCResult::Type::OBJ, "redeem_script", /*optional=*/true, "",
814814
{
815-
{RPCResult::Type::STR, "asm", "The asm"},
816-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
815+
{RPCResult::Type::STR, "asm", "Disassembly of the redeem script"},
816+
{RPCResult::Type::STR_HEX, "hex", "The raw redeem script bytes, hex-encoded"},
817817
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
818818
}},
819819
{RPCResult::Type::OBJ, "witness_script", /*optional=*/true, "",
820820
{
821-
{RPCResult::Type::STR, "asm", "The asm"},
822-
{RPCResult::Type::STR_HEX, "hex", "The hex"},
821+
{RPCResult::Type::STR, "asm", "Disassembly of the witness script"},
822+
{RPCResult::Type::STR_HEX, "hex", "The raw witness script bytes, hex-encoded"},
823823
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
824824
}},
825825
{RPCResult::Type::ARR, "bip32_derivs", /*optional=*/true, "",

0 commit comments

Comments
 (0)