Mint: add websockets for quote updates (#413)

* add websockets for quote updates

* add test (not working)

* wip: emit events to everyone

* wip: emit events to everyone

* wip, lots of things broken but invoice callback works

* wip

* add wip files

* tests almost passing

* add task

* refactor nut constants

* startup fix

* works with old mints

* wip cli

* fix mypy

* remove automatic invoice test now with websockets

* remove comment

* better logging

* send back response

* add rate limiter to websocket

* add rate limiter to subscriptions

* refactor websocket ratelimit

* websocket tests

* subscription kinds

* doesnt start

* remove circular import

* update

* fix mypy

* move test file in test because it fails if it runs later... dunno why

* adjust websocket NUT-06 settings

* local import and small fix

* disable websockets in CLI if "no_check" is selected

* move subscription test to where it was

* check proof state with callback, add tests

* tests: run mint fixture per module instead of per session

* subscription command name fix

* test per session again

* update test race conditions

* fix tests

* clean up

* tmp

* fix db issues and remove cached secrets

* fix tests

* blindly try pipeline

* remove comments

* comments
This commit is contained in:
callebtc
2024-06-25 19:20:03 +02:00
committed by GitHub
parent 75987beaf1
commit e846acf946
43 changed files with 1701 additions and 519 deletions

View File

@@ -15,7 +15,6 @@ jobs:
os: [ubuntu-latest]
python-version: ["3.10"]
poetry-version: ["1.7.1"]
mint-cache-secrets: ["false", "true"]
mint-only-deprecated: ["false", "true"]
mint-database: ["./test_data/test_mint", "postgres://cashu:cashu@localhost:5432/cashu"]
backend-wallet-class: ["FakeWallet"]
@@ -24,7 +23,6 @@ jobs:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
poetry-version: ${{ matrix.poetry-version }}
mint-cache-secrets: ${{ matrix.mint-cache-secrets }}
mint-only-deprecated: ${{ matrix.mint-only-deprecated }}
mint-database: ${{ matrix.mint-database }}
regtest:

View File

@@ -15,16 +15,13 @@ on:
os:
default: "ubuntu-latest"
type: string
mint-cache-secrets:
default: "false"
type: string
mint-only-deprecated:
default: "false"
type: string
jobs:
poetry:
name: Run (mint-cache-secrets ${{ inputs.mint-cache-secrets }}, mint-only-deprecated ${{ inputs.mint-only-deprecated }}, mint-database ${{ inputs.mint-database }})
name: Run (db ${{ inputs.mint-database }}, deprecated api ${{ inputs.mint-only-deprecated }})
runs-on: ${{ inputs.os }}
services:
postgres:
@@ -54,7 +51,6 @@ jobs:
MINT_HOST: localhost
MINT_PORT: 3337
MINT_TEST_DATABASE: ${{ inputs.mint-database }}
MINT_CACHE_SECRETS: ${{ inputs.mint-cache-secrets }}
DEBUG_MINT_ONLY_DEPRECATED: ${{ inputs.mint-only-deprecated }}
TOR: false
run: |