Skip to content

Commit

Permalink
Rebase and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh authored and LefterisJP committed Jul 21, 2018
1 parent 7a7ccc8 commit 1c8b853
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion raiden/network/rpc/smartcontract_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def inspect_client_error(val_err: ValueError, eth_node: str) -> ClientErrorInspe
return ClientErrorInspectResult.INSUFFICIENT_FUNDS
elif 'always failing transaction' in error['message']:
return ClientErrorInspectResult.ALWAYS_FAIL
elif error['message'] == 'replacement transaction underpriced':
return ClientErrorInspectResult.TRANSACTION_UNDERPRICED

elif eth_node == EthClient.PARITY:
if error['code'] == -32010 and 'insufficient funds' in error['message']:
Expand Down Expand Up @@ -78,7 +80,7 @@ def transact(self, function_name: str, *args, **kargs):
action = inspect_client_error(e, self.jsonrpc_client.eth_node)
if action == ClientErrorInspectResult.INSUFFICIENT_FUNDS:
raise InsufficientFunds('Insufficient ETH for transaction')
elif action == ClienErrorInspectResult.TRANSACTION_UNDERPRICED:
elif action == ClientErrorInspectResult.TRANSACTION_UNDERPRICED:
raise ReplacementTransactionUnderpriced()

raise e
Expand Down
3 changes: 2 additions & 1 deletion raiden/tests/integration/rpc/test_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from eth_utils import decode_hex, to_checksum_address
from pkg_resources import DistributionNotFound

from raiden.exceptions import ReplacementTransactionUnderpriced
from raiden.network.rpc.transactions import check_transaction_threw
from raiden.network.rpc.client import JSONRPCClient
from raiden.utils.solc import compile_files_cwd
Expand Down Expand Up @@ -136,7 +137,7 @@ def test_duplicated_transaction_raises(deploy_client):

gas = contract_proxy.estimate_gas('ret') * 2

with pytest.raises((ValueError, ValidationError)):
with pytest.raises((ReplacementTransactionUnderpriced, ValidationError)):
second_proxy.transact('ret', startgas=gas)
contract_proxy.transact('ret', startgas=gas)

Expand Down

0 comments on commit 1c8b853

Please sign in to comment.