cashubtc / nuts

Cashu protocol specifications https://cashubtc.github.io/nuts/
MIT License
143 stars 49 forks source link

Add test vectors #27

Closed thunderbiscuit closed 1 year ago

thunderbiscuit commented 1 year ago

Just slowly making my way through.

Feel free to comment or request additional tests.

AngusP commented 1 year ago

@thunderbiscuit thanks for taking the time to add tests 🎉 -- for NUT-3, this issue might be useful for some vectors: https://github.com/cashubtc/cashu/issues/228

Effectively implementations should support any amount (including over 21,000,000 * 100,000,000 sats, which is impossible), and let their upstream (lightning or whatever) fail rather than the mint request itself breaking, but it's probably Ok for impls ("must") to be able to support up to 51 bit uints (ceil log2 of 2.1 quadrillion sats), so probably 8-byte integers (uint64)

Also notable here the issue was with the backing database, rather than the mint itself because Python handles very large integers pretty well

thunderbiscuit commented 1 year ago

@AngusP thanks for the idea for the extra tests! Related to this is #28.

This PR is getting a bit old and I don't want people to wait for me to finish it all before merging, just because I'm not sure how much time I'm going to have to dedicate to this over the fall. I rebased it on main, it's ready for review.

@callebtc if you like the tests here, feel free to comment/request changes/merge and not wait for me to add tests for all the NUTs.