* F541 fix
remove unused workflow and combine linters into one
add lnbits/static to ruff ignore
remote setupnode
ignore upgrades for mypy
ignore F401 for __init__ files
unused noqa
ignore upgrades for black
F821: undefine name
disabled and logged webhook_listener for opennode and lnpay because they are obvisouly not working
E402: module level import not at top of file
fixup
revert breaking changes wait for PR #1876https://github.com/lnbits/lnbits/pull/1876
E721 fixes, only popped up for python3.9 not 3.10
[REFACTOR] core/__init__ to not have circular import issues
WIP
add db for backwards compat
fix pyright
make mypy happy again
pyright did not catch those, i think mypy got confused with relative imports. maybe we should use absolute ones everywhere
E402: module level import not at top of file
dont forget to add core_app
rebase on ruff pr
f
remo
format
* fix clnrest
* ignore E402 in conftest
* refactoring issues
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* [BUG] self payments for fakewallet
make it possible to pay to yourself on fakewallet
f
* bugfix selfpayments for fakewallet
* delete by wallet and fix previous_payment check (#1919)
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* [FEAT] improve update_admin_settings
while working on the push notification pr i found it very hard just to update
2 settings inside the db, so i improved upon update_admin_settings.
now you just need to provide a dict with key/values you want to update inside db.
also debugging the endpoints for update_settings i found despite the type of `EditableSettings`
fastapi did in fact pass a dict.
* t
* use `EditableSettings` as param in update_settings
* fix settings model validation
we previously overrode the pydantic validation with our own method
* make `LnbitsSettings` a `BaseModel` and only add `BaseSettings` later
this allows us to instantiate `EditableSettings` without the environment values being loaded in
* add test
* forbid extra fields in update api
* fixup
* add test
* test datadir
* move UpdateSettings
* fix compat
* fixup webpush
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* add deleted flag on wallets
set deleted on delete wallet
2 twelves
format
fail on create invoice
make deleted check on SQL query
nazi flake8
add_test
boom... it works and passes!!
* add app fixture
vlad's recommendations
add deleted
* Add deleted flag to Wallet
* restore crud
* do not check for wallet in services.py
* add deleted flag on wallets
set deleted on delete wallet
2 twelves
format
fail on create invoice
make deleted check on SQL query
nazi flake8
add_test
boom... it works and passes!!
* add app fixture
vlad's recommendations
* add deleted
* error checks
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* [FIX] workflows
testing why workflwos unstable instable
* debug run_command
* add timeout to process run
* log lncli output
* try catch json exception in clnrest
* settle does not return a json
* add 10 minutes timeout to regtests if they ever get stuck
* better subprocess handling
* fix race condition
* test 3
* remove
* run nr 4
* increase waits for race conditions
* revert clnrest
* better fiat amount test
* save fiat_amounts on payment creation
* show fiat amount in frontend
* add lnbits_default_accounting_currency
* extract fiat calculation logic into service
* move all currency conversions to calc_fiat_amounts
move all conversion logic into create_invoice so extensions can benefit aswell
* show user-defined and wallet-defined currency in frontend
* remove sat from fiat units
* make bundle
* improve tests
* debug log
* replace async_wrap with run_sync
formatting
remove unused fn
properly raise exception, not for timeout though
* [TEST] proper startup and shutdown (#1860)
* add proper startup / shutdown in tests
* fix event loop issues
because uvloop was installed in server.py which is not the main entry point when tests are ran.
this caused the loops referenced by the locks and queues to be a different one than the one used to run the tests
(only an issue in python 3.9)
* give openapi more time, does not matter anyway, regtest takes way longer
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
remove uvloop
* fix test
* dont touch pyproject
* fix: install uvloop in conftest
not using uvloop at all causes tests to take way longer
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* [CHORE] cleanup cache and exception on `make test`
moved the invalidate_forever task to proper location and use `create_permanent_task`.
and there was a Task never awaited Exception when running tests
* imrpove expiration test
* move cache into utils
* fix issue with pytest_asyncio
s
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* simplify and cache exchange rate
note that exir was removed as a provider
* add binance as provider
* log exception
* add test
* add blockchain.com provider
* remove unused and update black + precommit
* makefile add ruff remove unused
* F541 fix
* complete ruff ignore
* remove unused workflow and combine linters into one
add lnbits/static to ruff ignore
save preview and linelength for later
define target version for black
* ignore upgrades for mypy
* remove flake8
* ignore F401 for __init__ files
* unused pylint comment
* unused noqa
* ignore upgrades for black
* run linting on py3.9 and py3.10
* dont assume python
* F821: undefine name
disabled and logged webhook_listener for opennode and lnpay because they are obviously not working
* E402: module level import not at top of file
* E721 fixes, only popped up for python3.9 not 3.10
* add simple caching utility
* test cache
* remove prefix, default on get
* check expiry in pop aswell
* remove unnecessary type
* improve invalidation task
increase default interval to 10 seconds - doesnt have to check that often.
instead of recreating the dict everytime mutate the existing one
* tests: hold invoice tests pending during payment
* sigh...
* ok
* hash preimage
* preimage_hash == payment_hash
* should error
* check that payment is gone
* cancel task while in-flight
* lnbits endpoing return error
* return error
* add both options
* fix list
* respond to error
* return false if payment status errors
* outgoing invoice should be deleted after one status check
* test api_payments_create error
* add hold invoices and basic test
* run request in parallel
* create_task
* dont cancel it
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* add send_payment_notification service
payment notifications are sent from multiple places with inconsistent and incomplete data
* adopt new send_payment_notification service
* add tests
* better checking
* flake8 fix
* make format
* invoices scope are function for tests
* invoice back to sessionbut keep real_invoice for now
* make format
* comment
* get payment by checking id and test
* added ratelimiter
* Adds server logs to admin ui
* Added IP allow/ban list
* fixed remove ips
* Split rate limit number and unit
* security tab and background tasks for killswitch
* fix test for auditor api
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
* initial backend support
* implement payments pagination on frontend
* implement search for payments api
* fix pyright issues
* sqlite support for searching
* backwards compatability
* formatting, small fixes
* small optimization
* fix sorting issue, add error handling
* GET payments test
* filter by dates, use List instead of list
* fix sqlite
* update bundle
* test old payments endpoint aswell
* refactor for easier review
* optimise test
* revert unnecessary change
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
* BUG: proper exception for paid interal invoices
* test should now fail, because we pay invoice twice, and should also work in regtest
* sorting
* unpack check_internal
* introduce another crud fn for checking internal paid payment
* rename
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* remove invoices
* remove invoices tests
* remove unused tests/extensions dir
* fix issue
* formatting
* test passing locally. and i dont know why
* fix _extension_dir loading
* gitkeep extension dir
* formatting
* remove bundle from check
* do not prettier compliled css
* do not prettier compliled css
* create extension dir, if it does not exists, just to be sure
* Update lnbits/extension_manager.py
---------
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>