Commit Graph

143 Commits

Author SHA1 Message Date
thesimplekid
be93ff2384 Clear and Blind Auth (#510)
* feat: auth

* chore: corret error codes

* chore: corret error codes

* fix: feature auth in cdk-axum

* refactor: auth logging

* feat: include dleq in auth proof

* feat: mint max auth proofs

* chore: clippy
2025-03-24 11:13:22 +00:00
David Caseria
db1db86509 Prepared Send (#596)
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2025-03-20 11:44:44 +00:00
thesimplekid
cf9cacaff4 fix: verification of melt quote with empty outputs 2025-03-13 09:55:17 +00:00
ok300
72dff95322 Merge pull request #653 from ok300/ok300-fix-update-mint-url
Wallet: fix `update_mint_url`
2025-03-11 18:41:52 +00:00
ok300
3ba3449c81 Integration tests: fix wait_for_mint_to_be_paid loop 2025-03-11 12:18:24 +01:00
thesimplekid
162507c492 feat: payment processor 2025-03-10 14:44:57 +00:00
ok300
5a7362c09f Simplify process_swap_request (#631)
* Simplify process_swap_request

* Fix occasional test_swap_to_send wallet errors
2025-03-06 15:08:59 +00:00
thesimplekid
e84d6ea7ab chore: Update rust-version (MSRV) to 1.75.0 (#623) 2025-03-05 10:32:41 +00:00
C
f7d9a1b5db Drop the in-memory database (#613)
* Drop the in-memory database

Fixes #607

This PR drops the implementation of in-memory database traits.

They are useful for testing purposes since the tests should test our codebase
and assume the database works as expected (although a follow-up PR should write
a sanity test suite for all database trait implementors).

As complexity is worth with database requirements to simplify complexity and
add more robustness, for instance, with the following plans to add support for
transactions or buffered writes, it would become more complex and
time-consuming to support a correct database trait. This PR drops the
implementation and replaces it with a SQLite memory instance

* Remove OnceCell<Mint>

Without this change, a single Mint is shared for all tests, and the first tests
to run and shutdown makes the other databases (not-reachable, as dropping the
tokio engine would also drop the database instance).

There is no real reason, other than perhaps performance. The mint should
perhaps run in their own tokio engine and share channels as API interfaces, or
a new instance should be created in each tests

* Fixed bug with foreign keys

[1] https://gist.github.com/crodas/bad00997c63bd5ac58db3c5bd90747ed

* Show more debug on failure

* Remove old code

* Remove old references to WalletMemoryDatabase
2025-03-04 19:44:34 +00:00
thesimplekid
a82e3eb314 fix: attempt to swap after a failed transaction (#622)
* fix: attempt to swap after a failed transaction

* fix: revert test change in https://github.com/cashubtc/cdk/pull/585
2025-03-03 14:10:47 +00:00
thesimplekid
827e4aebde Refactor mintd used in itest (#616) 2025-02-25 11:47:17 +00:00
thesimplekid
3a4c363309 feat: debug print to hide seed and print version 2025-02-09 11:16:33 +00:00
thesimplekid
0efa50ffad fix: use correct error 2025-02-09 10:49:44 +00:00
thesimplekid
9697e602df refactor: use Mint check payment status 2025-02-09 10:06:01 +00:00
thesimplekid
98d77ce2c8 feat: check mint ln payment status 2025-02-08 12:57:57 +00:00
thesimplekid
a8ec52612b Refactor mint tranactions checks (#585)
* refactor: consolidate validation checks

* refactor: melt verification checks

* refactor: mint verification

* chore: clippy

* chore: use error codes

* fix: order of verifications

* fix: p2pk test ws updates

We only expect the proof to be set to pending once. As a proof without
a signature failes before the spent check where the state is chaged.

* fix: mint_melt regtest frome wait
2025-02-08 11:17:44 +00:00
thesimplekid
be5e5d2371 chore: prepare v0.7.0 2025-02-06 13:12:16 +00:00
thesimplekid
47ee54d7f5 feat: mint management rpc server and client cli 2025-02-06 12:05:13 +00:00
lollerfirst
f2e1940cc7 [NUT-15] LND Support for MPP Payments (#536)
---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-02-06 09:30:48 +00:00
thesimplekid
0adf4e210d fix: cache test mint 2025-02-04 16:40:11 +00:00
thesimplekid
e8a85bf097 feat: tests for melt multi unit 2025-02-04 14:56:00 +00:00
thesimplekid
e31de19ba5 chore: add tests for swap with multiple units 2025-02-04 13:44:27 +00:00
thesimplekid
05259b99f4 fix: mint with outputs greater then total or multiple units 2025-02-04 13:04:59 +00:00
thesimplekid
df8291dc04 feat: rotate next keyset 2025-02-02 14:30:59 +00:00
thesimplekid
65e07e37f1 fix: mint start with newest keyset
chore: test for newest keyset

chore: add pure tests to ci
2025-02-02 11:53:19 +00:00
thesimplekid
017f88e5bc Merge pull request #567 from thesimplekid/fix_mint_melt_test
fix: add time out to wait invoice in tests
2025-01-30 09:58:43 +00:00
thesimplekid
335bac7bca chore: clippy 2025-01-30 00:07:46 +00:00
thesimplekid
c455809812 refactor: move quote_ttl to database 2025-01-29 23:58:13 +00:00
thesimplekid
5481286ec9 refactor: move mint_info to database 2025-01-29 23:29:25 +00:00
thesimplekid
0674144001 refactor: remove mint url from config 2025-01-29 20:38:53 +00:00
thesimplekid
0c6108f86d fix: add time out to wait invoice in tests 2025-01-28 17:15:04 +00:00
thesimplekid
70daaec622 fix: tests that attempt to mint before payment 2025-01-28 14:12:27 +00:00
ok300
a2005e1ff0 Remove Default implementation of MintMeltLimits
The default would have been min=0, max=0. This made any mint initialized with MintMeltLimits::default() to fail every mint and melt operation, because the amount was out of bounds.
2025-01-28 12:34:21 +01:00
ok300
9aa304d3d5 Rename vars for clarity 2025-01-26 11:32:04 +01:00
thesimplekid
67be74abb8 feat: tests on lnd node 2025-01-24 14:55:02 +00:00
thesimplekid
486f98bc8b feat: lnd mint 2025-01-23 23:45:31 +00:00
thesimplekid
72c66af8b7 feat: second lnd node 2025-01-23 20:56:01 +00:00
thesimplekid
ed23853d5d feat: abstract create mint 2025-01-22 20:03:20 +00:00
thesimplekid
c9c2061773 chore: update nix channel 2025-01-22 13:40:49 +00:00
thesimplekid
a9662d0362 refactor: add second cln node 2025-01-20 21:07:21 +00:00
thesimplekid
6bd4c0c899 feat: update regtest 2025-01-20 20:54:59 +00:00
thesimplekid
b86d42b6a5 fix: extra mint/melt info limits 2025-01-16 11:22:37 +00:00
thesimplekid
57a7aa09d6 refactor: pure tests 2025-01-14 12:24:30 +00:00
thesimplekid
190256fce6 refactor: start mint shared fn 2025-01-13 22:27:12 +00:00
thesimplekid
c5d4fa52ef refactor: regtest mint as bin 2025-01-13 20:58:19 +00:00
thesimplekid
1f45be28a3 refactor: mint builder in itest 2025-01-13 20:05:17 +00:00
C
8fe0982c6d Introduce cashu to host the shared types, traits and other common code (#519)
---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-01-12 12:50:05 +00:00
thesimplekid
6a8a5a7941 fix: mpp (#523) 2025-01-05 14:42:44 +00:00
David Caseria
d6b7d49ea9 Return proofs for wallet mint function (#520)
* chore: update flake

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-01-03 13:23:52 +00:00
C
c6e27d0de9 Add ArcSwap to update Mint configuration at runtime (#503)
* Add ArcSwap to update Mint configuration at runtime

The main goal is to change settings without having multiple RwLock everywhere,
instead having ArcSwap to update the configuration without having access to a
mutable reference to the Mint.

This will allow the RPC Server, or any other medium to update the Mint without
minimum contention.

* Rename structs

* Move quote_ttl to the new config

* Fixed clippy issues
2024-12-25 09:53:58 -05:00