mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Merge f18b4e8ca9
into ad7a373529
This commit is contained in:
commit
8c7a970a67
4
doc/release-notes-5772.md
Normal file
4
doc/release-notes-5772.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
RPC changes
|
||||||
|
-----------
|
||||||
|
|
||||||
|
`quorum getdata` RPC will no longer allow `proTxHash` to be specified when `dataMask` is set to `1`.
|
@ -802,8 +802,8 @@ static RPCHelpMan quorum_getdata()
|
|||||||
uint16_t nDataMask = static_cast<uint16_t>(ParseInt32V(request.params[3], "dataMask"));
|
uint16_t nDataMask = static_cast<uint16_t>(ParseInt32V(request.params[3], "dataMask"));
|
||||||
uint256 proTxHash;
|
uint256 proTxHash;
|
||||||
|
|
||||||
// Check if request wants ENCRYPTED_CONTRIBUTIONS data
|
|
||||||
if (nDataMask & llmq::CQuorumDataRequest::ENCRYPTED_CONTRIBUTIONS) {
|
if (nDataMask & llmq::CQuorumDataRequest::ENCRYPTED_CONTRIBUTIONS) {
|
||||||
|
// Require proTxHash if request wants ENCRYPTED_CONTRIBUTIONS data
|
||||||
if (!request.params[4].isNull()) {
|
if (!request.params[4].isNull()) {
|
||||||
proTxHash = ParseHashV(request.params[4], "proTxHash");
|
proTxHash = ParseHashV(request.params[4], "proTxHash");
|
||||||
if (proTxHash.IsNull()) {
|
if (proTxHash.IsNull()) {
|
||||||
@ -812,6 +812,9 @@ static RPCHelpMan quorum_getdata()
|
|||||||
} else {
|
} else {
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "proTxHash missing");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "proTxHash missing");
|
||||||
}
|
}
|
||||||
|
} else if (!request.params[4].isNull()) {
|
||||||
|
// Require no proTxHash otherwise
|
||||||
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Should not specify proTxHash");
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto quorum = llmq_ctx.qman->GetQuorum(llmqType, quorumHash);
|
const auto quorum = llmq_ctx.qman->GetQuorum(llmqType, quorumHash);
|
||||||
|
@ -394,6 +394,8 @@ class QuorumDataMessagesTest(DashTestFramework):
|
|||||||
|
|
||||||
def test_rpc_quorum_getdata_protx_hash():
|
def test_rpc_quorum_getdata_protx_hash():
|
||||||
self.log.info("Test optional proTxHash of `quorum getdata`")
|
self.log.info("Test optional proTxHash of `quorum getdata`")
|
||||||
|
assert_raises_rpc_error(-8, "Should not specify proTxHash",
|
||||||
|
mn1.node.quorum, "getdata", 0, 100, quorum_hash, 0x01, mn1.proTxHash)
|
||||||
assert_raises_rpc_error(-8, "proTxHash missing",
|
assert_raises_rpc_error(-8, "proTxHash missing",
|
||||||
mn1.node.quorum, "getdata", 0, 100, quorum_hash, 0x02)
|
mn1.node.quorum, "getdata", 0, 100, quorum_hash, 0x02)
|
||||||
assert_raises_rpc_error(-8, "proTxHash invalid",
|
assert_raises_rpc_error(-8, "proTxHash invalid",
|
||||||
|
Loading…
Reference in New Issue
Block a user