Exemplo n.º 1
0
def get_money_supply(author: Union[AccountId, str],
                     server: Server) -> Fraction:
    """Return sum of all account balances"""
    return sum(acc.get_balance() for acc in server.get_accounts())
Exemplo n.º 2
0
def process_money_supply(author: AccountId, message: str, server: Server,
                         **kwargs):
    """Processes a message requesting the total money supply."""
    main_response = 'The total money supply is %s.' % fraction_to_str(
        sum(account.get_balance() for account in server.get_accounts()))
    return 'Hi there. %s Have a great day.' % main_response