Commit Graph

65 Commits

Author SHA1 Message Date
Pavol Rusnak
a377381942
use bytes.fromhex/hex builtins instead of binascii.hexlify/unhexlify 2022-12-29 16:46:35 +01:00
Vlad Stan
2eeef5c1ed
Merge branch 'main' into FinalAdminUI 2022-12-16 12:21:25 +02:00
callebtc
a7fe203abd fix: regtest error expectations fixed 2022-12-14 18:40:23 +01:00
callebtc
fa7bbb62e2 correct error codes in tests 2022-12-14 14:59:11 +01:00
Vlad Stan
1859ff5e36 fix: watchonly db (not sure why it was corrupted) 2022-12-12 18:28:24 +02:00
Vlad Stan
ae194b3bc7 fix: update dbversions after merge 2022-12-12 12:18:15 +02:00
Vlad Stan
6cab77ece4
Merge branch 'main' into FinalAdminUI 2022-12-12 10:49:31 +02:00
Vlad Stan
4cd2fe7ee1
Merge branch 'main' into FinalAdminUI 2022-12-09 14:06:47 +02:00
dni ⚡
b4e8659006 fix default value for reserve fee
format
2022-12-07 15:58:33 +01:00
dni ⚡
32459168f4 make value 4000, but it is failing locally for me 2022-12-07 15:32:24 +01:00
dni ⚡
5bc2c68cde test: bleskomat, another try 2022-12-07 14:29:58 +01:00
dni ⚡
57b8073eec test: fix bleskomat, get wallet from conftest 2022-12-07 14:21:35 +01:00
dni ⚡
b470d40e38 bleskomat WALLET class 2022-12-07 13:55:29 +01:00
dni ⚡
4227fd70da bleskomat import WALLET from helpers 2022-12-07 13:43:27 +01:00
dni ⚡
89933c2d30 test should pass now, WALLET is initialised after the settings are loaded from db. 2022-12-07 13:38:33 +01:00
callebtc
00a3bd9ce7 add migrated mock data to tests 2022-12-06 13:26:42 +01:00
Arc
69ef0f2bb1
Merge pull request #1160 from blackcoffeexbt/bugfix/lnbits-casing
LNbits casing fixes
2022-12-01 12:24:27 +00:00
callebtc
33eb460d5c restore 7f64f426c2 2022-12-01 12:21:25 +01:00
callebtc
35c5542b2f restore 7f64f426c2 2022-11-30 16:24:13 +01:00
Black Coffee
20b06e4922 Corrected casing of LNbits (not LNBits) throughout repo 2022-11-30 14:14:31 +00:00
calle
5c09469d61
Revert "Extension: Cashu" 2022-11-27 18:03:20 +01:00
callebtc
05d59cd7fa add correct mock data 2022-11-26 02:15:18 +01:00
callebtc
7bfd8f3a62 overwrite mock data 2022-11-24 16:08:12 +01:00
callebtc
26087047b6 add mock data for cashu 2022-11-24 16:00:19 +01:00
dni ⚡
74eece78de merge from master 2022-11-24 14:35:32 +01:00
dni ⚡
d9a153d43d fix tests to low balance 2022-11-22 10:37:13 +01:00
Vlad Stan
0673245d11 chore: update watchonly db 2022-11-17 14:22:37 +02:00
dni ⚡
bf566c5a26 fix tests a little 2022-10-05 13:05:11 +02:00
dni ⚡
36f54ff0c3 formatting and conftest 2022-10-05 13:04:38 +02:00
dni ⚡
ec0375b47c trying to fix tests 2022-10-05 13:04:38 +02:00
dni ⚡
20d38535aa fix tests settings 2022-10-05 13:04:38 +02:00
dni ⚡
d8acad4282
make sure tests not spamming boltz live servers (#1000)
* make sure tests not spamming boltz live servers

* fixing tests to no run on live servers
2022-09-23 11:35:18 +03:00
dni ⚡
78a98ca97d
Boltz.exchange Extension (#922)
* initial commit and still draft, ready for review

* forgot to uncomment this line

* fee estimation and blockheight

* resolve conversation with michael, to use mempool websockets instead of boltz status event

* Update lnbits/extensions/boltz/boltz.py

Co-authored-by: michael1011 <me@michael1011.at>

* add status to swaps, add sorting and data into listing

* add swap status checks, change urls to docker test setup, dynamic minimum and maximum limits

* fix docker hosts for development

* add api endpoints to _api_docs

* add wallet name and id, to list and status information

* fix status_update for reverse_swaps

* chore: format with black

* more blackformatting and refactoring create_swap()

* fix variable bug

* check if swap is already refunded

* use create_task instead of ensure_future

* add mempool and boltz urls depending on DEBUG .env

* raise exception in mempool fails

* fix onchain txs, sending funds to wrong address and add a refund address for normal swaps beforehand

* add status to swaps, add sorting and data into listing

* add swap status checks, change urls to docker test setup, dynamic minimum and maximum limits

* add wallet name and id, to list and status information

* fix status_update for reverse_swaps

* chore: format with black

* use create_task instead of ensure_future

* add mempool and boltz urls depending on DEBUG .env

* fix onchain txs, sending funds to wrong address and add a refund address for normal swaps beforehand

* black formatting

* add some logging with loguru, and remove function duplication

* cleanup readme

* updates/suggestions from calle

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

* remove unused comments

* Update API Endpoints

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

* un-factor get_boltz_pairs

* added a explaination for the onchain tx

* remove unused template file

* rename api endpoints

* fix isort and prettier

* more verbose logging!!

* add boltz to mock_data.zip

* new mockdata

* remove comment

* better readme

* fix mempool urls

* change /refund /check /status to post requests

* first step in tests2

* add first tests

* change refund,check,status to post requests

* next try on tests

* overall code improvements

* just testing tests

* throw http exceptions in views_api

* require admincheck for refund,check,status and added fastapi documentation for those

* added more tests

* black

* many code improvements

* adding tests

* temp fix test

* fix race condition when pay_invoice fails

* test are working

* add boltz env variables

* add startup check, bugfixes, improvements

* improve on status checking

* remove check_invoice_status

* more fixes and tests

* testing testing testing

* make tests run again inside regtest

* fix bad error :O

* fix postgres boolean bug and add swap test

* Update README.md

Update README.md

Update README.md

Update README.md

* some mypy

* blacked

* the missing commit?

* fix api_docs readme link

* better refunding error catching

fix

* check swaps now also shows pending reverse swap, ui improvements, tooltips

* add backend check for boltz limits

fixup

* many improvements, startup check for swaps working, reverse needs more testing

* little last fixes

* remove unused logic

* fastapi documentation

fixup

* formatting and remove unused tests

* fix test

* fix swapstatus model

* Update lnbits/extensions/boltz/tasks.py

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

* Update lnbits/extensions/boltz/views_api.py

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

* balance check msg, format

* fix mypy data override

* fix swapstatus, remove can refund column

* Update lnbits/extensions/boltz/README.md

Co-authored-by: michael1011 <me@michael1011.at>

* empty lines

* fix error message when swap is not found

* remove preimage_hash from database

* fix api_docs html

fix api_docs html

* catch boltz network exceptions better

* formatting

* check for timeout on swap at get request

Co-authored-by: michael1011 <me@michael1011.at>
Co-authored-by: fusion44 <some.fusion@gmail.com>
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-08-30 12:51:17 +02:00
dni ⚡
d649e6a5c0
fix migrations, add documentation, hopefully fix workflow (#899)
* fix migrations, add documentation, hopefully fix workflow

* renaming to test-migration and add migration

Co-authored-by: dni <dni.khr@gmail.com>
2022-08-17 15:42:01 +02:00
dni ⚡
88ec440ea1
another testcase the fails similar to #847 (#892)
* another testcase the fails similar to #847

* proper fix

* revert to statuscode 401 and code improvements @calle

Co-authored-by: dni <dni.khr@gmail.com>
2022-08-16 17:01:05 +02:00
Lee Salminen
c32ff1de59
New Extension: Invoicing (#733)
* initial commit

* add docs

* black & prettier

* mobile styles

* add print view

* prettier

* make format

* initial migrations un-messed

* make migrations work for sqlite

* add invoices table

* clean migrations

* add migration to conv

* fix card size

* hopefully fix test migration

* add missing status

* timestamp

* init testing

* remove draft invoice by default on create

* what should i test

* make format

* raise if not invoice

* new test and renaming

* fix issue reported by @talvasconcelos which prevented users from setting status on creation

* readme

* run black

* trying to make tests work

* make it work again

* send paid amount

* partial pay flow

* good coding

* can't get these test to work

* clean up and commenting

* make format

* validation for 2 decimals

Co-authored-by: ben <ben@arc.wales>
Co-authored-by: Tiago vasconcelos <talvasconcelos@gmail.com>
2022-08-13 21:37:44 +02:00
dni ⚡
d989441587
added test for issue #847 and fixed it! (#848)
* added test for empty post data, for issue #847

* black

* fixed the failing testcase

* Update lnbits/decorators.py

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

Co-authored-by: dni <dni.khr@gmail.com>
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-08-13 14:47:29 +02:00
calle
e5d8c500d2
Wallets/unhashed_description (#870)
* new argument: unhashed_description

* accept in api

* set unhashed_description for memo case

* bolt11.py: dont be like CLN, accept the hash

* send hash to lnd in b64

* fix cln

* skip descr_hash for cln

* skip

* format
2022-08-13 14:29:04 +02:00
calle
8535d70d36
Poetry dev (#837)
* black and isort for tests

* black and isort for build

* use poetry in Makefile, update pyproject.toml dependencies and add configs for black, pytest, mypy, isort there

* switching github workflow to poetry

* set mininum version to python 3.7

* fix tests

* add types-protobuf to dev packages

* fix cln regtest

* update docs

* try fix 1

* mypy fix2

* fix isort formatting workflow

* add prettier to dev docs

* multiple valid python version for pyproject

* update poetry.lock

* remove development installation, not needed anymore

* fix migration workflows

* format into one test

* fix yaml

* fix pipeline

* fix pipeline

* fix again

* fix

* rename checks

* remove venv tests

* venv test once

Co-authored-by: dni <dni.khr@gmail.com>
2022-08-03 14:10:32 +02:00
calle
c88e6b0e62
Mega-merge 1: Test invoice creation with description hash (WIP) (#812)
* check for description hash

* remove unnecessary asserts for clarity

* assume that description_hash is a hash already

* no lock

* restore bolt11.py

* /api/v1/payments with hex of description

* comment
2022-08-01 16:12:25 +02:00
ben
184da9958c Merge branch 'main' into SCRUB 2022-07-28 12:46:19 +01:00
Tiago vasconcelos
556eef35ab add scrub mock data 2022-07-28 10:10:23 +01:00
dni
e67b2c0529 Merge branch 'main' into fix/mypy 2022-07-25 13:46:22 +02:00
Daniel Krahofer
b865fad95e Update tests/core/views/test_api.py
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-07-25 12:05:16 +02:00
Daniel Krahofer
e939b9a5aa Update tests/core/views/test_api.py
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-07-25 12:05:16 +02:00
dni
463fbb39bd make test run again, introduce mypy again 2022-07-25 12:03:06 +02:00
dni
b9373f7283 add tests for api_payment 2022-07-25 12:03:06 +02:00
calle
4bb184e08b
CI: DB migration with real data (#776)
* fix migration conv.py

* migrate with mock data
2022-07-25 09:13:41 +02:00
calle
32a8736f32
CI: Test core/views/generic.py enabling and disabling extensions (#774) 2022-07-23 11:58:29 +02:00
calle
96af5fc3a7
CI: Test core/views/generic.py (#772)
* Adds tests for GET /wallet

* Update `httpx` to `0.23.0` and `http-core` to `0.15.0` in `venv` installation path

* Fix `secp256k1 = "==0.14.0"` and `cffi = "==1.15.0"`
2022-07-23 10:39:58 +02:00