|
3 | 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
4 | 4 |
|
5 | 5 | #include <core_io.h> |
| 6 | +#include <util/underlying.h> |
| 7 | + |
6 | 8 | #include <evo/assetlocktx.h> |
7 | 9 | #include <evo/cbtx.h> |
8 | 10 | #include <evo/mnhftx.h> |
|
28 | 30 | } |
29 | 31 |
|
30 | 32 | UniValue ret(UniValue::VOBJ); |
31 | | - ret.pushKV("version", int(nVersion)); |
| 33 | + ret.pushKV("version", nVersion); |
32 | 34 | ret.pushKV("creditOutputs", outputs); |
33 | 35 | return ret; |
34 | 36 | } |
35 | 37 |
|
36 | 38 | [[nodiscard]] UniValue CAssetUnlockPayload::ToJson() const |
37 | 39 | { |
38 | 40 | UniValue ret(UniValue::VOBJ); |
39 | | - ret.pushKV("version", int(nVersion)); |
40 | | - ret.pushKV("index", int(index)); |
41 | | - ret.pushKV("fee", int(fee)); |
42 | | - ret.pushKV("requestedHeight", int(requestedHeight)); |
| 41 | + ret.pushKV("version", nVersion); |
| 42 | + ret.pushKV("index", index); |
| 43 | + ret.pushKV("fee", fee); |
| 44 | + ret.pushKV("requestedHeight", requestedHeight); |
43 | 45 | ret.pushKV("quorumHash", quorumHash.ToString()); |
44 | 46 | ret.pushKV("quorumSig", quorumSig.ToString()); |
45 | 47 | return ret; |
|
48 | 50 | [[nodiscard]] UniValue CCbTx::ToJson() const |
49 | 51 | { |
50 | 52 | UniValue ret(UniValue::VOBJ); |
51 | | - ret.pushKV("version", (int)nVersion); |
| 53 | + ret.pushKV("version", ToUnderlying(nVersion)); |
52 | 54 | ret.pushKV("height", nHeight); |
53 | 55 | ret.pushKV("merkleRootMNList", merkleRootMNList.ToString()); |
54 | 56 | if (nVersion >= CCbTx::Version::MERKLE_ROOT_QUORUMS) { |
55 | 57 | ret.pushKV("merkleRootQuorums", merkleRootQuorums.ToString()); |
56 | 58 | if (nVersion >= CCbTx::Version::CLSIG_AND_BALANCE) { |
57 | | - ret.pushKV("bestCLHeightDiff", static_cast<int>(bestCLHeightDiff)); |
| 59 | + ret.pushKV("bestCLHeightDiff", bestCLHeightDiff); |
58 | 60 | ret.pushKV("bestCLSignature", bestCLSignature.ToString()); |
59 | 61 | ret.pushKV("creditPoolBalance", ValueFromAmount(creditPoolBalance)); |
60 | 62 | } |
|
68 | 70 | ret.pushKV("version", nVersion); |
69 | 71 | ret.pushKV("type", ToUnderlying(nType)); |
70 | 72 | ret.pushKV("collateralHash", collateralOutpoint.hash.ToString()); |
71 | | - ret.pushKV("collateralIndex", (int)collateralOutpoint.n); |
| 73 | + ret.pushKV("collateralIndex", collateralOutpoint.n); |
72 | 74 | if (IsServiceDeprecatedRPCEnabled()) { |
73 | 75 | ret.pushKV("service", netInfo->GetPrimary().ToStringAddrPort()); |
74 | 76 | } |
|
108 | 110 | UniValue ret(UniValue::VOBJ); |
109 | 111 | ret.pushKV("version", nVersion); |
110 | 112 | ret.pushKV("proTxHash", proTxHash.ToString()); |
111 | | - ret.pushKV("reason", (int)nReason); |
| 113 | + ret.pushKV("reason", nReason); |
112 | 114 | ret.pushKV("inputsHash", inputsHash.ToString()); |
113 | 115 | return ret; |
114 | 116 | } |
|
138 | 140 | [[nodiscard]] UniValue MNHFTxPayload::ToJson() const |
139 | 141 | { |
140 | 142 | UniValue ret(UniValue::VOBJ); |
141 | | - ret.pushKV("version", (int)nVersion); |
| 143 | + ret.pushKV("version", nVersion); |
142 | 144 | ret.pushKV("signal", signal.ToJson()); |
143 | 145 | return ret; |
144 | 146 | } |
145 | 147 |
|
146 | 148 | [[nodiscard]] UniValue llmq::CFinalCommitmentTxPayload::ToJson() const |
147 | 149 | { |
148 | 150 | UniValue ret(UniValue::VOBJ); |
149 | | - ret.pushKV("version", int{nVersion}); |
150 | | - ret.pushKV("height", int(nHeight)); |
| 151 | + ret.pushKV("version", nVersion); |
| 152 | + ret.pushKV("height", nHeight); |
151 | 153 | ret.pushKV("commitment", commitment.ToJson()); |
152 | 154 | return ret; |
153 | 155 | } |
|
0 commit comments