Skip to content
New issue

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

KeyError: 'operation_results' #229

Closed
bitphage opened this issue Apr 4, 2019 · 1 comment
Closed

KeyError: 'operation_results' #229

bitphage opened this issue Apr 4, 2019 · 1 comment

Comments

@bitphage
Copy link
Contributor

bitphage commented Apr 4, 2019

When calling Market.buy() / sell() with returnOrderId, the following error could happen:

Traceback (most recent call last):
  File "/home/vvk/devel/DEXBot-prod/dexbot/worker.py", line 125, in on_block
    self.workers[worker_name].ontick(data)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.6/site-packages/Events-0.3-py3.6.egg/events/events.py", line 95, in __call__
    f(*a, **kw)
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/staggered_orders.py", line 1928, in tick
    self.maintain_strategy()
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/staggered_orders.py", line 206, in maintain_strategy
    self.replace_virtual_order_with_real(self.virtual_buy_orders[0])
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/staggered_orders.py", line 562, in replace_virtual_order_with_real
    new_order = self.place_market_buy_order(quote_amount, price, returnOrderId=True)
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/base.py", line 1119, in place_market_buy_order
    **kwargs
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/base.py", line 1202, in retry_action
    return action(*args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.6/site-packages/bitshares-0.2.1-py3.6.egg/bitshares/market.py", line 463, in buy
    tx["orderid"] = tx["operation_results"][0][1]
KeyError: 'operation_results'

Probably need to add some handling when tx does not contain operation_results.

@xeroc
Copy link
Member

xeroc commented Apr 8, 2019

I wonder why that would even happen ..

xeroc added a commit that referenced this issue Apr 8, 2019
@xeroc xeroc closed this as completed Apr 8, 2019
xeroc added a commit that referenced this issue Apr 12, 2019
Release 0.3.2

8a3b595 (HEAD -> master) Merge branch 'release/0.3.2'
73323fb (release/0.3.2) version bump
f7b18ac (origin/develop, develop) Implement getOperationName
56a3d17 Modify instances according to new pygraphene to allow setting config before instanciation (#188)
d2b9c42 Add the unknown chainid to the error message
cb4772a Introduce exception for unknown chainid (#221)
2595586 Make #229 not raise a KeyError exception
7a37be8 Merge pull request #224 from bitfag/tip-asset-fixes
d22cfc5 Merge pull request #228 from bitshares/pyup-scheduled-update-2019-04-01
ba6b0bb Updates to docs and Authors
3f34527 version bump
855fb83 (origin/pyup-scheduled-update-2019-04-01) Update pre-commit from 1.14.4 to 1.15.0
1e3bb92 Update pytest-mock from 1.10.2 to 1.10.3
192e409 Update pytest from 4.3.1 to 4.4.0
9bad2f9 Update graphenelib from 1.1.12 to 1.1.14
5ad6701 Pass blockchain_instance in Asset methods
081859f Fix typo in finalizeOp call
26719f7 Merge pull request #220 from bitfag/219-balance-claim-operation
54d712d Add balance_claim operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants