Commit Graph

1218 Commits

Author SHA1 Message Date
thesimplekid
c1d6880daa Merge pull request #740 from KnowWhoami/test/remove_anyhow
test: use `expect` / `unwrap` instead of  `anyhow`
2025-05-01 12:43:05 +01:00
KnowWhoami
ffce3a8aef test: use expect/unwrap instead of anyhow 2025-05-01 03:29:43 +05:30
thesimplekid
4c80108ace Merge pull request #739 from thesimplekid/fix_ws_commands
fix: Update SupportedMethods with WsCommand enum and new constru…
2025-04-29 09:44:37 +01:00
thesimplekid
d880bb13cc refactor: Update SupportedMethods with WsCommand enum and new constructor 2025-04-29 08:53:55 +01:00
thesimplekid
052f4e812d Merge pull request #737 from thesimplekid/replace_testnut
feat: use tsk testmint
2025-04-29 08:07:40 +01:00
thesimplekid
a113bb16c4 Merge pull request #738 from crodas/fix/race-condition-tests
Fix race condition
2025-04-29 08:06:53 +01:00
Cesar Rodas
2dec11e1e4 Fix race conditions
Because of the nature of Rust tests, the nutshell integration test has a race
condition. Triggering the issue in the local environment was hard, but it
happens more often in #509 because all the keys are read from memory without
blocking the database.

The error happens because, by default, Rust tests run in parallel, and maybe by
design or by mistake, the external wallet did not increase its counter until
the completion of the minting. This led to some tests having the same blinded
messages, and the fastest test would mint successfully. The slowest test would
result in the CDK failing to sign duplicated blinded messages.

In any case, the fix is on the rust side, running the tests sequentially.
2025-04-28 18:53:41 -03:00
thesimplekid
63e6a4d610 feat: use tsk testmint 2025-04-27 16:21:25 +01:00
thesimplekid
7ae5a0c8b9 Merge pull request #736 from thesimplekid/prepare_v0.9.1
chore: bump CDK version from 0.9.0 to 0.9.1
2025-04-23 19:59:28 +01:00
thesimplekid (aider)
d8dad5dc7c chore: bump CDK version from 0.9.0 to 0.9.1 2025-04-23 18:54:05 +01:00
thesimplekid
d57abea048 Merge pull request #734 from thesimplekid/fix_remove_urls
fix: remove urls grpc
2025-04-23 18:49:37 +01:00
thesimplekid
1fbb6c7aa9 fix: remove urls grpc 2025-04-23 17:05:26 +01:00
thesimplekid
1683bc10a7 Merge pull request #733 from aki-mizu/main
update lnbits-rs to 0.5.0
2025-04-23 09:49:39 +01:00
Darrell
bac711d9fd update lnbits-rs to 0.5.0 2025-04-23 16:44:59 +09:00
C
15e10c0e90 Merge pull request #730 from crodas/fix/race-condition-state-update
Fix race conditions with proof state updates.
2025-04-22 11:24:58 -04:00
Cesar Rodas
25fad98aa8 Fix formatting 2025-04-22 11:43:25 -03:00
C
5505f0b5d7 Apply suggestions from code review
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-04-22 09:30:21 -04:00
thesimplekid
db14c1aecc Merge pull request #731 from thesimplekid/fix_p2pk_multi_sig
Fix p2pk multi sig
2025-04-22 12:48:46 +01:00
thesimplekid
570782e3b6 chore: clippy 2025-04-22 11:29:36 +01:00
thesimplekid
8379da2655 fix: only could sigs from unique pubkeys 2025-04-22 11:29:36 +01:00
thesimplekid
48fd3c652b test: multiple sigs 2025-04-22 11:29:36 +01:00
thesimplekid
204ff46dc4 Merge pull request #732 from thesimplekid/update_stable_rust
chore: update stable rust to 1.86.0
2025-04-22 11:21:16 +01:00
thesimplekid
06a3237977 chore: update stable rust to 1.86.0 2025-04-22 10:12:15 +01:00
Cesar Rodas
81a6d68ef3 Remove wallet states from check_state_transition 2025-04-20 11:17:03 -03:00
Cesar Rodas
abdde307c6 Fix race conditions with proof state updates.
Add a strict set of updates to prevent incorrect state changes and correct
usage. Supporting the transaction at the trait level prevented some cases, but
having a strict set of state change flows is better.

This bug was found while developing the signatory. The keys are read from
memory, triggering race conditions at the database, and some `Pending` states
are selected (instead of just selecting `Unspent`).

This PR also introduces a set of generic database tests to be executed for all
database implementations, this test suite will make sure writing and
maintaining new database drivers
2025-04-19 18:15:42 -03:00
thesimplekid
3626dd2f6a Merge pull request #727 from thesimplekid/fix_debug_info_panic
Fix debug info panic
2025-04-14 12:10:32 +01:00
thesimplekid
717742be05 fix: debug print of info 2025-04-13 22:21:43 +01:00
thesimplekid (aider)
f5f3e50507 fix: Correct mnemonic hashing in Debug implementation 2025-04-13 22:19:41 +01:00
thesimplekid
607cdf23d4 feat: Add robust mnemonic hashing and debug tests for Info struct 2025-04-13 22:19:39 +01:00
thesimplekid
7715d45f3b Merge pull request #724 from thesimplekid/token_value_uniqe
refactor: Ensure unique proofs when calculating token value
2025-04-11 10:03:57 +01:00
thesimplekid
43d1d75b7e feat: mint should not enforce expiry (#723) 2025-04-11 09:26:19 +01:00
thesimplekid (aider)
3b5c8b5c5e refactor: Ensure unique proofs when calculating token value 2025-04-10 23:21:58 +01:00
thesimplekid
0d512c1d15 feat: mint should not enforce expiry 2025-04-10 22:59:49 +01:00
lollerfirst
dafdf757af CORS Headers in Responses (#719)
* access control headers for CORS request from in-browser wallets

* cargo fmt

* handle preflight requests
2025-04-10 13:47:35 +01:00
timesince
5df983c388 chore: fix typo in DEVELOPMENT.md (#720)
Signed-off-by: timesince <seekseat@icloud.com>
2025-04-10 08:39:39 +01:00
thesimplekid
96179b7d14 chore: Bump CDK crates version from 0.8.1 to 0.9.0 2025-04-09 15:33:01 +01:00
thesimplekid
db067a145d docs: Add README.md for cdk-mint-rpc crate (#717)
* docs: Add README.md for cdk-mint-rpc crate

* docs: auth readme
2025-04-09 15:29:03 +01:00
thesimplekid
f44f79d3e0 fix: grpc set mint urls, updating description and add get quote ttl (#716)
* fix: grpc set mint urls

* refactor: Extract payment processor retrieval into helper method

* fix: only allow updates to nut04/05 where there is a backend

* feat: Add GetQuoteTtl RPC method to retrieve quote TTL settings

* fix: update long desctiption
2025-04-09 15:28:25 +01:00
thesimplekid
fb613b2e21 Merge pull request #713 from thesimplekid/fix_amountless_enabled_check
fix: amountless setting
2025-04-08 11:16:32 +01:00
thesimplekid
92500c27fe Merge pull request #712 from gandlafbtc/patch-2
fix typo in README.md
2025-04-08 10:25:04 +01:00
thesimplekid
e883d2d684 fix: amountless setting 2025-04-08 10:23:42 +01:00
gandlafbtc
017ce71bff fix typo in README.md 2025-04-08 18:20:32 +09:00
thesimplekid
b1c7aed8e4 Merge pull request #711 from thesimplekid/changel
docs: update change log
2025-04-08 09:29:52 +01:00
thesimplekid
cce8dbfe7e docs: update change log 2025-04-08 08:23:52 +01:00
thesimplekid
759201bc7c Export MintDatabase traits in the cdk crate (#710) 2025-04-07 22:45:15 +01:00
David Caseria
3514f362eb Export MintDatabase traits in the cdk crate 2025-04-07 12:45:02 -04:00
thesimplekid
0b9ca1a474 Time time series (#708)
* feat: Add created_time and paid_time fields to MintQuote struct

* feat: Add serde default of 0 for created_time in MintQuote

* feat: Add created_time and paid_time to MintQuote and MeltQuote structs

* feat: Add paid_time update when setting melt quote state to Paid

* fix: Update melt quote state with current Unix timestamp

* feat: Add paid_time update for mint quote when state is set to Paid

* feat: Add issued_time field to MintQuote conversion from SQLite row

* feat: Add issued_time tracking for MintQuoteState::Issued state

* feat: Add migration script for mint time of quotes

* feat: Add timestamp columns to mint_quote and melt_quote tables

* feat: Add timestamp columns to `add_mint_quote` method

* refactor: Improve code formatting and readability in mint quote state update logic

* feat: Add created_time and paid_time columns to melt_quote query

* feat: time on mint and melt quotes

* feat: Add migration script for mint created time signature

feat: Add created_time column to blind_signature table

feat: Add created_time to blind_signature insertion

feat: Add created_time column to proof table and update insert query

feat: time on mint and melt quotes

* feat: Add new table to track blind signature creation time

* feat: Add timestamp tracking for proofs in ReDB database

* feat: redb proof time

* chore: fmt
2025-04-07 12:51:14 +01:00
C
43ab1fdde1 Do not create the wallet struct directly; instead, call new. (#707)
The bug comes with the SQLx-sqlite pool bug, where several connections are
created by default, but the `new` function takes care of that, fixing that bug
by making a single instance of the database.

If constructed directly, the pool would create several connections to the
database, which in most instances is fine, but with SQLite :memory: each
connection is entirely independent.

Also follow documentation to make sure that failed `acquire` will not end up
dropping connections by setting  test_before_acquire to false

     However, if your workload is sensitive to dropped connections such as using an in-memory
     SQLite database with a pool size of 1, you can pretty easily ensure that a cancelled
     `acquire()` call will never drop connections by tweaking your [`PoolOptions`]:

     * Set [`test_before_acquire(false)`][PoolOptions::test_before_acquire]
     * Never set [`before_acquire`][PoolOptions::before_acquire] or
       [`after_connect`][PoolOptions::after_connect].
2025-04-06 07:13:14 +01:00
thesimplekid
d224cc57b5 Melt to amountless invoice (#497)
* feat: melt token with amountless

* fix: docs

* fix: extra migration
2025-04-04 13:16:27 +01:00
thesimplekid
09f339e6c6 Merge pull request #704 from thesimplekid/fix_mint_pending
fix: mint pending get mint info to create auth wallet
2025-04-03 15:44:56 +01:00