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

send_transaction mutation returns non-encoded txid #58

Open
elderapo opened this issue Mar 21, 2023 · 1 comment
Open

send_transaction mutation returns non-encoded txid #58

elderapo opened this issue Mar 21, 2023 · 1 comment

Comments

@elderapo
Copy link

The following graphl query:

mutation SendTx {
  send_transaction(
    request: {
      encoded_hex: "0100000001f17ebad1a9324ff82faf9b5054066bc5172bc6cf3ea78219400648a61015eb07000000006441cbed835372fca913a22b41fa1f54a62fcf2d66de86b59444bd8fbf3d4ba4056c2ceb58e34fa5d7222535a4759d465fa7fc4bcf474e1d938f32ccfe5b5816de8141210277ca380aff06f4cb50047c14a4ec192b0c9d30d5caad7fc9b4002bc0a69ecd59feffffff0239590000000000001976a914fe0d9c981cd67b0181d5f994ac77b391fe74244988ac97c57900000000001976a9146aef70d3eb17970780647492589deb34b18eab6f88ac87f90b00"
      node_internal_id: 3
    }
  ) {
    transaction_hash
    validation_success
    transmission_success
    transmission_error_message
    transmission_error_message
  }
}

returns:

{
  "data": {
    "send_transaction": {
      "transaction_hash": "8d800122aa869bb081f8308aebdad74fc96ae8e565af600c6dace2454533e237",
      "validation_success": true,
      "transmission_success": true
    }
  }
}

but for consistency I think it should return:

{
  "data": {
    "send_transaction": {
      "transaction_hash": "\\x8d800122aa869bb081f8308aebdad74fc96ae8e565af600c6dace2454533e237",
      "validation_success": true,
      "transmission_success": true
    }
  }
}
@bitjson
Copy link
Member

bitjson commented Mar 27, 2023

Thanks for the issue!

Yes, there are several places where the returned result is just a hex string rather than Postgres' bytea hex encoding. My preferred solution would be to fix #48 such that all hex-encoded values are returned without the escape sequence.

I'm not able to focus on this currently, but I would love to merge a PR if you're interested!

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

No branches or pull requests

2 participants