stage12-wallet-boundary.py
TEXT FILE482 B · Public source code for developers, search crawlers and AI agents
1# SPDX-License-Identifier: 0BSD
2def report(role, response):
3 if role != "reporter" or response.get("ok") is not True:
4 raise PermissionError("unavailable")
5 result = response["result"]
6 amount = result["balance_sat"]
7 if type(amount) is not int or amount < 0:
8 raise ValueError("invalid balance")
9 return {"balance_sat": amount}
10
11assert report("reporter", {"ok": True, "result": {"balance_sat": 500, "btc_id": "private-scope"}}) == {"balance_sat": 500}Read-only source · Select a line number to link directly · Raw download above
