Skip to content

Commit

Permalink
Add parity check
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh authored and LefterisJP committed Jul 21, 2018
1 parent 1c8b853 commit 63f7276
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion raiden/network/rpc/smartcontract_proxy.py
Expand Up @@ -49,6 +49,8 @@ def inspect_client_error(val_err: ValueError, eth_node: str) -> ClientErrorInspe
elif eth_node == EthClient.PARITY:
if error['code'] == -32010 and 'insufficient funds' in error['message']:
return ClientErrorInspectResult.INSUFFICIENT_FUNDS
elif error['code'] == -32010 and 'another transaction with same nonce in the queue':
return ClientErrorInspectResult.TRANSACTION_UNDERPRICED

return ClientErrorInspectResult.PROPAGATE_ERROR

Expand Down Expand Up @@ -81,7 +83,12 @@ def transact(self, function_name: str, *args, **kargs):
if action == ClientErrorInspectResult.INSUFFICIENT_FUNDS:
raise InsufficientFunds('Insufficient ETH for transaction')
elif action == ClientErrorInspectResult.TRANSACTION_UNDERPRICED:
raise ReplacementTransactionUnderpriced()
raise ReplacementTransactionUnderpriced(
'Transaction was rejected. This is potentially '
'caused by the reuse of the previous transaction '
'nonce as well as paying an amount of gas less than or '
'equal to the previous transaction\'s gas amount',
)

raise e

Expand Down

0 comments on commit 63f7276

Please sign in to comment.