Commit Graph

29 Commits

Author SHA1 Message Date
callebtc
fa5193cd8f index on db and read spent proofs from db (#370)
* index on db and read spent proofs from db

* add benchmark for testing

* remove benchmark

* add option to disable cached secrets

* disable python 3.9 tests
2023-11-26 06:07:38 -03:00
callebtc
0490f20932 Wallet: Lightning interface (#318)
* mint does not start yet

* fix import

* revert mint db migrations

* handle zero fee case

* cli: adjust fee message

* wallet: replace requests with httpx

* clean up

* rename http client decorator

* fix pending check in main, todo: TEST PROXIES WITH HTTPX

* fix up

* use httpx for nostr as well

* update packages to same versions as https://github.com/lnbits/lnbits/pull/1609/files

* fix proof deserialization

* check for string

* tests passing

* adjust wallet api tests

* lockfile

* add correct responses to Lightning interface and delete melt_id for proofs for which the payent has failed

* fix create_invoice checking_id response

* migrations atomic

* proofs are stored automatically when created

* make format

* use bolt11 lib

* stricter type checking

* add fee response to payments

* assert fees in test_melt

* test that mint_id and melt_id is stored correctly in proofs and proofs_used

* remove traces

* refactor: Lightning interface into own file and LedgerCrud with typing

* fix tests

* fix payment response

* rename variable
2023-10-21 14:38:16 +02:00
dni ⚡
88393fa4c4 [DEV] add ruff and remove isort and flake (#300)
* [DEV] add ruff and remove isort and flake
- precommit
- workflow
- Makefile

updated black

* configure black to use default line-length

* reformat to 88 chars line-length

* fix ugly comments
2023-08-24 09:47:47 +02:00
dni ⚡
e3ed00640f FEAT: Add flake8 (#267)
* init flake8

* exclude nostr client, and add ds_store to gitignore

* fix flake8 F811 issue, redefinition of unused variables

* add flake8 to workflow

* F401 unused imports

* F541 f-string is missing placeholders

* E501 line too long > 150 characters

* E722 no bare except

* E402 module level import not at top of file

* F405 no star imports

* E712 comparison to False should be 'if cond is False:'

* F841 local variable is assigned to but never used

* E266 too many leading '#' for block comment

* E265, E261

* E713 test for membership should be 'not in'

* E711, E741

E741 ambiguous variable name 'l'
E711 comparison to None should be 'if cond is None:'

* flake config

* isort

* refactor makefile flake8 usage

* reflaking the rebase

* black

* fix tests?

* black

* fix line lenght it test_cli

* sort out makefile

* fix strings

* reintroduce black-check

* reflake and mypy

* isort

* Update cashu/wallet/wallet.py

Co-authored-by: Angus Pearson <angus@toaster.cc>

* Update cashu/mint/ledger.py

Co-authored-by: Angus Pearson <angus@toaster.cc>

---------

Co-authored-by: Angus Pearson <angus@toaster.cc>
2023-07-28 18:42:16 +02:00
xphade
d1cae88062 Assert mint_private_key is available at startup (#208)
* Assert `mint_private_key` is available at startup

If the mint's private key is not available, the ledger cannot be created
because no pubkey can be derived. We now explicitly assert this with a
descriptive error message.

Additionally fixed some typing errors.

* Shorten error message
2023-05-14 14:12:00 +02:00
calle
d201b89df2 settings: add mint derivation path (#166) 2023-05-01 22:39:50 +02:00
calle
89fb2787e6 Python/relative_import (#186)
* relative import all the things

* make format

* add __init__.py to cli/

* fix mypy errors

* get rid of more mypy

* mypy fix crud.py

* fix another mypy error
2023-05-01 22:39:23 +02:00
calle
87f9241de1 [Mint] Fix key rotation (#177)
* rotate keys every 5 seconds

* every 10 seconds

* do not regenerate all past keys for each epoch cycle

* remove automatic rotation

* make format

* print to logger

* rephrase print
2023-04-26 20:20:17 +02:00
calle
8f2a0d6c72 cleanup and comments (#163) 2023-04-16 15:51:22 +02:00
calle
190f78eb54 fix derivation path to 0/0/0/0 (#157) 2023-04-01 01:31:31 +02:00
calle
db27105d17 TokenV3 and new Mint startup in tests (#149)
* tokenv3 send and receive
* receive v2 and v1 tokens with tests
2023-03-28 22:35:22 +02:00
calle
f3a31fd09e use settings module (#136)
* use settings module
2023-03-16 00:59:50 +01:00
calle
3333102327 lightning: add fakewallet (#134)
* lightning: add fakewallet

* make format

* fix mypy

* make backend configurable

* weird mypy
2023-03-07 17:49:27 +01:00
calle
5fdeecdc08 fix defaults for socks proxy and sat -> msat when ln is connected (#130) 2023-03-05 17:18:58 +01:00
calle
39e71b20d8 Mint database setting (#126)
* mint: new .env variable MINT_DATABASE

* make format
2023-03-05 11:13:55 +01:00
calle
2d66aeb79c Fix invoice asyncio wrapper (#113)
* mypy: fix lightning backend warnings

* fix asyncio invoice creation

* ignore weird mypy error
2023-02-25 16:44:51 +01:00
callebtc
6f913e3cc9 make format 2022-10-15 00:59:21 +02:00
callebtc
189fb7c5db force sorted dictionary for keyset calculation 2022-10-15 00:58:49 +02:00
callebtc
a84b04605e refactor 2022-10-13 22:11:00 +02:00
callebtc
3437af041e ability to specify the keyset for generating promises mint 2022-10-13 20:07:04 +02:00
callebtc
8721694785 can import, migration dont work yet 2022-10-12 20:52:35 +02:00
callebtc
fe9de4cbca restart imports 2022-10-11 10:08:05 +02:00
callebtc
244ea4a343 multiple keysets per mint 2022-10-08 19:25:03 +02:00
callebtc
fad9b91061 mint saves keyset ids 2022-10-08 15:08:20 +02:00
callebtc
52250fae77 make format 2022-10-08 13:57:00 +02:00
callebtc
6ce15da527 keyset working 2022-10-08 13:56:01 +02:00
callebtc
3581f7ccd2 p2sh working 2022-10-03 00:05:13 +02:00
callebtc
68bae0d1cf isort and flask remove 2022-09-28 17:57:45 +02:00
callebtc
001b5e24a0 refactor 2022-09-28 17:42:48 +02:00