diff --git a/config.json b/config.json index 4c02cb2..171b83f 100644 --- a/config.json +++ b/config.json @@ -6,7 +6,7 @@ "short_description": "Accept Bitcoin donations, with optional messages attached!", "description": "", "tile": "/tipjar/static/image/tipjar.png", - "min_lnbits_version": "1.0.0", + "min_lnbits_version": "1.7.0-rc1", "contributors": [ { "name": "Fittiboy", @@ -28,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", 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/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/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 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" },