Skip to content

Commit 873f1b3

Browse files
Merge #6607: feat: add id to getislocks rpc output
1107202 docs: add release notes (UdjinM6) 24d96d6 test: add test (UdjinM6) fec75a3 feat: add `id` to `getislocks` rpc output (UdjinM6) Pull request description: ## Issue being fixed or feature implemented `verifyislock` rpc needs request `id` as a param but `getislocks` (or any other rpc) doesn't provide one so it's hard to use ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: knst: utACK 1107202 PastaPastaPasta: utACK 1107202 Tree-SHA512: e23a32bfe802496a02348eac4e9cfbfb9b062c0e21eba6f401cd40c145e7c8474ece3b01fd271ea2ac98c2350a0bdf2b50a132281bf5045c18ec22657a5d472d
2 parents 7fc9a7b + 1107202 commit 873f1b3

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

doc/release-notes-6607.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Updated RPCs
2+
------------
3+
4+
* `getislocks` will now return request `id` for each InstantSend Lock in results

src/rpc/rawtransaction.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ static RPCHelpMan getislocks()
387387
},
388388
},
389389
}},
390+
{RPCResult::Type::STR_HEX, "id", "Request ID"},
390391
{RPCResult::Type::STR_HEX, "cycleHash", "The Cycle Hash"},
391392
{RPCResult::Type::STR_HEX, "signature", "The InstantSend's BLS signature"},
392393
{RPCResult::Type::STR_HEX, "hex", "The serialized, hex-encoded data for 'txid'"},
@@ -424,6 +425,7 @@ static RPCHelpMan getislocks()
424425
inputs.push_back(outpoint);
425426
}
426427
objIS.pushKV("inputs", inputs);
428+
objIS.pushKV("id", islock->GetRequestId().ToString());
427429
objIS.pushKV("cycleHash", islock->cycleHash.ToString());
428430
objIS.pushKV("signature", islock->sig.ToString());
429431
{

test/functional/rpc_verifyislock.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from test_framework.messages import CTransaction, from_hex, hash256, ser_compact_size, ser_string
77
from test_framework.test_framework import DashTestFramework
8-
from test_framework.util import assert_raises_rpc_error, satoshi_round
8+
from test_framework.util import assert_equal, assert_raises_rpc_error, satoshi_round
99

1010
'''
1111
rpc_verifyislock.py
@@ -41,6 +41,8 @@ def run_test(self):
4141
self.wait_for_instantlock(txid, node)
4242

4343
request_id = self.get_request_id(self.nodes[0].getrawtransaction(txid))
44+
request_id_rpc = self.nodes[0].getislocks([txid])[0]["id"]
45+
assert_equal(request_id, request_id_rpc)
4446
self.wait_until(lambda: node.quorum("hasrecsig", 103, request_id, txid))
4547

4648
rec_sig = node.quorum("getrecsig", 103, request_id, txid)['sig']

0 commit comments

Comments
 (0)