EOSPortal / eosportal-front

🗳EOSPortal Community Voting
https://eosportal.io
28 stars 22 forks source link

Cannot vote with custom account permissions #63

Open LiorHalfon opened 6 years ago

LiorHalfon commented 6 years ago

Hi, I've created a voting authority by doing: cleos set account permission ACCOUNT_NAME voting '{"threshold":1,"keys":[{"key":"PUBLIC_KEY","weight":1}]}' "active" -p ACCOUNT_NAME@active And linked it to voteproducer action by doing: cleos set action permission ACCOUNT_NAME eosio.system voteproducer voting -p ACCOUNT_NAME@active

The reason I did this is to enable me to use the voting portal without sharing my private key with Scatter.

Now after I've set up Scatter identity ACCOUNT_NAME@voting, and paired with the voting portal, I'm getting this error:

Voting failed: Missing required accounts, repull the identity

When I change my voting identity to ACCOUNT_NAME@active in Scatter, The portal takes me to the Scatter confirmation page but then fails to authenticate the transaction. (As it should, because I don't have the ACCOUNT_NAME@active private key in Scatter) @nsjames

nsjames commented 6 years ago

Looks like this is an issue ( or rather a lack of functionality ) with eosjs.

This is the code that votes for producers, which just takes an account name and infers the permissions via eosjs. https://github.com/EOSPortal/eosportal-front/blob/master/src/utils/eos.util.ts#L112

That code could be extended to provide support for custom authorities by passing it along with the account to the method and building the authorization array manually.