File tree Expand file tree Collapse file tree 6 files changed +9
-20
lines changed Expand file tree Collapse file tree 6 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ std::string CDeterministicMN::ToString() const
4444
4545UniValue CDeterministicMN::ToJson () const
4646{
47- UniValue obj;
48- obj.setObject ();
49-
47+ UniValue obj (UniValue::VOBJ);
5048 obj.pushKV (" type" , std::string (GetMnType (nType).description ));
5149 obj.pushKV (" proTxHash" , proTxHash.ToString ());
5250 obj.pushKV (" collateralHash" , collateralOutpoint.hash .ToString ());
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ std::string CDeterministicMNState::ToString() const
3737
3838UniValue CDeterministicMNState::ToJson (MnType nType) const
3939{
40- UniValue obj;
41- obj.setObject ();
40+ UniValue obj (UniValue::VOBJ);
4241 obj.pushKV (" version" , nVersion);
4342 obj.pushKV (" service" , addr.ToStringAddrPort ());
4443 obj.pushKV (" registeredHeight" , nRegisteredHeight);
@@ -69,8 +68,7 @@ UniValue CDeterministicMNState::ToJson(MnType nType) const
6968
7069UniValue CDeterministicMNStateDiff::ToJson (MnType nType) const
7170{
72- UniValue obj;
73- obj.setObject ();
71+ UniValue obj (UniValue::VOBJ);
7472 if (fields & Field_nVersion) {
7573 obj.pushKV (" version" , state.nVersion );
7674 }
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ class MNHFTx
4949
5050 [[nodiscard]] UniValue ToJson () const
5151 {
52- UniValue obj;
53- obj.clear ();
54- obj.setObject ();
52+ UniValue obj (UniValue::VOBJ);
5553 obj.pushKV (" versionBit" , (int )versionBit);
5654 obj.pushKV (" quorumHash" , quorumHash.ToString ());
5755 obj.pushKV (" sig" , sig.ToString ());
Original file line number Diff line number Diff line change @@ -72,8 +72,7 @@ std::string CSimplifiedMNListEntry::ToString() const
7272
7373UniValue CSimplifiedMNListEntry::ToJson (bool extended) const
7474{
75- UniValue obj;
76- obj.setObject ();
75+ UniValue obj (UniValue::VOBJ);
7776 obj.pushKV (" nVersion" , nVersion);
7877 obj.pushKV (" nType" , ToUnderlying (nType));
7978 obj.pushKV (" proRegTxHash" , proRegTxHash.ToString ());
@@ -239,8 +238,7 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager&
239238
240239UniValue CSimplifiedMNListDiff::ToJson (bool extended) const
241240{
242- UniValue obj;
243- obj.setObject ();
241+ UniValue obj (UniValue::VOBJ);
244242
245243 obj.pushKV (" nVersion" , nVersion);
246244 obj.pushKV (" baseBlockHash" , baseBlockHash.ToString ());
Original file line number Diff line number Diff line change @@ -121,8 +121,7 @@ class CFinalCommitment
121121
122122 [[nodiscard]] UniValue ToJson () const
123123 {
124- UniValue obj;
125- obj.setObject ();
124+ UniValue obj (UniValue::VOBJ);
126125 obj.pushKV (" version" , int {nVersion});
127126 obj.pushKV (" llmqType" , ToUnderlying (llmqType));
128127 obj.pushKV (" quorumHash" , quorumHash.ToString ());
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ static const std::string DB_QUORUM_SNAPSHOT = "llmq_S";
2323
2424UniValue CQuorumSnapshot::ToJson () const
2525{
26- UniValue obj;
27- obj.setObject ();
26+ UniValue obj (UniValue::VOBJ);
2827 UniValue activeQ (UniValue::VARR);
2928 for (const bool h : activeQuorumMembers) {
3029 // cppcheck-suppress useStlAlgorithm
@@ -43,8 +42,7 @@ UniValue CQuorumSnapshot::ToJson() const
4342
4443UniValue CQuorumRotationInfo::ToJson () const
4544{
46- UniValue obj;
47- obj.setObject ();
45+ UniValue obj (UniValue::VOBJ);
4846 obj.pushKV (" extraShare" , extraShare);
4947
5048 obj.pushKV (" quorumSnapshotAtHMinusC" , quorumSnapshotAtHMinusC.ToJson ());
You can’t perform that action at this time.
0 commit comments