Refactor: P2PKSecret (#323)

* port changes from dleq branch

* adjust tests

* fix tag serialization

* refactor p2pk and secrets into a new Protocol class

* clean up code

* refactor p2pk types from base

* test second refund pubkey
This commit is contained in:
callebtc
2023-09-21 14:58:42 +02:00
committed by GitHub
parent 5e001548fe
commit a1802b2d81
9 changed files with 727 additions and 609 deletions

16
cashu/wallet/protocols.py Normal file
View File

@@ -0,0 +1,16 @@
from typing import Protocol
from ..core.crypto.secp import PrivateKey
from ..core.db import Database
class SupportsPrivateKey(Protocol):
private_key: PrivateKey
class SupportsDb(Protocol):
db: Database
class SupportsKeysets(Protocol):
keyset_id: str