diff --git a/golem/ethereum/paymentprocessor.py b/golem/ethereum/paymentprocessor.py index 335a0fc96c..567241d25c 100644 --- a/golem/ethereum/paymentprocessor.py +++ b/golem/ethereum/paymentprocessor.py @@ -97,7 +97,8 @@ def gnt_balance(self, refresh=False): gnt_balance = self._sci.get_gnt_balance( self._sci.get_eth_address()) if gnt_balance is not None: - self.__gnt_balance = gnt_balance + self.__gnt_balance = \ + gnt_balance + self._gnt_converter.get_gate_balance() else: log.warning("Failed to retrieve GNT balance") diff --git a/tests/golem/transactions/ethereum/test_paymentprocessor.py b/tests/golem/transactions/ethereum/test_paymentprocessor.py index 96d78f7862..5b51c7a96a 100644 --- a/tests/golem/transactions/ethereum/test_paymentprocessor.py +++ b/tests/golem/transactions/ethereum/test_paymentprocessor.py @@ -67,6 +67,7 @@ def setUp(self): self.pp._loopingCall.clock = Clock() # Disable looping call. self.pp._gnt_converter = mock.Mock() self.pp._gnt_converter.is_converting.return_value = False + self.pp._gnt_converter.get_gate_balance.return_value = 0 def test_eth_balance(self): expected_balance = random.randint(0, 2**128 - 1) @@ -362,6 +363,7 @@ def setUp(self): self.pp = PaymentProcessor(self.sci) self.pp._gnt_converter = mock.Mock() self.pp._gnt_converter.is_converting.return_value = False + self.pp._gnt_converter.get_gate_balance.return_value = 0 def test_faucet(self): self.pp._PaymentProcessor__faucet = True