pegnet / pegnetd

The pegnet daemon to track txs, conversions, etc
Other
13 stars 14 forks source link

API method "get-transaction-status" returns an error for failed transactions #132

Closed OrmEmbaar closed 4 years ago

OrmEmbaar commented 4 years ago

The API method get-transaction-status will return an error for any transaction where executed <0. It appears that an unsigned integer is used for the execution response where a signed integer should be used.

  error: {
    code: -32602,
    message: 'Invalid params',
    data: 'sql: Scan error on column index 1, name "executed": converting driver.Value type int64 ("-1") to a uint32: invalid syntax'
  },

https://github.com/pegnet/pegnetd/blob/6662203ff59aa31c43bb61f4fb1211e96b9a412c/node/pegnet/txhistory.go#L177-L185

Can be reproduced with the following transaction hash: 5145f90dabce81bd963758f2bf2d836f663add6fa154121206d5d18014fdd13a

I will submit a PR shortly to fix the issue.

sigrlami commented 4 years ago

fixed in https://github.com/pegnet/pegnetd/pull/133