Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPCError: Bad Cast:Invalid cast from type 'array_type' to Object #407

Open
ptrio42 opened this issue Sep 26, 2018 · 2 comments
Open

RPCError: Bad Cast:Invalid cast from type 'array_type' to Object #407

ptrio42 opened this issue Sep 26, 2018 · 2 comments

Comments

@ptrio42
Copy link

ptrio42 commented Sep 26, 2018

Expected behavior

Once the account_create operation is called an appropriate STEEM amount should be burned and a corresponding account should be created.

Actual behavior

A Bad Cast:Invalid cast from type 'array_type' to Object error is raised.

How to reproduce

Sample code:

steem.api.setOptions({ url: 'https://api.steem.house' });

var newAccountName = 'blaney',
    newAccountWif = steem.formatter.createSuggestedPassword(),
    publicKeys = steem.auth.generateKeys(newAccountName, newAccountWif, ['owner', 'active', 'posting', 'memo']);

steem.broadcast.accountCreate(
    '...', // ownerWif
    '3.000 STEEM', // fee
    'piotr42', // creator
    newAccountName, // newAccountName
    { weight_threshold: 1, account_auths: [], key_auths: [[publicKeys.owner, 1]] }, // owner
    { weight_threshold: 1, account_auths: [], key_auths: [[publicKeys.active, 1]] }, // active
    { weight_threshold: 1, account_auths: [], key_auths: [[publicKeys.posting, 1]] }, // posting
    publicKeys.memo, // memo
    '', // jsonMetadata
    function(err, response) {
        console.log(err, response);
});

Response:

{…}​cause: RPCError​​code: -32000​​columnNumber: 24327​​data: Object { code: 7, name: "bad_cast_exception", message: "Bad Cast", … }​​fileName: "file:///Users/piotr.cz/Documents/steem-client/node_modules/steem/dist/steem.min.js"​​lineNumber: 4​​message: "Bad Cast:Invalid cast from type 'array_type' to Object"​​name: "RPCError"​​stack: "e@file:///Users/piotr.cz/Documents/steem-client/node_modules/steem/dist/steem.min.js:4:24327\na/<@file:///Users/piotr.cz/Documents/steem-client/node_modules/steem/dist/steem.min.js:4:23853\n"​​<prototype>: Object { … }​code: -32000​data: {…}​​code: 7​​message: "Bad Cast"​​name: "bad_cast_exception"​​stack: Array [ {…} ]​​<prototype>: Object { … }​isOperational: true​message: "Bad Cast:Invalid cast from type 'array_type' to Object"​name: "RPCError"​stack: "e@file:///Users/piotr.cz/Documents/steem-client/node_modules/steem/dist/steem.min.js:4:24327\na/<@file:///Users/piotr.cz/Documents/steem-client/node_modules/steem/dist/steem.min.js:4:23853\n"​<prototype>: Object { constructor: i(), "constructor$": Error(), stack: "" } undefined main.js:28:9

Environment information

OS: Mac OS High Sierra
Node: v8.11.4
Npm: 5.6.0

@syvb
Copy link
Contributor

syvb commented Sep 26, 2018

Does it work when you run JSON.stringify on the owner, active, and posting authorities?

@ptrio42
Copy link
Author

ptrio42 commented Sep 26, 2018

Thanks for the suggestion @Smittyvb. Unfortunately it does not work that way either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants