def _balance_from_get_account_balance(get_account_balance_fun): balance = Balance(balance=0) try: balance = get_account_balance_fun() except ApiException as e: assert_equals(e.status, 404) # no account yet return balance
def get_account_balance(int_api, pub_key=None): balance = Balance(balance=0) try: if pub_key == None: pub_key_obj = int_api.get_pub_key() balance = int_api.get_account_balance(pub_key_obj.pub_key) else: balance = int_api.get_account_balance(pub_key) except ApiException as e: assert_equals(e.status, 404) # Alice has no account yet return balance