Skip to content

Commit

Permalink
[FIX] lcc_comchain/cyclos_base: add type check in get_wallet_balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Sainléger committed Oct 28, 2024
1 parent 3569c6f commit 79ec47a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lcc_comchain_base/models/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def get_wallet_data(self):

def get_wallet_balance(self):
self.ensure_one()
res = super(ResPartnerBackend, self).get_wallet_balance()
if self.type != "comchain":
return res

wallet = pyc3l.Wallet.from_json(self.comchain_wallet)
try:
balance = wallet.nantBalance
Expand Down
4 changes: 3 additions & 1 deletion lcc_cyclos_base/models/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def get_wallet_data(self):

def get_wallet_balance(self):
self.ensure_one()
res = ""
res = super(ResPartnerBackend, self).get_wallet_balance()
if self.type != "cyclos":
return res
try:
res = self._cyclos_rest_call("GET", "/%s/accounts" % self.cyclos_id)
_logger.debug("res: %s" % res)
Expand Down

0 comments on commit 79ec47a

Please sign in to comment.