|
|
@ -12,7 +12,7 @@ class InMemoryPortfolio(Portfolio): |
|
|
|
"""return the content in each currency""" |
|
|
|
return self.currency |
|
|
|
|
|
|
|
def widraw(self, amount: int, currency: str) -> None: |
|
|
|
def withdraw(self, amount: int, currency: str) -> None: |
|
|
|
"""Withdraw money from the portfolio""" |
|
|
|
if self.currency[currency] < amount: |
|
|
|
raise ValueError("Not enough money") |
|
|
@ -24,5 +24,5 @@ class InMemoryPortfolio(Portfolio): |
|
|
|
|
|
|
|
def convert(self, amount: int, to_amount: int, currency: str, to_currency: str) -> None: |
|
|
|
"""Convert money from one currency to another""" |
|
|
|
self.widraw(amount, currency) |
|
|
|
self.withdraw(amount, currency) |
|
|
|
self.deposit(to_amount, to_currency) |
|
|
|