SteemConnect: Unable to sign a custom_json operation with an active key

in #utopian-io6 years ago (edited)

Project Information

Expected behavior

I was expecting to be able to sign a custom_json operation with an active key the same way I sign a custom_json with a posting key via the tool https://steemconnect.com/sign/

Actual behavior

When we fill out the field "Required Auths" with the account name and sign the transaction with an active key we should be able to broadcast the custom_json operation without having to enter any data in the Required Posting Auths field.

How to reproduce

- go to https://steemconnect.com/sign/
- select Custom Json
- fill in the Required Auths field with your account name this way: ["accountName"]
- leave the field Required Posting Auths empty (as it is only required when using a posting key not an active key)
- fill in the Id field with "test"
- fill in the json fiels with { "test": "test" }
- click Generate Link
- click Try Link
- click Continue
- enter the account name in the Username field
- enter the active key of the account in the Password or key field
- finally click Sign in

The following error appears:

Screen Shot 2018-09-01 at 8.42.41 PM.png

Call stack:

"RPCError: Assert Exception:required_active.size() == 0: 
    at new t (https://steemconnect.com/js/app.min.js:67:208461)
    at https://steemconnect.com/js/app.min.js:67:207945
From previous event:
    at o.h [as _captureStackTrace] (https://steemconnect.com/js/app.min.js:53:10223)
    at o._then (https://steemconnect.com/js/app.min.js:53:41599)
    at o.spread (https://steemconnect.com/js/app.min.js:53:40192)
    at Object.S.send (https://steemconnect.com/js/app.min.js:81:208111)
    at Object.S.(anonymous function) [as customJsonWith] (https://steemconnect.com/js/app.min.js:81:209033)
    at t.<anonymous> (https://steemconnect.com/js/app.min.js:81:320698)
    at n (https://steemconnect.com/js/app.min.js:76:421806)
    at Generator._invoke (https://steemconnect.com/js/app.min.js:76:422851)
    at Generator.e.(anonymous function) [as next] (https://steemconnect.com/js/app.min.js:76:421985)
    at n (https://steemconnect.com/js/app.min.js:12:705)
    at https://steemconnect.com/js/app.min.js:12:801"

By checking the developer console I can see that the wrong operation is trying to be broadcasted:

Current operation brodcasted:

[
    "custom_json",
    {
        "required_auths": [
            "accountName"
        ],
        "required_posting_auths": [
            "accountName"
        ],
        "id": "test",
        "json": "{ \"test\": \"test\"}"
    }
]

Operation that should be broadcasted (empty array in required_posting_auths item):

[
    "custom_json",
    {
        "required_auths": [
            "accountName"
        ],
        "required_posting_auths": [],
        "id": "test",
        "json": "{ \"test\": \"test\"}"
    }
]

So, if nothing is entered in the Required Posting Auths field, an empty array should be sent not a copy of the Required Auths field value.

A workaround works though, fill out the field Required Posting Auths with an empty array [] will send an empty array when the transaction is broadcasted and you won't get any error.

  • Browser/App version: Google Chrome Version 68.0.3440.106 (Official Build) (64-bit)
  • Operating system: macOs High Sierra 10;13.1

GitHub Account

https://github.com/harpagon210

Sort:  
Loading...

Congratulations @harpagon! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of posts published

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!