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

cleos get transaction_id enhancements #6829

Merged
merged 3 commits into from Mar 11, 2019

Conversation

@heifner
Copy link
Contributor

commented Feb 25, 2019

Change Description

  • Currently cleos get transaction_id only works for un-exploded action data. See #4892 (review) .
  • Also variant from file/string will return a default constructed transaction if file/string does not actually contain json with transaction attributes. Added a check for this case.
  • Automatically use actions.hex_data for actions.data if action.hex_data is provided.
  • In the future, cleos get transaction_id could be improved to support exploded action data if abi is provided.

Consensus Changes

None

API Changes

None

Documentation Additions

  • It should be noted that cleos get transaction_id currently only works for un-exploded action data.

For example:

{
          "expiration": "2019-02-25T13:27:39",
          "ref_block_num": 8695,
          "ref_block_prefix": 3632563554,
          "max_net_usage_words": 0,
          "max_cpu_usage_ms": 0,
          "delay_sec": 0,
          "context_free_actions": [],
          "actions": [
            {
              "account": "eosio.token",
              "name": "transfer",
              "authorization": [
                {
                  "actor": "zjtzjt535353",
                  "permission": "active"
                }
              ],
              "data": {
                "from": "zjtzjt535353",
                "to": "pokereosgame",
                "quantity": "1.2976 EOS",
                "memo": "bet:3244,seed:GWiwC4MTyHKZNCM2YcBC,ref:bitpie4users"
              },
          ],
          "transaction_extensions": []
        }

Will NOT work because data is exploded. However, this will work:

{
          "expiration": "2019-02-25T13:27:39",
          "ref_block_num": 8695,
          "ref_block_prefix": 3632563554,
          "max_net_usage_words": 0,
          "max_cpu_usage_ms": 0,
          "delay_sec": 0,
          "context_free_actions": [],
          "actions": [
            {
              "account": "eosio.token",
              "name": "transfer",
              "authorization": [
                {
                  "actor": "zjtzjt535353",
                  "permission": "active"
                }
              ],
              "data": {
                "from": "zjtzjt535353",
                "to": "pokereosgame",
                "quantity": "1.2976 EOS",
                "memo": "bet:3244,seed:GWiwC4MTyHKZNCM2YcBC,ref:bitpie4users"
              },
              "hex_data": "30ca28a3e4f7f3fba0a46198aaab20adb03200000000000004454f5300000000336265743a333234342c736565643a4757697743344d5479484b5a4e434d32596342432c7265663a626974706965347573657273"
            }
          ],
          "transaction_extensions": []
        }

As get transaction_id now will use actions.hex_data as actions.data if actions.hex_data is provided.

@heifner heifner changed the title Better error handling for cleos get transaction_id cleos get transaction_id enhancements Feb 25, 2019

@heifner heifner merged commit 5b1bf85 into develop Mar 11, 2019

30 checks passed

buildkite/eosio Build #8826 passed (32 minutes, 59 seconds)
Details
buildkite/eosio/aws-1-build Passed (7 minutes, 1 second)
Details
buildkite/eosio/aws-1-np-tests Passed (13 minutes, 17 seconds)
Details
buildkite/eosio/aws-1-tests Passed (2 minutes, 49 seconds)
Details
buildkite/eosio/centos-7-build Passed (7 minutes, 47 seconds)
Details
buildkite/eosio/centos-7-np-tests Passed (13 minutes, 32 seconds)
Details
buildkite/eosio/centos-7-package-builder Passed (1 minute, 54 seconds)
Details
buildkite/eosio/centos-7-tests Passed (3 minutes, 19 seconds)
Details
buildkite/eosio/darwin-brew-updater Passed (6 seconds)
Details
buildkite/eosio/darwin-high-sierra-build Passed (5 minutes, 40 seconds)
Details
buildkite/eosio/darwin-high-sierra-np-tests Passed (22 minutes, 43 seconds)
Details
buildkite/eosio/darwin-high-sierra-package-builder Passed (30 seconds)
Details
buildkite/eosio/darwin-high-sierra-tests Passed (2 minutes, 25 seconds)
Details
buildkite/eosio/darwin-mojave-build Passed (5 minutes, 46 seconds)
Details
buildkite/eosio/darwin-mojave-np-tests Passed (20 minutes, 28 seconds)
Details
buildkite/eosio/darwin-mojave-package-builder Passed (28 seconds)
Details
buildkite/eosio/darwin-mojave-tests Passed (2 minutes, 7 seconds)
Details
buildkite/eosio/fedora-27-build Passed (6 minutes, 55 seconds)
Details
buildkite/eosio/fedora-27-np-tests Passed (12 minutes, 55 seconds)
Details
buildkite/eosio/fedora-27-package-builder Passed (1 minute, 26 seconds)
Details
buildkite/eosio/fedora-27-tests Passed (2 minutes, 39 seconds)
Details
buildkite/eosio/pipeline Passed (4 seconds)
Details
buildkite/eosio/ubuntu-16-dot-04-build Passed (6 minutes, 9 seconds)
Details
buildkite/eosio/ubuntu-16-dot-04-np-tests Passed (13 minutes, 1 second)
Details
buildkite/eosio/ubuntu-16-dot-04-package-builder Passed (49 seconds)
Details
buildkite/eosio/ubuntu-16-dot-04-tests Passed (3 minutes, 29 seconds)
Details
buildkite/eosio/ubuntu-18-dot-04-build Passed (5 minutes, 47 seconds)
Details
buildkite/eosio/ubuntu-18-dot-04-np-tests Passed (11 minutes, 57 seconds)
Details
buildkite/eosio/ubuntu-18-dot-04-package-builder Passed (39 seconds)
Details
buildkite/eosio/ubuntu-18-dot-04-tests Passed (2 minutes, 38 seconds)
Details

@heifner heifner deleted the trx-id branch Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.