|
17 | 17 |
|
18 | 18 | #include <pubkey.h> |
19 | 19 | #include <serialize.h> |
20 | | -#include <version.h> |
21 | 20 |
|
22 | 21 | #include <base58.h> |
23 | 22 | #include <chainparams.h> |
@@ -74,37 +73,6 @@ std::string CSimplifiedMNListEntry::ToString() const |
74 | 73 | operatorPayoutAddress, platformHTTPPort, platformNodeID.ToString(), netInfo->ToString()); |
75 | 74 | } |
76 | 75 |
|
77 | | -UniValue CSimplifiedMNListEntry::ToJson(bool extended) const |
78 | | -{ |
79 | | - UniValue obj(UniValue::VOBJ); |
80 | | - obj.pushKV("nVersion", nVersion); |
81 | | - obj.pushKV("nType", ToUnderlying(nType)); |
82 | | - obj.pushKV("proRegTxHash", proRegTxHash.ToString()); |
83 | | - obj.pushKV("confirmedHash", confirmedHash.ToString()); |
84 | | - if (IsServiceDeprecatedRPCEnabled()) { |
85 | | - obj.pushKV("service", netInfo->GetPrimary().ToStringAddrPort()); |
86 | | - } |
87 | | - obj.pushKV("addresses", netInfo->ToJson()); |
88 | | - obj.pushKV("pubKeyOperator", pubKeyOperator.ToString()); |
89 | | - obj.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting))); |
90 | | - obj.pushKV("isValid", isValid); |
91 | | - if (nType == MnType::Evo) { |
92 | | - obj.pushKV("platformHTTPPort", platformHTTPPort); |
93 | | - obj.pushKV("platformNodeID", platformNodeID.ToString()); |
94 | | - } |
95 | | - |
96 | | - if (extended) { |
97 | | - CTxDestination dest; |
98 | | - if (ExtractDestination(scriptPayout, dest)) { |
99 | | - obj.pushKV("payoutAddress", EncodeDestination(dest)); |
100 | | - } |
101 | | - if (ExtractDestination(scriptOperatorPayout, dest)) { |
102 | | - obj.pushKV("operatorPayoutAddress", EncodeDestination(dest)); |
103 | | - } |
104 | | - } |
105 | | - return obj; |
106 | | -} |
107 | | - |
108 | 76 | CSimplifiedMNList::CSimplifiedMNList(const std::vector<CSimplifiedMNListEntry>& smlEntries) |
109 | 77 | { |
110 | 78 | mnList.reserve(smlEntries.size()); |
@@ -243,69 +211,6 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager& |
243 | 211 | return true; |
244 | 212 | } |
245 | 213 |
|
246 | | -UniValue CSimplifiedMNListDiff::ToJson(bool extended) const |
247 | | -{ |
248 | | - UniValue obj(UniValue::VOBJ); |
249 | | - |
250 | | - obj.pushKV("nVersion", nVersion); |
251 | | - obj.pushKV("baseBlockHash", baseBlockHash.ToString()); |
252 | | - obj.pushKV("blockHash", blockHash.ToString()); |
253 | | - |
254 | | - CDataStream ssCbTxMerkleTree(SER_NETWORK, PROTOCOL_VERSION); |
255 | | - ssCbTxMerkleTree << cbTxMerkleTree; |
256 | | - obj.pushKV("cbTxMerkleTree", HexStr(ssCbTxMerkleTree)); |
257 | | - |
258 | | - obj.pushKV("cbTx", EncodeHexTx(*cbTx)); |
259 | | - |
260 | | - UniValue deletedMNsArr(UniValue::VARR); |
261 | | - for (const auto& h : deletedMNs) { |
262 | | - deletedMNsArr.push_back(h.ToString()); |
263 | | - } |
264 | | - obj.pushKV("deletedMNs", deletedMNsArr); |
265 | | - |
266 | | - UniValue mnListArr(UniValue::VARR); |
267 | | - for (const auto& e : mnList) { |
268 | | - mnListArr.push_back(e.ToJson(extended)); |
269 | | - } |
270 | | - obj.pushKV("mnList", mnListArr); |
271 | | - |
272 | | - UniValue deletedQuorumsArr(UniValue::VARR); |
273 | | - for (const auto& e : deletedQuorums) { |
274 | | - UniValue eObj(UniValue::VOBJ); |
275 | | - eObj.pushKV("llmqType", e.first); |
276 | | - eObj.pushKV("quorumHash", e.second.ToString()); |
277 | | - deletedQuorumsArr.push_back(eObj); |
278 | | - } |
279 | | - obj.pushKV("deletedQuorums", deletedQuorumsArr); |
280 | | - |
281 | | - UniValue newQuorumsArr(UniValue::VARR); |
282 | | - for (const auto& e : newQuorums) { |
283 | | - newQuorumsArr.push_back(e.ToJson()); |
284 | | - } |
285 | | - obj.pushKV("newQuorums", newQuorumsArr); |
286 | | - |
287 | | - // Do not assert special tx type here since this can be called prior to DIP0003 activation |
288 | | - if (const auto opt_cbTxPayload = GetTxPayload<CCbTx>(*cbTx, /*assert_type=*/false)) { |
289 | | - obj.pushKV("merkleRootMNList", opt_cbTxPayload->merkleRootMNList.ToString()); |
290 | | - if (opt_cbTxPayload->nVersion >= CCbTx::Version::MERKLE_ROOT_QUORUMS) { |
291 | | - obj.pushKV("merkleRootQuorums", opt_cbTxPayload->merkleRootQuorums.ToString()); |
292 | | - } |
293 | | - } |
294 | | - |
295 | | - UniValue quorumsCLSigsArr(UniValue::VARR); |
296 | | - for (const auto& [signature, quorumsIndexes] : quorumsCLSigs) { |
297 | | - UniValue j(UniValue::VOBJ); |
298 | | - UniValue idxArr(UniValue::VARR); |
299 | | - for (const auto& idx : quorumsIndexes) { |
300 | | - idxArr.push_back(idx); |
301 | | - } |
302 | | - j.pushKV(signature.ToString(),idxArr); |
303 | | - quorumsCLSigsArr.push_back(j); |
304 | | - } |
305 | | - obj.pushKV("quorumsCLSigs", quorumsCLSigsArr); |
306 | | - return obj; |
307 | | -} |
308 | | - |
309 | 214 | CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& from, const CDeterministicMNList& to, bool extended) |
310 | 215 | { |
311 | 216 | CSimplifiedMNListDiff diffRet; |
|
0 commit comments