eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

Signature format change requires a change in eosjs

Open BinaryFocus opened this issue 8 years ago • 3 comments

After upgrading the EOS server side I started getting this error

Error Code : 3120010 Message: Invalid packed transaction

After much debug it looks like this pull changed the signature format.

https://github.com/EOSIO/eos/pull/2441

The below screenshot show what cleos is now sending vs what the eosjs lib is sending.

20180504122951 001

The ticket was originally create here https://github.com/EOSIO/eos/issues/2698 but now moved to eosjs and I will close the other issue. The other issue has some detail also.

BinaryFocus avatar May 04 '18 16:05 BinaryFocus

Here's the full post and response.

POST /v1/chain/push_transaction HTTP/1.1
Host: test1.eosdocs.io
Connection: keep-alive
Content-Length: 702
Origin: http://localhost:1313
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Accept: */*
Referer: http://localhost:1313/dappdevelopment/playground/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

{
  "compression": "none",
  "transaction": {
    "expiration": "2018-05-04T16:06:13",
    "region": 0,
    "ref_block_num": 55420,
    "ref_block_prefix": 1569352370,
    "max_net_usage_words": 0,
    "max_kcpu_usage": 0,
    "delay_sec": 0,
    "context_free_actions": [],
    "actions": [
      {
        "account": "eosio",
        "name": "newaccount",
        "authorization": [
          {
            "actor": "eosio",
            "permission": "active"
          }
        ],
        "data": "0000000000ea305550842057619db1ca0100000001000360a8dba08d4c8e4674275ad8a5394ec0504fcbbbe6de364709e685e7e1e6b50b0100000100000001000219e335ed7677fdc8f3ba92189746ba298e2896b1c6f81ea534d791670d38e27b0100000100000000010000000000ea305500000000a8ed32320100"
      }
    ]
  },
  "signatures": [
    "EOSKYBPrKjGsRUXezRvqe7PkX4uiZg9J5NBWyX7R9ZRjQij2K4LBca4hJhKtYVHywbhxRaC6GzFjKCR2CW6NqgokuPmULqCC3"
  ]
}

====================================

{
  "code": 500,
  "message": "Internal Service Error",
  "error": {
    "code": 3120010,
    "name": "packed_transaction_type_exception",
    "what": "Invalid packed transaction",
    "details": [
      {
        "message": "Invalid packed transaction",
        "file": "chain_plugin.cpp",
        "line_number": 432,
        "method": "push_transaction"
      },
      {
        "message": "pivot != std::string::npos: No delimiter in string, cannot determine type: EOSKYBPrKjGsRUXezRvqe7PkX4uiZg9J5NBWyX7R9ZRjQij2K4LBca4hJhKtYVHywbhxRaC6GzFjKCR2CW6NqgokuPmULqCC3",
        "file": "signature.cpp",
        "line_number": 20,
        "method": "parse_base58"
      },
      {
        "message": "Failed to deserialize variant",
        "file": "abi_serializer.hpp",
        "line_number": 444,
        "method": "from_variant"
      }
    ]
  }
}

BinaryFocus avatar May 04 '18 16:05 BinaryFocus

thanks .. have a ticket here already, please follow this: https://github.com/EOSIO/eosjs-ecc/issues/11

I'm working on it now..

jcalfee avatar May 04 '18 16:05 jcalfee

Excellent, thanks.

BinaryFocus avatar May 04 '18 16:05 BinaryFocus