PatrickAlphaC / smartcontract-lottery

MIT License
79 stars 113 forks source link

TypeError: int() can't convert non-string with explicit base #86

Closed MrPotatoHead-Dev closed 1 year ago

MrPotatoHead-Dev commented 1 year ago

I ran into this same error with the FundMe tutorial when I was trying to test if only the owner could withdraw. I posted about it on stack exchange but no one helped. Ive looked everywhere and idk what this means. I uninstalled and deleted all the files of python, VS code and then re-installed all. with no luck. ` Lottery.enter confirmed (reverted) Block: 6 Gas used: 29333 (0.24%)

File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie_cli\run.py", line 51, in main return_value, frame = run( File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\project\scripts.py", line 110, in run return_value = f_locals[method_name](*args, **kwargs) File "C:\Users\xxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\transaction.py", line 705, in _get_trace step["pc"] = int(step["pc"], 16) TypeError: int() can't convert non-string with explicit base`

MrPotatoHead-Dev commented 1 year ago

ok, I didnt understand too much what was happening with the pytest exceptions however an easy fix was: with pytest.raises(TypeError): lottery.enterLottery({"from": account, "value": value}) Using TypeError instead