We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
steem.post() brings two options to set beneficiaries:
steem.post()
comment_options
comment_options = { 'max_accepted_payout': '1000000.000 SBD', 'percent_steem_dollars': 10000, 'allow_votes': True, 'allow_curation_rewards': True, 'extensions': [[0, { 'beneficiaries': [ {'account': 'account1', 'weight': 5000}, {'account': 'account2', 'weight': 5000}, ]} ]] }
beneficiaries
beneficiaries = [ {'account': 'account1', 'weight': 5000}, {'account': 'account2', 'weight': 5000} ]
The list in beneficiaries is supposed to override the settings in the comment_options if both parameters are present.
It is not possible to set beneficiaries using either method.
from beem import Steem import json s = Steem(nobroadcast=True, unsigned=True) comment_options = { 'max_accepted_payout': '1000000.000 SBD', 'percent_steem_dollars': 10000, 'allow_votes': True, 'allow_curation_rewards': True, 'extensions': [[0, { 'beneficiaries': [ {'account': 'account1', 'weight': 5000}, {'account': 'account2', 'weight': 5000}, ]} ]] } tx = s.post(title="title", body="body", permlink="permlink", author="author", comment_options=comment_options, beneficiaries=None) print(json.dumps(tx, indent=2))
Result:
[...] [ "comment_options", { "author": "author", "permlink": "permlink", "max_accepted_payout": "1000000.000 SBD", "percent_steem_dollars": 10000, "allow_votes": true, "allow_curation_rewards": true, "extensions": [] } ]
The resulting extensions field is empty, the post will be created but without beneficiaries.
extensions
beneficiary
from beem import Steem import cfg_stmdev as cfg import time import json s = Steem(keys=[cfg.POSTING_WIF], nobroadcast=False) comment_options = { 'max_accepted_payout': '1000000.000 SBD', 'percent_steem_dollars': 10000, 'allow_votes': True, 'allow_curation_rewards': True, } beneficiaries = [{'account': 'stmdev', 'weight': 1000}] reply_identifier = '@stmdev/pwdtest' timestamp = int(time.time()) permlink = 'reply-case-1-%s' % timestamp body = "%s %s" % (comment_options, beneficiaries) tx = s.post(title=permlink, body=body, permlink=permlink, author=cfg.ACCOUNT, reply_identifier=reply_identifier, comment_options=comment_options, beneficiaries=beneficiaries) print(json.dumps(tx, indent=2))
The list of beneficiaries is now part of the transaction, but the operation fails with a missing required posting authority exception:
missing required posting authority
[...] {"ops":[["comment",{"parent_author":"stmdev","parent_permlink":"pwdtest","author":"stmdev","permlink":"reply-case-1-1528013878","title":"reply-case-1-1528013878","body":"{'max_accepted_payout': '1000000.000 SBD', 'percent_steem_dollars': 10000, 'allow_votes': True, 'allow_curation_rewards': True} [{'account': 'stmdev', 'weight': 1000}]","json_metadata":"{\"app\": \"beem/0.19.35\"}"}],["comment_options",{"author":"stmdev","permlink":"reply-case-1-1528013878","max_accepted_payout":"1000000.000 SBD","percent_steem_dollars":10000,"allow_votes":true,"allow_curation_rewards":true,"extensions":[[0,{"beneficiaries":[{"account":"stmdev","weight":1000}]}]]}]],"sigs":["STM6x286end3rLZj9ornAaxBaVzovxjHtXzBQppSFXCe67gCMu3xq"]} [...] beemapi.exceptions.UnhandledRPCError: missing required posting authority
The used posting key is correct, the same script creates a post with beneficiaries=None.
beneficiaries=None
Possibly related: steemit/steem-python#9
# beempy --version beempy, version 0.19.35 # python --version Python 3.6.5
The text was updated successfully, but these errors were encountered:
Fix beneficiaries handling in Comment_options
3dfae56
Fixes holgern#20
eb3bd2d
No branches or pull requests
Expected behavior
steem.post()
brings two options to set beneficiaries:comment_options
in the form of:beneficiaries
in the form of:The list in
beneficiaries
is supposed to override the settings in thecomment_options
if both parameters are present.Actual behavior
It is not possible to set beneficiaries using either method.
comment_options
, dry run, creating an unsigned transaction that is not broadcasted:Result:
The resulting
extensions
field is empty, the post will be created but without beneficiaries.beneficiary
parameter:The list of beneficiaries is now part of the transaction, but the operation fails with a
missing required posting authority
exception:The used posting key is correct, the same script creates a post with
beneficiaries=None
.Possibly related: steemit/steem-python#9
Environment
The text was updated successfully, but these errors were encountered: