From 20b99ee792ba7c044b71cb7decd19967e72ed855 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sat, 14 Jan 2023 13:46:33 +0100 Subject: [PATCH] bumop to 0.8 --- README.md | 2 +- cashu/core/base.py | 6 +++--- cashu/core/settings.py | 2 +- cashu/wallet/wallet.py | 13 ++++++++----- pyproject.toml | 2 +- setup.py | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2f40cc3..490828a 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ cashu info Returns: ```bash -Version: 0.7.0 +Version: 0.8 Debug: False Cashu dir: /home/user/.cashu Wallet: wallet diff --git a/cashu/core/base.py b/cashu/core/base.py index 5288b0c..ec7022d 100644 --- a/cashu/core/base.py +++ b/cashu/core/base.py @@ -16,7 +16,7 @@ class P2SHScript(BaseModel): class Proof(BaseModel): id: Union[ None, str - ] = "" # NOTE: None for backwards compatibility of old clients < 0.3 + ] = "" # NOTE: None for backwards compatibility for old clients that do not include the keyset id < 0.3 amount: int = 0 secret: str = "" C: str = "" @@ -78,7 +78,7 @@ class BlindedMessages(BaseModel): class PostMintResponseLegacy(BaseModel): - # NOTE: Backwards compability for < 0.7.1 where we used a simple list and not a key-value dictionary + # NOTE: Backwards compability for < 0.8 where we used a simple list and not a key-value dictionary __root__: List[BlindedSignature] = [] @@ -101,7 +101,7 @@ class SplitRequest(BaseModel): amount: int output_data: Union[ BlindedMessages, None - ] = None # backwards compatibility with clients < v0.2.2 + ] = None # backwards compatibility with clients that called this output_data and not outputs < v0.2.2 outputs: Union[BlindedMessages, None] = None def __init__(self, **data): diff --git a/cashu/core/settings.py b/cashu/core/settings.py index e22b118..a25ae87 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -57,4 +57,4 @@ NOSTR_PRIVATE_KEY = env.str("NOSTR_PRIVATE_KEY", default=None) NOSTR_RELAYS = env.list("NOSTR_RELAYS", default=["wss://nostr-pub.wellorder.net"]) MAX_ORDER = 64 -VERSION = "0.7.0" +VERSION = "0.8" diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index ca083e2..4f28508 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -262,12 +262,15 @@ class LedgerAPI: reponse_dict = resp.json() self.raise_on_error(reponse_dict) try: - # backwards compatibility: parse promises < 0.7.1 with no "promises" field - promises = PostMintResponseLegacy.parse_obj(reponse_dict) - return self._construct_proofs(promises, secrets, rs) + # backwards compatibility: parse promises < 0.8 with no "promises" field + promises = PostMintResponseLegacy.parse_obj(reponse_dict).__root__ + logger.warning( + "Parsing token with no promises field. Please upgrade mint to 0.8" + ) except: - promises = PostMintResponse.parse_obj(reponse_dict) - return self._construct_proofs(promises.promises, secrets, rs) + promises = PostMintResponse.parse_obj(reponse_dict).promises + + return self._construct_proofs(promises, secrets, rs) async def split(self, proofs, amount, scnd_secret: Optional[str] = None): """Consume proofs and create new promises based on amount split. diff --git a/pyproject.toml b/pyproject.toml index 8745a1b..b33cc7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cashu" -version = "0.7.0" +version = "0.8" description = "Ecash wallet and mint." authors = ["calle "] license = "MIT" diff --git a/setup.py b/setup.py index 20093d0..267f57f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ entry_points = {"console_scripts": ["cashu = cashu.wallet.cli:cli"]} setuptools.setup( name="cashu", - version="0.7.0", + version="0.8", description="Ecash wallet and mint with Bitcoin Lightning support", long_description=long_description, long_description_content_type="text/markdown",