예제 #1
0
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
예제 #2
0
파일: common.py 프로젝트: jinxinslim/epoch
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