EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

Exception when updating permission in EOS 1.0.1 with eosjs 14.1 AND eosjs 14.1.1 #160

Closed theponpon closed 6 years ago

theponpon commented 6 years ago

The attached code will produce the following error message:

TypeError: Cannot read property 'threshold' of undefined authority.threshold updateauth.auth action.data transaction.actions index.js:121

test_permissions.txt

ycryptx commented 6 years ago

@theponpon getting the same error

jcalfee commented 6 years ago

These fields were removed:

recovery: 'eosio', deposit: '0 EOS'}

See newaccount in the README..

Look at the usage for updateauth:

> eos.updateauth()
CONTRACT
eosio

FUNCTION
updateauth

PARAMETERS
{
    "account": "account_name",
    "permission": "permission_name",
    "parent": "permission_name",
    "auth": "authority"
}

EXAMPLE
{
    "account": "",
    "permission": "",
    "parent": "",
    "auth": {
        "threshold": 0,
        "keys": [
            {
                "key": "EOS6MRy..",
                "weight": 0
            }
        ],
        "accounts": [
            {
                "permission": {
                    "actor": "",
                    "permission": ""
                },
                "weight": 0
            }
        ],
        "waits": [
            {
                "wait_sec": 0,
                "weight": 0
            }
        ]
    }
}
jcalfee commented 6 years ago

By the way, if any array is empty you can omit it ..

theponpon commented 6 years ago

"auth" instead of "data"! It works now! I feel stupid! Thanks a lot for helping me find my mistake!

Regards

Pierre