@@ -108,9 +108,7 @@ def test_v1_recovers_signer_for_round_trip_signature():
108108 timestamp = int (time .time ())
109109 signature = _sign_v1 (signer , public_key , app_id , timestamp )
110110
111- recovered = verify_env_encrypt_public_key (
112- public_key , signature , app_id , timestamp
113- )
111+ recovered = verify_env_encrypt_public_key (public_key , signature , app_id , timestamp )
114112 assert recovered == "0x" + signer .public_key .to_compressed_bytes ().hex ()
115113
116114
@@ -122,10 +120,7 @@ def test_v1_rejects_expired_timestamp():
122120 signature = _sign_v1 (signer , public_key , app_id , timestamp )
123121
124122 assert (
125- verify_env_encrypt_public_key (
126- public_key , signature , app_id , timestamp
127- )
128- is None
123+ verify_env_encrypt_public_key (public_key , signature , app_id , timestamp ) is None
129124 )
130125
131126
@@ -137,10 +132,7 @@ def test_v1_rejects_future_timestamp_beyond_skew():
137132 signature = _sign_v1 (signer , public_key , app_id , timestamp )
138133
139134 assert (
140- verify_env_encrypt_public_key (
141- public_key , signature , app_id , timestamp
142- )
143- is None
135+ verify_env_encrypt_public_key (public_key , signature , app_id , timestamp ) is None
144136 )
145137
146138
@@ -151,9 +143,7 @@ def test_v1_accepts_small_future_skew():
151143 timestamp = int (time .time ()) + 30 # within the 60s tolerance
152144 signature = _sign_v1 (signer , public_key , app_id , timestamp )
153145
154- recovered = verify_env_encrypt_public_key (
155- public_key , signature , app_id , timestamp
156- )
146+ recovered = verify_env_encrypt_public_key (public_key , signature , app_id , timestamp )
157147 assert recovered == "0x" + signer .public_key .to_compressed_bytes ().hex ()
158148
159149
@@ -165,10 +155,7 @@ def test_v1_respects_custom_max_age():
165155 signature = _sign_v1 (signer , public_key , app_id , timestamp )
166156
167157 assert (
168- verify_env_encrypt_public_key (
169- public_key , signature , app_id , timestamp
170- )
171- is None
158+ verify_env_encrypt_public_key (public_key , signature , app_id , timestamp ) is None
172159 )
173160 recovered = verify_env_encrypt_public_key (
174161 public_key , signature , app_id , timestamp , max_age_seconds = 1000
@@ -193,9 +180,7 @@ def test_v1_rejects_malformed_app_id():
193180 # Sign with the well-formed app_id but verify with a malformed one.
194181 signature = _sign_v1 (signer , public_key , "ab" * 20 , timestamp )
195182 assert (
196- verify_env_encrypt_public_key (
197- public_key , signature , "not-hex" , timestamp
198- )
183+ verify_env_encrypt_public_key (public_key , signature , "not-hex" , timestamp )
199184 is None
200185 )
201186
0 commit comments