smk762 / pytomicDEX_makerbot

Other
8 stars 3 forks source link

Do not convert dictionary to json #10

Open damascene opened 5 months ago

damascene commented 5 months ago

The application is trying to covert a dictionary to json showing the following error: AttributeError: 'dict' object has no attribute 'json'

Traceback:

string indices must be integers, not 'str'
Traceback (most recent call last):
  File "/home/user/pytomicDEX_makerbot/makerbot.py", line 90, in <module>
    main()
  File "/home/user/pytomicDEX_makerbot/makerbot.py", line 49, in main
    status_print(tui.dex.status)
                 ^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 163, in status
    successful_swaps_count, failed_swaps_count, delta = self.get_recent_swaps_info(
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 200, in get_recent_swaps_info
    recent_swaps = self.get_recent_swaps()
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 241, in get_recent_swaps
    return self.mm2_proxy({"method": "my_recent_swaps", "limit": limit})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 80, in mm2_proxy
    resp = r.json()
           ^^^^^^
AttributeError: 'dict' object has no attribute 'json'