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

Update /v1/chain/push_transaction expected response structure #193

Open
maoueh opened this issue Nov 17, 2022 · 3 comments
Open

Update /v1/chain/push_transaction expected response structure #193

maoueh opened this issue Nov 17, 2022 · 3 comments

Comments

@maoueh
Copy link
Contributor

maoueh commented Nov 17, 2022

It seems https://github.com/eoscanada/eos-go/blob/develop/responses.go#L353 is not aligned at all with expected response. It seems the expected format is now:

{
  "transaction_id": "203b76d8740587ad1898348e76799378eb013d2ad1b285f54e0abfa89769d850",
  "processed": {
    "id": "203b76d8740587ad1898348e76799378eb013d2ad1b285f54e0abfa89769d850",
    "block_num": 27873928,
    "block_time": "2022-07-20T09:20:41.000",
    "producer_block_id": null,
    "receipt": {
      "status": "executed",
      "cpu_usage_us": 163,
      "net_usage_words": 35
    },
    "elapsed": 163,
    "net_usage": 280,
    "scheduled": false,
    "action_traces": [
      {
        "action_ordinal": 1,
        "creator_action_ordinal": 0,
        "closest_unnotified_ancestor_action_ordinal": 0,
        "receipt": {
          "receiver": "datamgr",
          "act_digest": "2071a841c039d58517cd67502319a73b219b3f4be5fd922b3419aea3fc17e9c3",
          "global_sequence": 27875025,
          "recv_sequence": 55,
          "auth_sequence": [
            [
              "datamgr",
              66
            ]
          ],
          "code_sequence": 6,
          "abi_sequence": 5
        },
        "receiver": "datamgr",
        "act": {
          "account": "datamgr",
          "name": "dataopt",
          "authorization": [
            {
              "actor": "datamgr",
              "permission": "active"
            }
          ],
          "data": {
            "source_org": "\nproject_i",
            "dest_org": "\u0000\bmetadata\u000f{test@20220719}\u0003opt\u0007publish\nsource_org\tstarchain\rresource_type\u0007dataset\bresource\tojsodfd90",
            "project_id": "create_by",
            "metadata": "小明",
            "resource_type": "extra_params",
            "resource": "{\"aa\":111}",
            "opt": "account",
            "create_by": "datamgr",
            "extra_params": "dest_org"
          },
          "hex_data": "0a0a70726f6a6563745f696400086d657461646174610f7b746573744032303232303731397d036f7074077075626c6973680a736f757263655f6f72670973746172636861696e0d7265736f757263655f747970650764617461736574087265736f75726365096f6a736f6466643930096372656174655f627906e5b08fe6988e0c65787472615f706172616d730a7b226161223a3131317d076163636f756e7407646174616d677208646573745f6f72670861736961696e666f"
        },
        "context_free": false,
        "elapsed": 40,
        "console": "",
        "trx_id": "203b76d8740587ad1898348e76799378eb013d2ad1b285f54e0abfa89769d850",
        "block_num": 27873928,
        "block_time": "2022-07-20T09:20:41.000",
        "producer_block_id": null,
        "account_ram_deltas": [],
        "account_disk_deltas": [],
        "except": null,
        "error_code": null,
        "return_value_hex_data": "",
        "inline_traces": []
      }
    ],
    "account_ram_delta": null,
    "except": null,
    "error_code": null
  }
}

We would need to fully align the expected response with the actual struct.

@psy2848048
Copy link
Contributor

Could you please share the encoded hex of this response, or another response with the encoded hex pair?

@maoueh
Copy link
Contributor Author

maoueh commented Jan 3, 2023

@psy2848048 I don't sadly, this was taken from #187 which I did not do myself.

Some transaction would need to be pushed to a testnet to see the actual response and the hex version of it.

@pnx
Copy link
Contributor

pnx commented Apr 14, 2023

The format has even changed again :) i have attached below the json returned:

{
  "transaction_id": "de46081fa7abad65cb6e6ad65581f8853e4ffd9a60466467a2bedd99bb0a320f",
  "processed": {
    "id": "de46081fa7abad65cb6e6ad65581f8853e4ffd9a60466467a2bedd99bb0a320f",
    "block_num": 211131824,
    "block_time": "2023-04-14T06:19:25.000",
    "producer_block_id": null,
    "receipt": {
      "status": "executed",
      "cpu_usage_us": 416,
      "net_usage_words": 17
    },
    "elapsed": 416,
    "net_usage": 136,
    "scheduled": false,
    "action_traces": [
      {
        "action_ordinal": 1,
        "creator_action_ordinal": 0,
        "closest_unnotified_ancestor_action_ordinal": 0,
        "receipt": {
          "receiver": "eosio.token",
          "act_digest": "3c815606b2be40db3d8705e031830e919fc46544d29a3b8edea7e7ee84b118c6",
          "global_sequence": 438034461,
          "recv_sequence": 8529839,
          "auth_sequence": [
            [
              "hhtest111111",
              141
            ]
          ],
          "code_sequence": 1,
          "abi_sequence": 1
        },
        "receiver": "eosio.token",
        "act": {
          "account": "eosio.token",
          "name": "transfer",
          "authorization": [
            {
              "actor": "hhtest111111",
              "permission": "active"
            }
          ],
          "data": {
            "from": "hhtest111111",
            "to": "hhtest111112",
            "quantity": "0.00001000 WAX",
            "memo": "test"
          },
          "hex_data": "1042082164ac726b2042082164ac726be80300000000000008574158000000000474657374"
        },
        "context_free": false,
        "elapsed": 187,
        "console": "",
        "trx_id": "de46081fa7abad65cb6e6ad65581f8853e4ffd9a60466467a2bedd99bb0a320f",
        "block_num": 211131824,
        "block_time": "2023-04-14T06:19:25.000",
        "producer_block_id": null,
        "account_ram_deltas": [],
        "except": null,
        "error_code": null,
        "return_value_hex_data": ""
      },
      {
        "action_ordinal": 2,
        "creator_action_ordinal": 1,
        "closest_unnotified_ancestor_action_ordinal": 1,
        "receipt": {
          "receiver": "hhtest111111",
          "act_digest": "3c815606b2be40db3d8705e031830e919fc46544d29a3b8edea7e7ee84b118c6",
          "global_sequence": 438034462,
          "recv_sequence": 103,
          "auth_sequence": [
            [
              "hhtest111111",
              142
            ]
          ],
          "code_sequence": 1,
          "abi_sequence": 1
        },
        "receiver": "hhtest111111",
        "act": {
          "account": "eosio.token",
          "name": "transfer",
          "authorization": [
            {
              "actor": "hhtest111111",
              "permission": "active"
            }
          ],
          "data": {
            "from": "hhtest111111",
            "to": "hhtest111112",
            "quantity": "0.00001000 WAX",
            "memo": "test"
          },
          "hex_data": "1042082164ac726b2042082164ac726be80300000000000008574158000000000474657374"
        },
        "context_free": false,
        "elapsed": 12,
        "console": "",
        "trx_id": "de46081fa7abad65cb6e6ad65581f8853e4ffd9a60466467a2bedd99bb0a320f",
        "block_num": 211131824,
        "block_time": "2023-04-14T06:19:25.000",
        "producer_block_id": null,
        "account_ram_deltas": [],
        "except": null,
        "error_code": null,
        "return_value_hex_data": ""
      },
      {
        "action_ordinal": 3,
        "creator_action_ordinal": 1,
        "closest_unnotified_ancestor_action_ordinal": 1,
        "receipt": {
          "receiver": "hhtest111112",
          "act_digest": "3c815606b2be40db3d8705e031830e919fc46544d29a3b8edea7e7ee84b118c6",
          "global_sequence": 438034463,
          "recv_sequence": 94,
          "auth_sequence": [
            [
              "hhtest111111",
              143
            ]
          ],
          "code_sequence": 1,
          "abi_sequence": 1
        },
        "receiver": "hhtest111112",
        "act": {
          "account": "eosio.token",
          "name": "transfer",
          "authorization": [
            {
              "actor": "hhtest111111",
              "permission": "active"
            }
          ],
          "data": {
            "from": "hhtest111111",
            "to": "hhtest111112",
            "quantity": "0.00001000 WAX",
            "memo": "test"
          },
          "hex_data": "1042082164ac726b2042082164ac726be80300000000000008574158000000000474657374"
        },
        "context_free": false,
        "elapsed": 11,
        "console": "",
        "trx_id": "de46081fa7abad65cb6e6ad65581f8853e4ffd9a60466467a2bedd99bb0a320f",
        "block_num": 211131824,
        "block_time": "2023-04-14T06:19:25.000",
        "producer_block_id": null,
        "account_ram_deltas": [],
        "except": null,
        "error_code": null,
        "return_value_hex_data": ""
      }
    ],
    "account_ram_delta": null,
    "except": null,
    "error_code": null
  }
}

I executed this with: raw, err := api.PushTransactionRaw(context.Background(), packedTrx) against our testserver (v3.1.1wax01)

Can we do anything about this? i could update the structs, but do we break older versions?

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

3 participants