Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Apr 10, 2024
1 parent b0caca9 commit 8db20da
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ This command runs the mint on your local computer. Skip this step if you want to
## Docker

```
docker run -d -p 3338:3338 --name nutshell -e MINT_BACKEND_BOLT11_SAT=FakeWallet -e MINT_LISTEN_HOST=0.0.0.0 -e MINT_LISTEN_PORT=3338 -e MINT_PRIVATE_KEY=TEST_PRIVATE_KEY cashubtc/nutshell:0.15.2 poetry run mint
docker run -d -p 3338:3338 --name nutshell -e MINT_BACKEND_BOLT11_SAT=FakeWallet -e MINT_LISTEN_HOST=0.0.0.0 -e MINT_LISTEN_PORT=3338 -e MINT_PRIVATE_KEY=TEST_PRIVATE_KEY cashubtc/nutshell:0.15.3 poetry run mint
```

## From this repository
Expand Down
4 changes: 2 additions & 2 deletions cashu/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

env = Env()

VERSION = "0.15.2"
VERSION = "0.15.3"


def find_env_file():
Expand Down Expand Up @@ -58,7 +58,7 @@ class MintSettings(CashuSettings):

mint_database: str = Field(default="data/mint")
mint_test_database: str = Field(default="test_data/test_mint")
mint_duplicate_keysets: bool = Field(
mint_duplicate_old_keysets: bool = Field(
default=True,
title="Duplicate keysets",
description=(
Expand Down
7 changes: 4 additions & 3 deletions cashu/mint/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,11 @@ async def init_keysets(
# BEGIN BACKWARDS COMPATIBILITY < 0.15.0
# we duplicate new keysets and compute their old keyset id, and
# we duplicate old keysets and compute their new keyset id
if (
duplicate_keysets is None and settings.mint_duplicate_keysets
) or duplicate_keysets:
if settings.mint_duplicate_old_keysets or duplicate_keysets:
for _, keyset in copy.copy(self.keysets).items():
if keyset.version_tuple >= (0, 15, 3) and not duplicate_keysets:
# we do not duplicate keysets from version 0.15.3 and above if not forced by duplicate_keysets
continue
keyset_copy = copy.copy(keyset)
if not keyset_copy.public_keys:
raise KeysetError("no public keys for this keyset")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cashu"
version = "0.15.2"
version = "0.15.3"
description = "Ecash wallet and mint"
authors = ["calle <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setuptools.setup(
name="cashu",
version="0.15.2",
version="0.15.3",
description="Ecash wallet and mint",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_mint_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def test_init_keysets_with_duplicates(ledger: Ledger):
@pytest.mark.asyncio
async def test_init_keysets_with_duplicates_via_settings(ledger: Ledger):
ledger.keysets = {}
settings.mint_duplicate_keysets = True
settings.mint_duplicate_old_keysets = True
await ledger.init_keysets()
assert len(ledger.keysets) == 2

Expand All @@ -80,7 +80,7 @@ async def test_init_keysets_without_duplicates(ledger: Ledger):
@pytest.mark.asyncio
async def test_init_keysets_without_duplicates_via_settings(ledger: Ledger):
ledger.keysets = {}
settings.mint_duplicate_keysets = False
settings.mint_duplicate_old_keysets = False
await ledger.init_keysets()
assert len(ledger.keysets) == 1

Expand Down
5 changes: 1 addition & 4 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,7 @@ async def test_token_state(wallet1: Wallet):
@pytest.mark.asyncio
async def test_load_mint_keys_specific_keyset(wallet1: Wallet):
await wallet1._load_mint_keys()
if settings.debug_mint_only_deprecated:
assert list(wallet1.keysets.keys()) == ["eGnEWtdJ0PIM"]
else:
assert list(wallet1.keysets.keys()) == ["009a1f293253e41e", "eGnEWtdJ0PIM"]
assert list(wallet1.keysets.keys()) == ["009a1f293253e41e", "eGnEWtdJ0PIM"]
await wallet1._load_mint_keys(keyset_id=wallet1.keyset_id)
await wallet1._load_mint_keys(keyset_id="009a1f293253e41e")
# expect deprecated keyset id to be present
Expand Down

0 comments on commit 8db20da

Please sign in to comment.