Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account IDs not displayed properly by print-xdr #2528

Closed
MonsieurNicolas opened this issue May 16, 2020 · 0 comments
Closed

account IDs not displayed properly by print-xdr #2528

MonsieurNicolas opened this issue May 16, 2020 · 0 comments
Labels

Comments

@MonsieurNicolas
Copy link
Contributor

Version: 13.0.0

cat <<EOF | base64 -d > txEnvelope.xdr
AAAAAgAAAAAx6z54QxsYlIVyqE2qMVIYC0Q7uuTtM8drEACF449HMAAAAGQAAzWGAAAAAQAAAAAA
AAAAAAAAAQAAAAEAAAEAAAAAAAAAAAAx6z54QxsYlIVyqE2qMVIYC0Q7uuTtM8drEACF449HMAAA
AAEAAAEAAAAAAAAAAHv6UDmDcK48NbjcDmjDKE80W2EhLb7kwZSwjoKlg7eiWQAAAAAAAAAAAAAD
6AAAAAAAAAAB449HMAAAAEA5NEgz0COUMYtTDvv7ycfX56zj1pEO4hyjfK/Ko40fyHyy37ShQu4s
z3myO5kmZEn4LI84jMCwXCYycfgxnxMI
EOF

# ./stellar-core print-xdr txEnvelope.xdr
TransactionEnvelope = {
  type = ENVELOPE_TYPE_TX,
  v1 = {
    tx = {
      sourceAccount = {
        type = KEY_TYPE_ED25519,
        ed25519 = 31eb3e78431b18948572a84daa3152180b443bbae4ed33c76b100085e38f4730
      },
      fee = 100,
      seqNum = 903274572021761,
      timeBounds = NULL,
      memo = {
        type = MEMO_NONE
      },
      operations = [
        { sourceAccount = {
            type = KEY_TYPE_MUXED_ED25519,
            med25519 = {
              id = 0,
              ed25519 = 31eb3e78431b18948572a84daa3152180b443bbae4ed33c76b100085e38f4730
            }
          },
          body = {
            type = PAYMENT,
            paymentOp = {
              destination = {
                type = KEY_TYPE_MUXED_ED25519,
                med25519 = {
                  id = 123,
                  ed25519 = fa50398370ae3c35b8dc0e68c3284f345b61212dbee4c194b08e82a583b7a259
                }
              },
              asset = {
                type = ASSET_TYPE_NATIVE
              },
              amount = 1000
            }
          } }
      ],
      ext = {
        v = 0
      }
    },
    signatures = [
      { hint = e38f4730,
        signature = 39344833d02394318b530efbfbc9c7d7e7ace3d6910ee21ca37cafcaa38d1fc87cb2dfb4a142ee2ccf79b23b99266449f82c8f388cc0b05c263271f8319f1308 }
    ]
  }
}

Couple issues here:

regular accounts are displayed in hex:

sourceAccount = {
        type = KEY_TYPE_ED25519,
        ed25519 = 31eb3e78431b18948572a84daa3152180b443bbae4ed33c76b100085e38f4730
      }

I would expect this to be displayed as
sourceAccount = GAY6WPTYIMNRRFEFOKUE3KRRKIMAWRB3XLSO2M6HNMIABBPDR5DTA3IY

Multiplexed accounts are also displayed in hex:

destination = {
                type = KEY_TYPE_MUXED_ED25519,
                med25519 = {
                  id = 123,
                  ed25519 = fa50398370ae3c35b8dc0e68c3284f345b61212dbee4c194b08e82a583b7a259
                }

Here I would expect this to be displayed as something like:
sourceAccount = { id=123, accountID=GD5FAOMDOCXDYNNY3QHGRQZIJ42FWYJBFW7OJQMUWCHIFJMDW6RFS6XQ }

Note: we should not display multiplexed accounts like above with the alternative StrKey representation M... (as defined in SEPs) as core only reasons about LedgerKeys that are identified by G strkeys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant