mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
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:
parent
6699b0228f
commit
c078e666a4
@ -111,6 +111,7 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumCPtr& quorum, bool includeMem
|
|||||||
auto& dmn = quorum->members[i];
|
auto& dmn = quorum->members[i];
|
||||||
UniValue mo(UniValue::VOBJ);
|
UniValue mo(UniValue::VOBJ);
|
||||||
mo.pushKV("proTxHash", dmn->proTxHash.ToString());
|
mo.pushKV("proTxHash", dmn->proTxHash.ToString());
|
||||||
|
mo.pushKV("service", dmn->pdmnState->addr.ToString());
|
||||||
mo.pushKV("pubKeyOperator", dmn->pdmnState->pubKeyOperator.Get().ToString());
|
mo.pushKV("pubKeyOperator", dmn->pdmnState->pubKeyOperator.Get().ToString());
|
||||||
mo.pushKV("valid", quorum->qc->validMembers[i]);
|
mo.pushKV("valid", quorum->qc->validMembers[i]);
|
||||||
if (quorum->qc->validMembers[i]) {
|
if (quorum->qc->validMembers[i]) {
|
||||||
|
31
test/functional/rpc_quorum.py
Normal file
31
test/functional/rpc_quorum.py
Normal 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()
|
@ -129,6 +129,7 @@ BASE_SCRIPTS = [
|
|||||||
'feature_reindex.py',
|
'feature_reindex.py',
|
||||||
'feature_abortnode.py',
|
'feature_abortnode.py',
|
||||||
# vv Tests less than 30s vv
|
# vv Tests less than 30s vv
|
||||||
|
'rpc_quorum.py',
|
||||||
'wallet_keypool_topup.py',
|
'wallet_keypool_topup.py',
|
||||||
'interface_zmq_dash.py',
|
'interface_zmq_dash.py',
|
||||||
'interface_zmq.py',
|
'interface_zmq.py',
|
||||||
|
Loading…
Reference in New Issue
Block a user