Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

"cleos sign transaction" broken in develop. #8911

Closed
taokayan opened this issue Apr 6, 2020 · 1 comment
Closed

"cleos sign transaction" broken in develop. #8911

taokayan opened this issue Apr 6, 2020 · 1 comment
Assignees
Labels

Comments

@taokayan
Copy link
Contributor

taokayan commented Apr 6, 2020

due the returned transaction JSON string was changed in develop as compared to v2.0.4, "cleos sign" no longer work with the new transation JSON in which the action data is also jsonified:

for example: use ./cleos transfer eosio inita "0.0001 SYS" -s -d -j > trx1 to generate a unsigned transaction in JSON format.

in v2.0.4:

  "expiration": "2020-04-06T06:57:09",
  "ref_block_num": 1660,
  "ref_block_prefix": 1646371250,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio.token",
      "name": "transfer",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": "0000000000ea3055000000000093dd740100000000000000045359530000000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [],
  "context_free_data": []
}

in develop:

  "expiration": "2020-04-06T07:02:47",
  "ref_block_num": 2335,
  "ref_block_prefix": 232832416,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio.token",
      "name": "transfer",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": {
        "from": "eosio",
        "to": "inita",
        "quantity": "0.0001 SYS",
        "memo": ""
      },
      "hex_data": "0000000000ea3055000000000093dd740100000000000000045359530000000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [],
  "context_free_data": []
}

Trying to sign the transaction in cleos (./cleos sign -k PRIVATE_KEY trx1 -p) will result in error:

Error 3010006: Invalid transaction
Ensure that your transaction JSON follows the right transaction format!
Error Details:
Invalid transaction format: '{"expiration":"2020-04-06T06:56:58","ref_block_num":1638,"ref_block_prefix":2096313275,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio.token","name":"transfer","authorization":[{"actor":"eosio","permission":"active"}],"data":{"from":"eosio","to":"inita","quantity":"0.0001 SYS","memo":""},"hex_data":"0000000000ea3055000000000093dd740100000000000000045359530000000000"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]}'
Invalid cast from type 'object_type' to string
@heifner
Copy link
Contributor

heifner commented Apr 14, 2020

Resolved by #8931

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

No branches or pull requests

4 participants