From b4369c06a22983af2f1cb7409244f29f07b0ea5b Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sun, 5 Sep 2021 22:52:16 +0000 Subject: [PATCH 1/4] rpc: change walletprocesspsbt help text to match upstream --- src/rpc/client.cpp | 2 -- src/rpc/rawtransaction.cpp | 2 +- src/wallet/rpcwallet.cpp | 14 ++++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index a39efb917d..cfee69e73e 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -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" }, diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index ca6acd054f..5250750d95 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -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?"); } } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 523d2d359c..1d33b0f96a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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{ From 88edb9f9ff0be2b238d047d0c1c4bc83ab145e1c Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sun, 5 Sep 2021 22:53:31 +0000 Subject: [PATCH 2/4] rpc: correct type in `calculateasset` --- src/rpc/rawtransaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 5250750d95..7a38244d13 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -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, "", "", From abb52c861c730302611f098f2d079eb5cac54b78 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Tue, 7 Sep 2021 00:33:57 +0000 Subject: [PATCH 3/4] rpc: specify that `witnessScript` is optional for `signblock` and `combineblocksigs` RPC call --- src/rpc/mining.cpp | 2 +- src/wallet/rpcwallet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 495e0e54c5..1a95b1f0ef 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -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, "", "", diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 1d33b0f96a..9eca39489d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5091,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, "", "", From 6f428ecf8a06a308ffa63a62863b6fd62181bd8f Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Tue, 7 Sep 2021 13:18:33 +0000 Subject: [PATCH 4/4] ci: fix intermittent failure in feature_block_subsidy.py --- test/functional/feature_block_subsidy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/functional/feature_block_subsidy.py b/test/functional/feature_block_subsidy.py index 06cff30361..7129e7aaa4 100755 --- a/test/functional/feature_block_subsidy.py +++ b/test/functional/feature_block_subsidy.py @@ -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()