Merge ElementsProject/elements#1034: A couple minor PSET cleanups

6f428ecf8a ci: fix intermittent failure in feature_block_subsidy.py (Andrew Poelstra)
abb52c861c rpc: specify that `witnessScript` is optional for `signblock` and `combineblocksigs` RPC call (Andrew Poelstra)
88edb9f9ff rpc: correct type in `calculateasset` (Andrew Poelstra)
b4369c06a2 rpc: change walletprocesspsbt help text to match upstream (Andrew Poelstra)

Pull request description:

  .

ACKs for top commit:
  achow101:
    ACK 6f428ecf8a

Tree-SHA512: 38afb0d1f3e4a7839ecea7dccb996f1d996d037e14f630d8cc943bd5f34fbc7d510f9c2d4fbb5fb1eb3435f4a9a602a9ff9635ecd8c2a8d8adcccf7dd4b7c0cb
This commit is contained in:
Andrew Poelstra 2021-09-07 17:43:26 +00:00
commit e88f0b7045
No known key found for this signature in database
GPG key ID: C588D63CE41B97C1
5 changed files with 12 additions and 16 deletions

View file

@ -118,7 +118,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "walletcreatefundedpsbt", 6, "psbt_version" },
{ "walletprocesspsbt", 1, "sign" },
{ "walletprocesspsbt", 3, "bip32derivs" },
{ "walletfillpsbtdata", 1, "bip32derivs" },
{ "createpsbt", 0, "inputs" },
{ "createpsbt", 1, "outputs" },
{ "createpsbt", 2, "locktime" },
@ -221,7 +220,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "blindrawtransaction", 2, "asset_commitments" },
{ "blindrawtransaction", 3, "blind_issuances" },
{ "blindrawtransaction", 4, "totalblinder" },
{ "blindpsbt", 1, "ignoreblindfail" },
{ "destroyamount", 1, "amount" },
{ "destroyamount", 3, "verbose"},
{ "sendmany", 8 , "output_assets" },

View file

@ -1362,7 +1362,7 @@ UniValue combineblocksigs(const JSONRPCRequest& request)
},
},
},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded witnessScript for the signblockscript"},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The hex-encoded witnessScript for the signblockscript"},
},
RPCResult{
RPCResult::Type::OBJ, "", "",

View file

@ -908,7 +908,7 @@ static RPCHelpMan sendrawtransaction()
// will always be blinded and not explicit. In the former case, we
// error out because the transaction is not blinded properly.
if (!out.nNonce.IsNull() && out.nValue.IsExplicit()) {
throw JSONRPCError(RPC_TRANSACTION_ERROR, "Transaction output has nonce, but is not blinded. Did you forget to call blindpsbt, blindrawtranssaction, or rawblindrawtransaction?");
throw JSONRPCError(RPC_TRANSACTION_ERROR, "Transaction output has nonce, but is not blinded. Did you forget to call blindrawtranssaction, or rawblindrawtransaction?");
}
}
@ -2909,7 +2909,7 @@ static RPCHelpMan calculateasset()
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Transaction id of the output that will be spent for this issuance."},
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "Output index of the output that will be spent for this issuance."},
{"asset_entropy", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "Additional asset entropy to be included in the asset tag. This is the contract hash."},
{"blind_reissuance", RPCArg::Type::STR_HEX, /* default */ "true", "Whether the reissuance asset tag will be blinded"},
{"blind_reissuance", RPCArg::Type::BOOL, /* default */ "true", "Whether the reissuance asset tag will be blinded"},
},
RPCResult{
RPCResult::Type::OBJ, "", "",

View file

@ -4686,14 +4686,8 @@ static RPCHelpMan walletprocesspsbt()
{
return RPCHelpMan{"walletprocesspsbt",
"\nUpdate a PSBT with input information from our wallet and then sign inputs\n"
"that we can sign for.\n\n"
"NOTE: When working with Confidential Assets transactions, it is necessary to\n"
"blind the transaction after filling it in from the wallet and before signing\n"
"it. This RPC will fail when working with such transaction. Instead of using\n"
"this RPC, use the following sequence:\n"
" - walletfillpsbtdata\n"
" - blindpsbt\n" +
HELP_REQUIRING_PASSPHRASE,
"that we can sign for." +
HELP_REQUIRING_PASSPHRASE,
{
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction base64 string"},
{"sign", RPCArg::Type::BOOL, /* default */ "true", "Also sign the transaction when updating"},
@ -4709,8 +4703,8 @@ static RPCHelpMan walletprocesspsbt()
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR, "psbt", "the base64-encoded partially signed transaction"},
{RPCResult::Type::BOOL, "complete", "whether the transaction has a complete set of signatures"},
{RPCResult::Type::STR, "psbt", "The base64-encoded partially signed transaction"},
{RPCResult::Type::BOOL, "complete", "If the transaction has a complete set of signatures"},
},
},
RPCExamples{
@ -5097,7 +5091,7 @@ static RPCHelpMan signblock()
"\nSigns a block proposal, checking that it would be accepted first. Errors if it cannot sign the block. Note that this call adds the witnessScript to your wallet for signing purposes! This function is intended for QA and testing.\n",
{
{"blockhex", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded block from getnewblockhex"},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded witness script. Required for dynamic federation blocks. Argument is \"\" when the block is P2WPKH."},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The hex-encoded witness script. Required for dynamic federation blocks. Argument is \"\" when the block is P2WPKH."},
},
RPCResult{
RPCResult::Type::ARR, "", "",

View file

@ -6,6 +6,7 @@
from binascii import b2a_hex
from decimal import Decimal
from time import time
from test_framework.blocktools import create_coinbase
from test_framework.messages import CBlock, CProof, CTxOutValue
@ -16,6 +17,9 @@ def b2x(b):
return b2a_hex(b).decode('ascii')
def assert_template(node, block, expect, rehash=True):
# Re-set the block timestamp before every submission to avoid
# intermittent "time too old" failures in slow CI boxes
block.nTime = int(time()) + 1
if rehash:
block.hashMerkleRoot = block.calc_merkle_root()
block.calc_sha256()