4

We're trying to use scatter + eosjs for voting. This works fine if you pick one or two producers but any more than that and you get the following 500 error - POST https://api.kylin.alohaeos.com/v1/chain/push_transaction 500

This happens on both kylin and the mainnet. Our call to eosJs is as follows -

async function submitVotes(producers, setMessage, setPreviousList) {
userAccountName = ScatterJS.scatter.identity.accounts.filter(account => account.blockchain === "eos")[0].name;
const eosOptions = { expireInSeconds:60 };
const eos = ScatterJS.scatter.eos(env.NETWORK, Eos, eosOptions);

try{
  console.log('account name' + userAccountName);
  console.log('producers' + typeof producers);
  const result = await eos.voteproducer(userAccountName, '', producers);

} catch (error){
  setMessage("Sorry, your vote has failed because : " + error.message);
}

}

We are receiving an undefined error in the catch...

The console.logs above give the following (which seems correct) - enter image description here

We have also tried changing the proxy argument to "proxy = ''", but that doesn't help.

Clicking on the 500 error gives -

{"code":500,"message":"Internal Service Error","error":{"code":3010010,"name":"packed_transaction_type_exception","what":"Invalid packed transaction","details":[{"message":"Missing signatures","file":"abi_serializer.hpp","line_number":578,"method":"extract"},{"message":"Failed to deserialize variant","file":"abi_serializer.hpp","line_number":679,"method":"from_variant"},{"message":"Invalid packed transaction","file":"chain_plugin.cpp","line_number":1503,"method":"push_transaction"}]}}

Any help would be appreciated.

2
  • Have you tried another API endpoint? What happens if you try and push the transaction in cleos?
    – Nat
    Nov 19, 2018 at 23:14
  • Hi, thanks for your response, yes it does work in cleos and we have various other endpoints working using the same version of eosjs.
    – cordial
    Nov 20, 2018 at 15:36

1 Answer 1

4

const sortedBPs = producers.sort();

await eos.voteproducer(userAccountName, proxy, sortedBPs );

...Adding a sort and moving it outside the await fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.