Add expected total tokens to the voucher model
This makes the database responsible for remembering how many tokens we expect to get for a voucher, rather than the in-memory Python state or the code. As a result, we can resume redemption knowing the correct number of tokens after a process restart and without relying on the PaymentController's default token count to have remained unchanged.
Showing
- src/_zkapauthorizer/controller.py 30 additions, 8 deletionssrc/_zkapauthorizer/controller.py
- src/_zkapauthorizer/model.py 42 additions, 9 deletionssrc/_zkapauthorizer/model.py
- src/_zkapauthorizer/schema.py 7 additions, 1 deletionsrc/_zkapauthorizer/schema.py
- src/_zkapauthorizer/tests/strategies.py 1 addition, 0 deletionssrc/_zkapauthorizer/tests/strategies.py
- src/_zkapauthorizer/tests/test_client_resource.py 4 additions, 2 deletionssrc/_zkapauthorizer/tests/test_client_resource.py
- src/_zkapauthorizer/tests/test_controller.py 5 additions, 5 deletionssrc/_zkapauthorizer/tests/test_controller.py
- src/_zkapauthorizer/tests/test_model.py 37 additions, 18 deletionssrc/_zkapauthorizer/tests/test_model.py
Loading
Please register or sign in to comment