mahdiyari / hive-tx-js

Lightweight and complete JavaScript library for using Hive blockchain in Javascript environments such as Web or NodeJS.
MIT License
25 stars 12 forks source link

Serialisation fails on some operations. #7

Closed roelandp closed 3 years ago

roelandp commented 3 years ago

I'm seeing some Unable to serialize transaction errors on certain operations. In my case I tested this with 'custom_json' for 'follows' and 'update_proposals'

Here is a gist with some test operation which has a succesful result for a 'vote'-operation but fails for those other 2 operations: https://gist.github.com/roelandp/1a1982d813363832e9ae792a25245c37

I cannot pull my finger around as to why they are failing.

mahdiyari commented 3 years ago

It seems you are missing some operation parameters. required_auths in custom_json and extensions in update_proposal_votes.

const op2 = [
  'custom_json',
  {
    id: 'follow',
    required_auths: []
    required_posting_auths: [hiveuser],
    json:
      '["follow",{"follower":' +
      hiveuser +
      ',"following":"jasonliberty","what":["blog"]}]'
  }
]

const op3 = [
  [
    'update_proposal_votes',
    {
      voter: hiveuser,
      proposal_ids: ['42'],
      approve: 'true',
      extensions: []
    }
  ]
]
roelandp commented 3 years ago

you nailed it, again. Thx.

I was just fiddling with the serializer source to output the cause which indeed told me these missing keyvals.

thanks, closing!