Skip to content

Commit

Permalink
Merge branch 'main' into add_websocket_quote_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Apr 10, 2024
2 parents f5a7075 + 19de10b commit 33cd23b
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 119 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
33 changes: 17 additions & 16 deletions cashu/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,13 @@ def htlcpreimage(self) -> Union[str, None]:
return HTLCWitness.from_witness(self.witness).preimage


class Proofs(BaseModel):
# NOTE: not used in Pydantic validation
__root__: List[Proof]


class BlindedMessage(BaseModel):
"""
Blinded message or blinded secret or "output" which is to be signed by the mint
"""

amount: int
id: Optional[
str
] # DEPRECATION: Only Optional for backwards compatibility with old clients < 0.15 for deprecated API route.
id: str
B_: str # Hex-encoded blinded message
witness: Union[str, None] = None # witnesses (used for P2PK with SIG_ALL)

Expand Down Expand Up @@ -205,11 +198,6 @@ def from_row(cls, row: Row):
)


class BlindedMessages(BaseModel):
# NOTE: not used in Pydantic validation
__root__: List[BlindedMessage] = []


# ------- LIGHTNING INVOICE -------


Expand Down Expand Up @@ -352,6 +340,19 @@ class GetInfoResponse_deprecated(BaseModel):
parameter: Optional[dict] = None


class BlindedMessage_Deprecated(BaseModel):
# Same as BlindedMessage, but without the id field
amount: int
B_: str # Hex-encoded blinded message
id: Optional[str] = None
witness: Union[str, None] = None # witnesses (used for P2PK with SIG_ALL)

@property
def p2pksigs(self) -> List[str]:
assert self.witness, "Witness missing in output"
return P2PKWitness.from_witness(self.witness).signatures


# ------- API: KEYS -------


Expand Down Expand Up @@ -418,7 +419,7 @@ class GetMintResponse_deprecated(BaseModel):


class PostMintRequest_deprecated(BaseModel):
outputs: List[BlindedMessage] = Field(
outputs: List[BlindedMessage_Deprecated] = Field(
..., max_items=settings.mint_max_request_length
)

Expand Down Expand Up @@ -465,7 +466,7 @@ class PostMeltResponse(BaseModel):
class PostMeltRequest_deprecated(BaseModel):
proofs: List[Proof] = Field(..., max_items=settings.mint_max_request_length)
pr: str = Field(..., max_length=settings.mint_max_request_length)
outputs: Union[List[BlindedMessage], None] = Field(
outputs: Union[List[BlindedMessage_Deprecated], None] = Field(
None, max_items=settings.mint_max_request_length
)

Expand Down Expand Up @@ -494,7 +495,7 @@ class PostSplitResponse(BaseModel):
class PostSplitRequest_Deprecated(BaseModel):
proofs: List[Proof] = Field(..., max_items=settings.mint_max_request_length)
amount: Optional[int] = None
outputs: List[BlindedMessage] = Field(
outputs: List[BlindedMessage_Deprecated] = Field(
..., max_items=settings.mint_max_request_length
)

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
Loading

0 comments on commit 33cd23b

Please sign in to comment.