Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Provide a better error message for receiver ETH balance below limit #453

Open
loredanacirstea opened this issue Mar 7, 2018 · 1 comment

Comments

@loredanacirstea
Copy link
Contributor

Channel manager ETH balance is below limit - is confusing to users
The problem is that the account used as a receiver does not have enough ETH. There is a 10**8 WEI threshold that should be mentioned in the error.

@boneyard93501
Copy link

will that work ?

iff --git a/microraiden/proxy/resources/paywall_decorator.py b/microraiden/proxy/resources/paywall_decorator.py
index 2cad739..2e28c55 100644
--- a/microraiden/proxy/resources/paywall_decorator.py
+++ b/microraiden/proxy/resources/paywall_decorator.py
@@ -38,7 +38,12 @@ class Paywall(object):
         if self.channel_manager.node_online() is False:
             return "Ethereum node is not responding", 502
         if self.channel_manager.get_eth_balance() < constants.PROXY_BALANCE_LIMIT:
-            return "Channel manager ETH balance is below limit", 502
+            msg_vals = (self.channel_manager.get_eth_balance(),
+                        self.receiver_address,
+                        constants.PROXY_BALANCE_LIMIT)
+            msg = "Your account balance {} for receiver account {} is below the"
+            msg += " minimum {} wei balance required to operate."
+            return msg.format(*msg_vals), 502
         try:
             data = RequestData(request.headers, request.cookies)
         except ValueError as e:
(END)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants