feat(mint): enforce NUT 11014/11015 max inputs and outputs#965
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #965 +/- ##
==========================================
+ Coverage 74.92% 74.98% +0.06%
==========================================
Files 111 111
Lines 12065 12078 +13
==========================================
+ Hits 9040 9057 +17
+ Misses 3025 3021 -4 ☔ View full report in Codecov by Sentry. |
f27814f to
e41618e
Compare
|
The PR implements NUT-14 and NUT-15 limits on the maximum number of inputs and outputs by checking lengths and raising newly defined |
e41618e to
c4ccb4f
Compare
made changes limits enforced in ledger, list max_length removed from models so clients get 11014/11015 instead of 422. |
This PR adds Cashu/NUT-aligned errors 11014 (Max inputs exceeded) and 11015 (Max outputs exceeded), configurable via
MINT_MAX_INPUTSandMINT_MAX_OUTPUTS(defaults: 1000).TransactionMaxInputsExceededErrorandTransactionMaxOutputsExceededErrorincashu/core/errors.py.verify_inputs_and_outputsand_verify_outputs, and onrestore().Tests cover both error paths in
tests/mint/test_mint_verification.py.