Commit Graph

601 Commits

Author SHA1 Message Date
callebtc
4f52973908 Update PostRestoreResponse class to use "signatures" instead of "promises" (#467)
* update nut-09 endpoint

* add to deprecated router and wallet
2024-03-12 15:52:20 +01:00
callebtc
ff1e7597d1 Merge both h2c tests and add tests for deterministic blinding factor generation (#466) 2024-03-04 15:34:51 +01:00
callebtc
29be002495 Wallet: deprecate old h2c (#459)
* wallet: deprecate old hash to curve

* fix order

* added migration: untested

* recompute Y always
2024-02-26 23:07:13 +01:00
callebtc
53cd8ff016 bump version to 0.15.1 (#461) 2024-02-26 01:50:37 +01:00
callebtc
cfebf70a0a Wallet: fix nostr receive cli linebreak prints (#462) 2024-02-26 01:49:51 +01:00
callebtc
a77b7dd5e8 Wallet: fix nostr receive (#460)
* fix wallet nostr receive

* add log

* add more relays and print info nicer
2024-02-26 01:25:05 +01:00
callebtc
be7a8a744f Revert "Wallet: deprecate old hash to curve (#457)" (#458)
This reverts commit b06d93c5ff.
2024-02-26 00:30:42 +01:00
callebtc
b06d93c5ff Wallet: deprecate old hash to curve (#457)
* wallet: deprecate old hash to curve

* fix order
2024-02-26 00:24:58 +01:00
callebtc
a546a246e2 Tests: add step2 domain separated test (#456)
* add step2 domain separated test

* add test3 derived from domain separated outputs

* Fix comment
2024-02-23 17:26:46 +01:00
callebtc
e2c8f7f694 Add tests for domain separated h2c (#451)
* add tests for domain separated h2c

* refactor b_dhke and add domain separated test
2024-02-21 11:10:50 +01:00
callebtc
c630fc8c40 blink: return preimage (#447) 2024-02-19 20:17:04 +01:00
callebtc
1c2c01ccfa test blink failed payment (#446) 2024-02-19 19:42:06 +01:00
callebtc
2189728771 blink: round up fees to next satoshi (#445) 2024-02-19 16:30:44 +01:00
callebtc
1e26f235d5 Blink: timeout for LN probes (#444)
* blink: timeout for ln probes

* make MINIMUM_FEE_MSAT a const

* format
2024-02-18 23:47:21 +01:00
callebtc
a3145a93d5 do not chcek melt status before payment attempt (#443) 2024-02-18 23:26:55 +01:00
callebtc
c4e8618cad Catch CashuErrors (#442) 2024-02-18 23:20:44 +01:00
callebtc
9c3949d197 Mint: fix Blink multiple failed attempts (#440)
* fix: blink multiple failed attempts

* fix line length again
2024-02-18 19:26:10 +01:00
callebtc
ad906df788 Mint: blink fix fee estimation (#439)
* blink: fix fee esimation

* fix line length

* fix line length

* fix line length

* remove noqa
2024-02-18 12:24:41 +01:00
callebtc
c4f4f3ccf2 Revert "Dev: Update ruff precommit hooks (#434)" (#436)
This reverts commit fca2a6cb4b.
2024-02-17 21:33:16 +01:00
callebtc
fca2a6cb4b Dev: Update ruff precommit hooks (#434)
* update ruff

* test

* update ruff

* only ruff check

* CI rename
2024-02-17 21:22:07 +01:00
callebtc
c285d48edf Add Blink backend (#433)
* wip blink

* Blink working

* check fee correctly

* add comment

* unfix lnbits

* unit test blink backend

* make format

* mypy

* settings

* add error if blink key not set
2024-02-17 20:51:37 +01:00
callebtc
d1540ccb5b wallet: add batch size setting (#431) 2024-02-16 15:22:41 +01:00
Steffen
1397c46ff4 add missing disabled-flag to nut4 (#426)
* add missing disabled-flag to nut4

* Update cashu/mint/router.py

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2024-02-16 14:07:44 +01:00
callebtc
afbde83ae2 wallet print on json deseriliaztion error and batch invalidation of proofs (#430) 2024-02-16 12:11:39 +01:00
callebtc
3f090c1691 Mint: add expiry to quotes, closes #385 (#429)
* add expiry to quotes, closes #385

* fix wallet deprecated mock with expiry

* expiry is an optional field
2024-02-16 11:40:46 +01:00
callebtc
ecad95715f readd db backup (#424) 2024-02-15 15:58:40 +01:00
callebtc
e251e8a9ea no backup (#423) 2024-02-15 14:01:06 +01:00
callebtc
d168b4b516 do not migrate in the beginning (#422) 2024-02-15 13:30:53 +01:00
callebtc
7c644e1835 Adjust new domain separator (#421)
* adjust new domain separator

* Update cashu/core/crypto/b_dhke.py

Co-authored-by: Lagrang3 <32647090+Lagrang3@users.noreply.github.com>

* slightly adjust comment

---------

Co-authored-by: Lagrang3 <32647090+Lagrang3@users.noreply.github.com>
2024-02-15 09:45:45 +01:00
callebtc
464c0e0ea4 DB backups before migrations (#420)
* make backups before migrations

* database tests

* postgres db backup with location string

* ignore version in pg_dump and throw warning

* install latest pg_dump

* install latest

* pg update?

* remove test from github

* skip for postgres on github actions
2024-02-11 20:23:43 +01:00
callebtc
f74f18c9ca Github CI with Postgres (#417)
* with postgres

* postgres test explicit

* make format

* start postgres only if needed

* remove if again

* print db

* db in matrix

* delete schema

* use new env var MINT_TEST_DATABASE for tests

* add db path to regtest
2024-02-11 15:52:02 +01:00
callebtc
78de84f3eb drop balance views during migration (#416) 2024-02-11 13:49:28 +01:00
callebtc
ac8e21a3a4 relative import all (#415) 2024-02-11 12:51:44 +01:00
callebtc
a2b9ac8f14 relative import (#414) 2024-02-11 12:46:53 +01:00
callebtc
6db4604f99 Mint: store Y in db (#412)
* storage y db

* for proofs_pending as well

* pending check with Y

* fix pending table

* test_race_pending

* skip race condition test on github

* skip test on github actions

* move test_cli.py -> test_wallet_cli.py

* get full proof from memory

* add domain separation wallet
2024-02-10 22:52:55 +01:00
callebtc
1de7abf032 mint: do not print all keysets (#410) 2024-02-05 23:23:52 +01:00
callebtc
7574b13229 Mint: option to not duplicate keysets (#409)
* option to not duplicate keysets

* test also settings
2024-02-05 23:19:31 +01:00
callebtc
087ee957a5 remove column check during migration (#408) 2024-02-05 18:43:11 +01:00
callebtc
f8f167fe23 Mint: fix lnbits migration (#407)
* fix lnbits migration

* save without format

* make format
2024-02-05 17:52:47 +01:00
callebtc
e02e4bbf49 mint: add seed decrypt (#403)
* mint: add seed decrypt

* add mint seed decryoption and migration tool
2024-02-05 16:22:53 +01:00
callebtc
30b6e8aa56 not null constaint (#402) 2024-02-02 22:09:06 +01:00
callebtc
6ddce571a0 Keysets per seed and postgres (#400)
* allow generation of keys per seed phrase

* emit errors correctly

* parse timestamps for melt and mint quotes correctly

* error messages

* adjust error message

* postgres works

* prepare postgres tests

* timestamps refactor

* add command to key activation

* generate keys per seed

* add keyset tests

* keyest uniqueness constaint on (derivation_path, seed)

* add tables ony if not exists

* log leve
2024-02-02 21:25:02 +01:00
callebtc
bc2b555c16 sign outputs as bytes (#399) 2024-01-25 23:22:16 +01:00
callebtc
7b5192c27a fix: do not serialize-deserialize secret for p2pk signature check (#398) 2024-01-25 20:56:41 +01:00
callebtc
b307c4db79 Ngutech21-fix-get-quote-api (#397)
* fix: v1 mint-quote api in router

* fix get mint quote

* test new endpoints

---------

Co-authored-by: ngutech21 <ngutech21@pm.me>
2024-01-24 22:02:25 +01:00
callebtc
2645eb51bc fix melt requiring outputs 2024-01-21 22:02:04 +01:00
callebtc
911886892d skip amount refactor (#394) 2024-01-21 20:52:15 +01:00
callebtc
a2709703f5 skip change output amount verification during melt (#393)
* skip change output amount verification during melt

* make format
2024-01-21 20:45:40 +01:00
callebtc
a518274f7e Nutshell cleanup wishlist (#332)
* fix keys

* fix tests

* backwards compatible api upgrade

* upgrade seems to work

* fix tests

* add deprecated api functions

* add more tests of backwards compat

* add test serialization for nut00

* remove a redundant test

* move mint and melt to new api

* mypy works

* CI: mypy --check-untyped-defs

* add deprecated router

* add hints and remove logs

* fix tests

* cleanup

* use new mint and melt endpoints

* tests passing?

* fix mypy

* make format

* make format

* make format

* commit

* errors gone

* save

* adjust the API

* store quotes in db

* make mypy happy

* add fakewallet settings

* remove LIGHTNING=True and pass quote id for melt

* format

* tests passing

* add CoreLightningRestWallet

* add macaroon loader

* add correct config

* preimage -> proof

* move wallet.status() to cli.helpers.print_status()

* remove statuses from tests

* remove

* make format

* Use httpx in deprecated wallet

* fix cln interface

* create invoice before quote

* internal transactions and deprecated api testing

* fix tests

* add deprecated API tests

* fastapi type hints break things

* fix duplicate wallet error

* make format

* update poetry in CI to 1.7.1

* precommit restore

* remove bolt11

* oops

* default poetry

* store fee reserve for melt quotes and refactor melt()

* works?

* make format

* test

* finally

* fix deprecated models

* rename v1 endpoints to bolt11

* raise restore and check to v1, bump version to 0.15.0

* add version byte to keyset id

* remove redundant fields in json

* checks

* generate bip32 keyset wip

* migrate old keysets

* load duplicate keys

* duplicate old keysets

* revert router changes

* add deprecated /check and /restore endpoints

* try except invalidate

* parse unit from derivation path, adjust keyset id calculation with bytes

* remove keyest id from functions again and rely on self.keyset_id

* mosts tests work

* mint loads multiple derivation paths

* make format

* properly print units

* fix tests

* wallet works with multiple units

* add strike wallet and choose backend dynamically

* fix mypy

* add get_payment_quote to lightning backends

* make format

* fix startup

* fix lnbitswallet

* fix tests

* LightningWallet -> LightningBackend

* remove comments

* make format

* remove msat conversion

* add Amount type

* fix regtest

* use melt_quote as argument for pay_invoice

* test old api

* fees in sats

* fix deprecated fees

* fixes

* print balance correctly

* internally index keyset response by int

* add pydantic validation to input models

* add timestamps to mint db

* store timestamps for invoices, promises, proofs_used

* fix wallet migration

* rotate keys correctly for testing

* remove print

* update latest keyset

* fix tests

* fix test

* make format

* make format with correct black version

* remove nsat and cheese

* test against deprecated mint

* fix tests?

* actually use env var

* mint run with env vars

* moar test

* cleanup

* simplify tests, load all keys

* try out testing with internal invoices

* fix internal melt test

* fix test

* deprecated checkfees expects appropriate fees

* adjust comment

* drop lightning table

* split migration for testing for now, remove it later

* remove unused lightning table

* skip_private_key -> skip_db_read

* throw error on migration error

* reorder

* fix migrations

* fix lnbits fee return value negative

* fix typo

* comments

* add type

* make format

* split must use correct amount

* fix tests

* test deprecated api with internal/external melts

* do not split if not necessary

* refactor

* fix test

* make format with new black

* cleanup and add comments

* add quote state check endpoints

* fix deprecated wallet response

* split -> swap endpoint

* make format

* add expiry to quotes, get quote endpoints, and adjust to nut review comments

* allow overpayment of melt

* add lightning wallet tests

* commiting to save

* fix tests a bit

* make format

* remove comments

* get mint info

* check_spendable default False, and return payment quote checking id

* make format

* bump version in pyproject

* update to /v1/checkstate

* make format

* fix mint api checks

* return witness on /v1/checkstate

* no failfast

* try fail-fast: false in ci.yaml

* fix db lookup

* clean up literals
2024-01-08 00:57:15 +01:00
callebtc
375b27833a fix missing dleq proof in db (#380) 2023-12-06 13:04:47 +01:00