mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
fix: creditOutputs
in AssetLock tx json output should be an array of objects, not debug strings
This commit is contained in:
parent
045e178730
commit
ba0e64505b
@ -9,6 +9,7 @@
|
||||
#include <primitives/transaction.h>
|
||||
#include <gsl/pointers.h>
|
||||
|
||||
#include <core_io.h>
|
||||
#include <serialize.h>
|
||||
#include <univalue.h>
|
||||
|
||||
@ -51,14 +52,18 @@ public:
|
||||
|
||||
[[nodiscard]] UniValue ToJson() const
|
||||
{
|
||||
UniValue obj;
|
||||
obj.setObject();
|
||||
obj.pushKV("version", int(nVersion));
|
||||
UniValue outputs;
|
||||
outputs.setArray();
|
||||
for (const CTxOut& out : creditOutputs) {
|
||||
outputs.push_back(out.ToString());
|
||||
UniValue outputs(UniValue::VARR);
|
||||
for (const CTxOut& credit_output : creditOutputs) {
|
||||
UniValue out(UniValue::VOBJ);
|
||||
out.pushKV("value", ValueFromAmount(credit_output.nValue));
|
||||
out.pushKV("valueSat", credit_output.nValue);
|
||||
UniValue spk(UniValue::VOBJ);
|
||||
ScriptPubKeyToUniv(credit_output.scriptPubKey, spk, /* fIncludeHex = */ true, /* include_addresses = */ false);
|
||||
out.pushKV("scriptPubKey", spk);
|
||||
outputs.push_back(out);
|
||||
}
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("version", int(nVersion));
|
||||
obj.pushKV("creditOutputs", outputs);
|
||||
return obj;
|
||||
}
|
||||
|
@ -102,6 +102,7 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
|
||||
"llmq/chainlocks -> net_processing -> llmq/context -> llmq/chainlocks"
|
||||
"coinjoin/client -> coinjoin/coinjoin -> llmq/chainlocks -> net_processing -> coinjoin/client"
|
||||
"rpc/blockchain -> rpc/server -> rpc/blockchain"
|
||||
"core_io -> evo/assetlocktx -> core_io"
|
||||
)
|
||||
|
||||
EXIT_CODE=0
|
||||
|
Loading…
Reference in New Issue
Block a user