From e351ffc30f210a20841509a4799cc14c9eee7600 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 30 Oct 2026 16:20:58 +0200 Subject: [PATCH 1/3] fix: accept numeric tip amounts with Pydantic 2 --- models.py | 2 +- tests/test_models.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/test_models.py diff --git a/models.py b/models.py index 9922fe4..45e282b 100644 --- a/models.py +++ b/models.py @@ -23,7 +23,7 @@ class Tip(BaseModel): class CreateTips(BaseModel): name: str - sats: str + sats: int tipjar: str message: str diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 0000000..862bfc9 --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,12 @@ +import pytest + +from ..models import CreateTips + + +@pytest.mark.parametrize("sats", [21, "21"]) +def test_create_tip_accepts_numeric_and_string_amounts(sats): + tip = CreateTips.model_validate( + {"name": "Hal", "sats": sats, "tipjar": "test-tipjar", "message": "Thanks"} + ) + + assert tip.sats == 21 From 463bb45e7c1e835c5e1b1d0f172650320a1b2603 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 30 Oct 2026 16:26:40 +0200 Subject: [PATCH 2/3] chore: version bump --- config.json | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index d99b3de..cd45275 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "id": "tipjar", "name": "Tip Jar", - "version": "1.1.0", + "version": "1.1.1", "short_description": "Accept Bitcoin donations, with messages attached!", "tile": "/tipjar/static/image/tipjar.png", "contributors": ["Fittiboy"], diff --git a/pyproject.toml b/pyproject.toml index 536f163..86e7480 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lnbits-tipjar" -version = "1.1.0" +version = "1.1.1" requires-python = ">=3.10,<3.14" description = "LNbits, free and open-source Lightning wallet and accounts system." authors = [{ name = "Alan Bits", email = "alan@lnbits.com" }] diff --git a/uv.lock b/uv.lock index b4ff83a..3a92fbc 100644 --- a/uv.lock +++ b/uv.lock @@ -1182,7 +1182,7 @@ wheels = [ [[package]] name = "lnbits-tipjar" -version = "1.1.0" +version = "1.1.1" source = { virtual = "." } dependencies = [ { name = "lnbits" }, From fe71ba06ddd58db1e3a2c00932984a9bea0b4ff6 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 30 Oct 2026 17:04:10 +0200 Subject: [PATCH 3/3] fix: remove duplicate extension metadata keys --- config.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/config.json b/config.json index 4f8b877..171b83f 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,6 @@ "id": "tipjar", "version": "1.1.1", "name": "Tip Jar", - "version": "1.1.1", "repo": "https://github.com/lnbits/tipjar", "short_description": "Accept Bitcoin donations, with optional messages attached!", "description": "", @@ -29,7 +28,6 @@ "uri": "https://raw.githubusercontent.com/lnbits/tipjar/main/static/image/4.png" } ], - "min_lnbits_version": "1.7.0-rc1", "description_md": "https://raw.githubusercontent.com/lnbits/tipjar/main/description.md", "terms_and_conditions_md": "https://raw.githubusercontent.com/lnbits/tipjar/main/toc.md", "license": "MIT",