From 09e44f18e522eb655f13701be7172ac40c342704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 13 Jul 2026 09:53:17 +0200 Subject: [PATCH] test: fix revolut test timestamp exceeded (#4054) --- tests/unit/test_fiat_providers.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_fiat_providers.py b/tests/unit/test_fiat_providers.py index 681761449..d027e557a 100644 --- a/tests/unit/test_fiat_providers.py +++ b/tests/unit/test_fiat_providers.py @@ -1433,7 +1433,7 @@ def test_check_revolut_signature_multiple_v1_headers(): check_revolut_signature(payload, sig_header, timestamp, secret) -def test_check_revolut_signature_docs_vector(): +def test_check_revolut_signature_docs_vector(mocker: MockerFixture): payload = ( b'{"data":{"id":"645a7696-22f3-aa47-9c74-cbae0449cc46",' b'"new_state":"completed","old_state":"pending",' @@ -1445,9 +1445,14 @@ def test_check_revolut_signature_docs_vector(): secret = "wsk_r59a4HfWVAKycbCaNO1RvgCJec02gRd8" sig = "v1=bca326fb378d0da7f7c490ad584a8106bab9723d8d9cdd0d50b4c5b3be3837c0" - check_revolut_signature( - payload, sig, timestamp, secret, tolerance_seconds=100000000 + # This is a fixed vector straight from Revolut's docs, so its timestamp is + # necessarily in the past. Freeze time to it instead of growing + # tolerance_seconds indefinitely as real time marches on. + mocker.patch( + "lnbits.core.services.fiat_providers.time.time", + return_value=int(timestamp) / 1000, ) + check_revolut_signature(payload, sig, timestamp, secret) @pytest.mark.anyio