feat(rpc): Add service field for each member in quorum info results (#4977)

* feat(rpc): Add `service` field for each member in `quorum info` results

* add test
This commit is contained in:
UdjinM6 2022-08-22 22:43:07 +03:00 committed by GitHub
parent 6699b0228f
commit c078e666a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -111,6 +111,7 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumCPtr& quorum, bool includeMem
auto& dmn = quorum->members[i];
UniValue mo(UniValue::VOBJ);
mo.pushKV("proTxHash", dmn->proTxHash.ToString());
mo.pushKV("service", dmn->pdmnState->addr.ToString());
mo.pushKV("pubKeyOperator", dmn->pdmnState->pubKeyOperator.Get().ToString());
mo.pushKV("valid", quorum->qc->validMembers[i]);
if (quorum->qc->validMembers[i]) {

View File

@ -0,0 +1,31 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import DashTestFramework
from test_framework.util import assert_equal, p2p_port
'''
rpc_quorum.py
Test "quorum" rpc subcommands
'''
class RPCMasternodeTest(DashTestFramework):
def set_test_params(self):
self.set_dash_test_params(4, 3, fast_dip3_enforcement=True)
def run_test(self):
self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0)
self.wait_for_sporks_same()
quorum_hash = self.mine_quorum()
quorum_info = self.nodes[0].quorum("info", 100, quorum_hash)
for idx in range(0, self.mn_count):
mn = self.mninfo[idx]
for member in quorum_info["members"]:
if member["proTxHash"] == mn.proTxHash:
assert_equal(member["service"], '127.0.0.1:%d' % p2p_port(mn.nodeIdx))
if __name__ == '__main__':
RPCMasternodeTest().main()

View File

@ -129,6 +129,7 @@ BASE_SCRIPTS = [
'feature_reindex.py',
'feature_abortnode.py',
# vv Tests less than 30s vv
'rpc_quorum.py',
'wallet_keypool_topup.py',
'interface_zmq_dash.py',
'interface_zmq.py',