ledgerconnect / hivesigner

Signer app for Hive
MIT License
17 stars 5 forks source link

Broadcasting a custom_json transaction with active authority fails #10

Closed christianfuerst closed 4 years ago

christianfuerst commented 4 years ago

Expected behavior

Broadcasting a custom_json transaction with active authority works without errors. Transfering HIVE-ENGINE tokens require active authority in a custom_json transaction.

Reference Transaction made with HIVE-ENGINE: https://hiveblocks.com/tx/1f2c80bbbd199c2ed639b31d954d9251f4b2158a

Actual behavior

Broadcasting the transaction results in an error: "Invalid cast from string_type to Array"

Steps to reproduce the behavior

Try with this signing url:

https://hivesigner.com/sign/custom-json?required_posting_auths=%5B%5D&required_auths=__signer&authority=active&id=ssc-mainnet-hive&json=%7B%22contractName%22%3A%22tokens%22,%22contractAction%22%3A%22transfer%22,%22contractPayload%22%3A%7B%22symbol%22%3A%22DEC%22,%22to%22%3A%22splinterdeals%22,%22quantity%22%3A%221.00%22,%22memo%22%3A%22EB1VEkkWUd%22%7D%7D
feruzm commented 4 years ago

Thank you @christianfuerst, yes right now, each sign operation has 1 authority enabler, custom_json requires posting usually, so it is set as authority: posting, but I think best way to solve it to improve authority check with minimal required key, if authority is posting then any key above posting (active, owner, master) should be able to sign operation. Adding this to list of improvements!

christianfuerst commented 4 years ago

@feruzm Just found out that the issue was on my side: Forgot to use the square brackets for putting the signer variable into an array. Wrong: required_auths=__signer Correct: `required_auths=["signer"]orrequired_auths=%5B%22__signer%22%5D` URI encoded

It's working like a charm now. From my side we can close this issue. Thank you!