Welcome to the payments team. The bank in bank/ handles accounts, payments and the top spenders ranking (levels 1 and 2), and its tests pass. Customers now want to send money that the receiver has to accept first. The th…
Welcome to the payments team. The bank in bank/ handles accounts, payments and the top spenders ranking (levels 1 and 2), and its tests pass. Customers now want to send money that the receiver has to accept first. The three new methods are stubbed in bank/bank_system.py, and the rules for level 3 are in README.md.
Build level 3 in 40 minutes. The checks are graded one by one, so each part you get working counts even if the rest is not done.
request_transfer holds the amount in the source account at once and returns "transfer1", "transfer2" and so on, numbered across the bank. A request that cannot be made returns None and uses no number.accept_transfer works only for the target account and only while the transfer is pending. The money reaches the target and counts as paid out by the source in top_spenders.cancel_transfer works only for the source account while the transfer is pending, and gives the money back.t expires at t + 3_600_000 (one hour): from then on accept and cancel return False, and the held money is back in the source account.get_balance, pay and top_spenders.pytest tests/visible. tests/visible/test_level3.py fails until level 3 works.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
bank-system-transfers-that-expire
Changes under src/ are evaluated.