piston-lib
piston-lib copied to clipboard
Missing authority when trying to broadcast a vote on golos
I copied a script that works on steem and changed the node, but the transactions are refused by wss://ws.golos.io The Missing Posting Authority error contains a "sigs" param in the vote which is always different.
Relevant code:
node = 'wss://ws.golos.io'
rpc = SteemNodeRPC(node)
wif = '5..'
def castvote(op):
expiration = transactions.formatTimeFromNow(180)
ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc)
tx = transactions.Signed_Transaction(ref_block_num=ref_block_num,
ref_block_prefix=ref_block_prefix,
expiration=expiration,
operations=[op])
tx = tx.sign([wif])
rpc.broadcast_transaction(tx.json(), api="network_broadcast")
nop = transactions.Vote(
**{"voter": votewith,
"author": author,
"permlink": permlink,
"weight": int(weight*100)}
)
castvote(transactions.Operation(nop))
2 example replies:
{"ops":[["vote",{"voter":"pharesim","author":"romapush","permlink":"karl-v","weight":100}]],"sigs":["GLS6x2W3CcR4eeKwTg8a23XkdcfySivi4xVPk76FVpgbE3MzduV2z"]}
{"ops":[["vote",{"voter":"pharesim","author":"romapush","permlink":"karl-v","weight":100}]],"sigs":["GLS8by3pXWPTtdZdbu7pckbrhZaXVdxdXgkHtpxukKza2HEc6QDmT"]}
th_a transaction.cpp:164 verify_authority