mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
chore: prettify json representations of CSimplifiedMNListEntry and CSimplifiedMNListDiff (#5434)
## Issue being fixed or feature implemented Should fix https://github.com/dashpay/dash/pull/5424#discussion_r1228654939 and make `CSimplifiedMNListEntry`'s json a bit more human-friendly (imo) by having `nVersion` and `nType` at the top of it. Move `nVersion` up for `CSimplifiedMNListDiff` too. NOTE: `nVersion` wasn't actually duplicated in rpc results, it was simply assigned twice inside. still not nice though. Thanks @thephez ! 👍 ## What was done? ## How Has This Been Tested? ## Breaking Changes n/a ## Checklist: - [x] 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 - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
This commit is contained in:
parent
44cd30f2f7
commit
8dbdd59be7
@ -67,14 +67,13 @@ void CSimplifiedMNListEntry::ToJson(UniValue& obj, bool extended) const
|
|||||||
obj.clear();
|
obj.clear();
|
||||||
obj.setObject();
|
obj.setObject();
|
||||||
obj.pushKV("nVersion", nVersion);
|
obj.pushKV("nVersion", nVersion);
|
||||||
|
obj.pushKV("nType", ToUnderlying(nType));
|
||||||
obj.pushKV("proRegTxHash", proRegTxHash.ToString());
|
obj.pushKV("proRegTxHash", proRegTxHash.ToString());
|
||||||
obj.pushKV("confirmedHash", confirmedHash.ToString());
|
obj.pushKV("confirmedHash", confirmedHash.ToString());
|
||||||
obj.pushKV("service", service.ToString(false));
|
obj.pushKV("service", service.ToString(false));
|
||||||
obj.pushKV("pubKeyOperator", pubKeyOperator.ToString());
|
obj.pushKV("pubKeyOperator", pubKeyOperator.ToString());
|
||||||
obj.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting)));
|
obj.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting)));
|
||||||
obj.pushKV("isValid", isValid);
|
obj.pushKV("isValid", isValid);
|
||||||
obj.pushKV("nVersion", nVersion);
|
|
||||||
obj.pushKV("nType", ToUnderlying(nType));
|
|
||||||
if (nType == MnType::HighPerformance) {
|
if (nType == MnType::HighPerformance) {
|
||||||
obj.pushKV("platformHTTPPort", platformHTTPPort);
|
obj.pushKV("platformHTTPPort", platformHTTPPort);
|
||||||
obj.pushKV("platformNodeID", platformNodeID.ToString());
|
obj.pushKV("platformNodeID", platformNodeID.ToString());
|
||||||
@ -185,6 +184,7 @@ void CSimplifiedMNListDiff::ToJson(UniValue& obj, bool extended) const
|
|||||||
{
|
{
|
||||||
obj.setObject();
|
obj.setObject();
|
||||||
|
|
||||||
|
obj.pushKV("nVersion", nVersion);
|
||||||
obj.pushKV("baseBlockHash", baseBlockHash.ToString());
|
obj.pushKV("baseBlockHash", baseBlockHash.ToString());
|
||||||
obj.pushKV("blockHash", blockHash.ToString());
|
obj.pushKV("blockHash", blockHash.ToString());
|
||||||
|
|
||||||
@ -207,7 +207,6 @@ void CSimplifiedMNListDiff::ToJson(UniValue& obj, bool extended) const
|
|||||||
mnListArr.push_back(eObj);
|
mnListArr.push_back(eObj);
|
||||||
}
|
}
|
||||||
obj.pushKV("mnList", mnListArr);
|
obj.pushKV("mnList", mnListArr);
|
||||||
obj.pushKV("nVersion", nVersion);
|
|
||||||
|
|
||||||
UniValue deletedQuorumsArr(UniValue::VARR);
|
UniValue deletedQuorumsArr(UniValue::VARR);
|
||||||
for (const auto& e : deletedQuorums) {
|
for (const auto& e : deletedQuorums) {
|
||||||
|
Loading…
Reference in New Issue
Block a user