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

Providing a wrong contract via the cli leads to crash with exception #1996

2 tasks
LefterisJP opened this issue Jul 29, 2018 · 0 comments
2 tasks


Copy link

LefterisJP commented Jul 29, 2018

Problem Definition

Providing a wrong contract via the CLI leads to a crash with exception.

Example trace:

You are connected to the 'smoketest' network and the DB path is: /tmp/lefteris/tmp_ak84ss2/keystore/netid_627/0x67a5e2/log.db
Traceback (most recent call last):
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/web3/", line 1363, in call_contract_function
    output_data = decode_abi(output_types, return_data)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 96, in decode_abi  
    return decoder(stream)                       
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 118, in __call__             
    return self.decode(stream)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_utils/", line 22, in inner
    return callback(fn(*args, **kwargs))
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 164, in decode
    yield decoder(stream)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 118, in __call__
    return self.decode(stream)                                          
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 186, in decode
    raw_data = self.read_data_from_stream(stream)            
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/eth_abi/", line 279, in read_data_from_stream
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):   
  File "/usr/lib64/python3.6/", line 193, in _run_module_as_main                                
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/", line 85, in _run_code                                              
    exec(code, run_globals)                                
  File "/home/lefteris/ew/raiden/raiden/", line 15, in <module>                                
  File "/home/lefteris/ew/raiden/raiden/", line 11, in main                                    
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 722, in __call__     
    return self.main(*args, **kwargs)               
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 697, in main
    rv = self.invoke(ctx)     
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 535, in invoke
    return callback(*args, **kwargs)                                       
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/", line 17, in new_func      
    return f(get_current_context(), *args, **kwargs)                    
  File "/home/lefteris/ew/raiden/raiden/ui/", line 1138, in smoketest                                 
    success = _run_smoketest()
  File "/home/lefteris/ew/raiden/raiden/ui/", line 1076, in _run_smoketest                                              
    app = run_app(**args)                  
  File "/home/lefteris/ew/raiden/raiden/ui/", line 670, in run_app                                                                                                                                                                                                        
  File "/home/lefteris/ew/raiden/raiden/", line 94, in __init__
    config['settle_timeout'] < default_registry.settlement_timeout_min() or
  File "/home/lefteris/ew/raiden/raiden/network/proxies/", line 164, in settlement_timeout_min
    return self.proxy.contract.functions.settlement_timeout_min().call()
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/web3/", line 1106, in call
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/web3/", line 1385, in call_contract_function
    raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not decode contract function call settlement_timeout_min return data b'' for output_types ['uint256']


  • Catch these exceptions in the beginning and make sure that the contract addresses provided by the user correspond to properly deployed raiden contracts or else quit with an appropriate error.
  • Add a CLI test for it. Depends on Implement raiden cli tests #1711 having been merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant