Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Add gate balance to the GNT balance (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krigpl authored and mfranciszkiewicz committed Apr 6, 2018
1 parent 0487a48 commit 1e860da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion golem/ethereum/paymentprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 2 additions & 0 deletions tests/golem/transactions/ethereum/test_paymentprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1e860da

Please sign in to comment.