Skip to content

Human readable string representations of XDR response types #1146

@ire-and-curses

Description

@ire-and-curses

In #1109, issues with the current returned representation of xdr.TransactionEnvelope and xdr.Transaction were discussed. In particular, a user attempting to understand a TransactionEnvelope and printing it would see something like this:

TransactionEnvelope XDR: &{{{PublicKeyTypePublicKeyTypeEd25519 0xc42046a900} 100 3428311615143941 <nil> {MemoTypeMemoNone <nil> <nil> <nil> <nil>} [{<nil> {OperationTypeBumpSequence <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> 0xc4204604c0}}] {0}} [{[234 46 114 197] [38 61 234 76 148 183 37 38 220 189 79 235 26 180 137 1 130 101 177 129 68 37 14 167 99 132 123 92 94 155 166 205 40 103 55 11 18 44 234 1 38 182 248 144 228 139 127 244 143 162 22 127 240 68 23 64 217 24 106 183 207 135 233 15]}]}

This is clearly unhelpful.

One promising possibility is to use txrep (spec) to pretty-print these nested XDR objects. There is a Go implementation here: https://xdrpp.github.io/stc/pkg/github.com/xdrpp/stc/

Another possibly overlapping approach is to implement the Stringer interface for the xdr structs of interest.

This ticket is to look into these possibilities and implement something better than what we currently have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    horizonclienttag for new horizon client located in clients/horizonclient

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions