Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 49d2248

Browse files
committed
Fix issue #289
1 parent e8c614c commit 49d2248

2 files changed

Lines changed: 28 additions & 25 deletions

File tree

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Changelog
88
* Add Blocks class, which uses get_block_range
99
* PR #272: correct blockchain virtual op batch calls (thanks to @crokkon)
1010
* PR #276: blockchain: get_account_reputations fix for first (thanks to @crokkon)
11-
* PR #287: beempy witnessproperties: fix interest rate options
11+
* PR #287: beempy witnessproperties: fix interest rate options (thanks to @crokkon)
12+
* Fix #289: Unable to Claim Specific Reward Asset
1213

1314
0.24.20
1415
-------

beem/account.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3152,9 +3152,9 @@ def claim_reward_balance(self,
31523152
# if no values were set by user, claim all outstanding balances on
31533153
# account
31543154

3155-
reward_steem = self._check_amount(reward_steem + reward_hive, self.blockchain.token_symbol)
3156-
reward_sbd = self._check_amount(reward_sbd + reward_hbd, self.blockchain.backed_token_symbol)
3157-
reward_vests = self._check_amount(reward_vests, self.blockchain.vest_token_symbol)
3155+
reward_token_amount = self._check_amount(reward_steem + reward_hive, self.blockchain.token_symbol)
3156+
reward_backed_token_amount = self._check_amount(reward_sbd + reward_hbd, self.blockchain.backed_token_symbol)
3157+
reward_vests_amount = self._check_amount(reward_vests, self.blockchain.vest_token_symbol)
31583158

31593159
if self.blockchain.is_hive:
31603160
reward_token = "reward_hive"
@@ -3163,29 +3163,31 @@ def claim_reward_balance(self,
31633163
reward_token = "reward_steem"
31643164
reward_backed_token = "reward_sbd"
31653165

3166-
if reward_steem.amount == 0 and reward_sbd.amount == 0 and reward_vests.amount == 0:
3166+
if reward_token_amount.amount == 0 and reward_backed_token_amount.amount == 0 and reward_vests_amount.amount == 0:
31673167
if len(account.balances["rewards"]) == 3:
3168-
reward_steem = account.balances["rewards"][0]
3169-
reward_sbd = account.balances["rewards"][1]
3170-
reward_vests = account.balances["rewards"][2]
3171-
op = operations.Claim_reward_balance(
3172-
**{
3173-
"account": account["name"],
3174-
reward_token: reward_steem,
3175-
reward_backed_token: reward_sbd,
3176-
"reward_vests": reward_vests,
3177-
"prefix": self.blockchain.prefix,
3178-
})
3168+
reward_token_amount = account.balances["rewards"][0]
3169+
reward_backed_token_amount = account.balances["rewards"][1]
3170+
reward_vests_amount = account.balances["rewards"][2]
31793171
else:
3180-
reward_steem = account.balances["rewards"][0]
3181-
reward_vests = account.balances["rewards"][1]
3182-
op = operations.Claim_reward_balance(
3183-
**{
3184-
"account": account["name"],
3185-
reward_token: reward_steem,
3186-
"reward_vests": reward_vests,
3187-
"prefix": self.blockchain.prefix,
3188-
})
3172+
reward_token_amount = account.balances["rewards"][0]
3173+
reward_vests_amount = account.balances["rewards"][1]
3174+
if len(account.balances["rewards"]) == 3:
3175+
op = operations.Claim_reward_balance(
3176+
**{
3177+
"account": account["name"],
3178+
reward_token: reward_token_amount,
3179+
reward_backed_token: reward_backed_token_amount,
3180+
"reward_vests": reward_vests_amount,
3181+
"prefix": self.blockchain.prefix,
3182+
})
3183+
else:
3184+
op = operations.Claim_reward_balance(
3185+
**{
3186+
"account": account["name"],
3187+
reward_token: reward_token_amount,
3188+
"reward_vests": reward_vests_amount,
3189+
"prefix": self.blockchain.prefix,
3190+
})
31893191

31903192
return self.blockchain.finalizeOp(op, account, "posting", **kwargs)
31913193

0 commit comments

Comments
 (0)