Skip to content

Add string representation for all POJOs #12

@dexX7

Description

@dexX7

Let me quickly describe what issue I faced yesterday:

I wanted to dump some intermediate results, in particular of listUnspent, which returns a List of UnspentOutputs.

The change was basically:

@@ -166,2 +166,3 @@ class SendToOwnersReorgSpec extends BaseReorgSpec {
         when: "creating a third STO transaction"
+        println listUnspent(0, 999999)
         def thirdTxid = omniSendSTO(actorAddress, tokenID, 50.divisible)

However, the result:

[com.msgilligan.bitcoinj.json.pojo.UnspentOutput@3a13055a, ...]

It would be nice, if the UnspentOutput (and others) would be converted to something readable, such as:

[{"txid":"hex","vout":n,"address":"1base58",...}, ...]

The Groovy @ToString() class annotation may be useful?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions