tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Unset config options fail silently #71

Closed vt102 closed 5 years ago

vt102 commented 5 years ago

As a new user, not having certain configuration settings caused cryptic failures. In particular, not having EOSIO_S2WASM and EOSIO_WAST2WASM gives an error expect bytes or str, not NoneType.

ubuntu@ip-10-0-2-230:~/src/eosfactory$ python3 utils/config.py  | egrep nul
    "EOSIO_S2WASM": null,
    "EOSIO_WAST2WASM": null,
:
ABI file writen to file: /home/eos-v1.0/eos/build/contracts/_wslqwjvacdyugodewiyd/build
ELocal node is stopped [10924].

======================================================================
ERROR: test_01 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/src/eosfactory/pyteos/core/teos.py", line 227, in WAST
    process(command_line)
  File "/home/ubuntu/src/eosfactory/pyteos/core/teos.py", line 405, in process
    stderr=subprocess.PIPE)
  File "/usr/lib/python3.5/subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1474, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python3.5/os.py", line 862, in fsencode
    raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
TypeError: expect bytes or str, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tests/01_hello_world.py", line 42, in test_01
    contract.build()
  File "/home/ubuntu/src/eosfactory/pyteos/shell/contract.py", line 68, in build
    self.build_wast()
  File "/home/ubuntu/src/eosfactory/pyteos/shell/contract.py", line 60, in build_wast
    teos.WAST(self.contract_dir)
  File "/home/ubuntu/src/eosfactory/pyteos/core/teos.py", line 234, in WAST
    raise errors.Error(str(e))
core.errors.Error: ERROR:
expect bytes or str, not NoneType

----------------------------------------------------------------------
Ran 1 test in 9.342s

FAILED (errors=1)
stefanzarembinski commented 5 years ago

Thank you for your note. We take the learning.

SZ