Commit Graph

50 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
84cbeb6d30 fix proxy keys (#355)
* fix proxy keys

* fix all tests

* fix tor test
2023-11-09 17:03:45 -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
callebtc
744807b6f4 Remove P2SH (#341)
* remove p2sh

* Fix WalletAPI LockResponse
2023-10-13 21:41:54 +02:00
dni ⚡
e374d32df7 [CHORE] updating dependencies, mainly fastapi (#302)
* [CHORE] updating dependencies, mainly fastapi

i updated all lib that i could. :) test seem to pass

downgrade uvicorn for mypy to pass

chore

fixup

formatting

* make flake8 didnt flake tests
2023-08-24 11:09:07 +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 ⚡
ca2b8e7bd6 [FEAT] add pre-commit (#294)
* add pre-commit

* precommit formatting
2023-07-29 11:14:48 +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
callebtc
0b2468914d Determinstic secrets / ecash restore (#131)
* first working version but some sats go missing

* back at it

* make format

* restore to main

* move mint database

* fix some tests

* make format

* remove old _construct_outputs we reintroduced in merge with main

* add type annotations

* add wallet private key to tests

* wallet: load proofs

* fix tests

* _generate_secrets with deterministic generation (temporary)

* allow wallet initialization with custom private key

* add pk to wallet api test

* mint scope=module

* remove private_key from test_wallet.py to see if it helps with the github tests

* readd private keys to tests

* workflow without env

* add more private key!

* readd env

* ledger scope session

* add default private key for testing

* generate private keys if not available

* testing

* its working!!!

* first iteration of bip32 working

* get mint info and add many type annotations

* tests

* fix tests with bip32

* restore from multiple mints

* disable profiler

* make format

* failed POST /mint do not increment secret counter

* store derivation path in each token

* fix tests

* refactor migrations so private keys can be generated by the wallet with .with_db() classmethod

* start fixing tests

* all tests passing except those that need to set a specific private key

* bip39 mnemonic to seed - with db but restore doesnt work yet with custom seed

* mnemonic restore works

* enter mnemonic in cli

* fix tests to use different mnemonic

* properly ask user for seed input

* tests: dont ask for inputs

* try to fix tests

* fix cashu -d

* fixing

* bump version and add more text to mnemonic enter

* add more comments

* add many more comments and type annotations in the wallet

* dont print generated mnemonic and dont wait for input

* fix test

* does this fix tests?

* sigh....

* make format

* do not restore from an initialized wallet

* fix mnemonics

* fix nitpicks

* print wallet name if nonstandard wallet

* fix merge error and remove comments

* poetry lock and requirements

* remove unused code

* fix tests

* mnemonic.lower() and add keyset id if not present for backwards compat

* edit comment
2023-07-24 13:42:56 +02:00
dni ⚡
c7dd582b56 FEAT: improve on workflows and makefile (#276)
* FEAT: improve on workflows and makefile

* update to poetry 1.5.1

* caching needs newer python task

quickfix
2023-07-18 00:13:39 +02:00
callebtc
5f3f88c8ed [Mint] rewrite lnbits backend with httpx (#230)
* rewrite lnbits backend with httpx

* add httpx
2023-05-18 19:47:44 +02:00
calle
a2cdd002d8 cli logger refactor, poetry update (#125) 2023-03-05 03:29:55 +01:00
callebtc
f956938a2d update importlib versions 2023-01-15 11:08:22 +01:00
calle
344210d266 fix versions (#97) 2023-01-15 10:59:17 +01:00
callebtc
9c3fbda7b7 poetry lock 2023-01-15 01:24:48 +01:00
callebtc
b9123d9bd2 add wheel package for secp 2022-12-26 17:43:19 +01:00
callebtc
9fc7694c6b bump 2022-12-26 17:24:16 +01:00
callebtc
01c6e12b5a add nostr 2022-12-26 16:12:31 +01:00
callebtc
1e38fe695f add nostr 2022-12-18 17:10:06 +01:00
callebtc
d8cd648714 add tor 2022-10-29 18:07:13 +02:00
callebtc
6afc165a86 version changes for lnbits compatibility 2022-10-21 15:07:02 +02:00
callebtc
60c3c43bb2 pytest-cov for dev installs only 2022-10-16 13:24:23 +02:00
callebtc
0cdd5bd568 coverage 2022-10-16 13:21:31 +02:00
callebtc
ee16b3e0f9 disable starlette_context 2022-10-15 00:19:44 +02:00
callebtc
224e5c44ca add derivation path 2022-10-10 21:23:12 +02:00
callebtc
080ae4b224 context 2022-10-10 21:17:53 +02:00
callebtc
f47c006f7a cashu wallets fix 2022-10-09 22:18:27 +02:00
callebtc
c832b339ab bump to 0.3.1 2022-10-09 22:12:35 +02:00
callebtc
8867e75243 bump version to 0.2.1 2022-10-04 23:12:56 +02:00
callebtc
0e24579862 remove psycopg2 2022-10-03 01:02:27 +02:00
callebtc
b5e03e4fc7 use python-bitcoinlib instead of python-bitcointx 2022-10-02 11:51:47 +02:00
callebtc
92052a7ed9 remove unused imports 2022-09-29 02:28:51 +02:00
callebtc
68bae0d1cf isort and flask remove 2022-09-28 17:57:45 +02:00
callebtc
35a3e5e57a clean 2022-09-28 17:44:43 +02:00
callebtc
8dfe2b8511 fix info 2022-09-22 14:23:07 +03:00
callebtc
43e7889cab use compressed secret 2022-09-22 11:52:40 +03:00
callebtc
407450c9af cashu data dir 2022-09-19 00:11:37 +03:00
callebtc
c7a7e167d3 remove pycrypto 2022-09-17 15:17:20 +03:00
callebtc
98d5485bdd ssl 2022-09-17 14:25:17 +03:00
callebtc
5b100b2284 remove ecc 2022-09-17 11:16:52 +03:00
callebtc
0ab7a5ba0b remove ecc-pycrypto 2022-09-17 11:15:58 +03:00
callebtc
c3ae92edd1 pay lightning works 2022-09-17 01:14:57 +03:00
callebtc
3b0ebf9f6b update 2022-09-13 21:55:42 +03:00
callebtc
f2228e6a38 isort 2022-09-13 21:36:18 +03:00
callebtc
e18021cb9e fastapi 2022-09-13 16:06:40 +03:00
callebtc
18d955e4f0 lightning 2022-09-12 01:14:16 +03:00
callebtc
05cee3dd2a psycopg2-binary 2022-09-11 16:29:06 +03:00
callebtc
e07a098d9f add bech32 2022-09-11 16:28:18 +03:00
callebtc
cb45268547 pydantic 2022-09-11 16:26:55 +03:00
callebtc
c68ff25ac9 poetry.lock 2022-09-11 12:59:28 +00:00