test: fix revolut test timestamp exceeded (#4054)

This commit is contained in:
dni ⚡
2026-07-13 10:53:17 +03:00
committed by GitHub
parent cabb58f8fe
commit 09e44f18e5
+8 -3
View File
@@ -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