Skip to content

Commit 3acb109

Browse files
committed
Fix Python stubs
1 parent 4d70a64 commit 3acb109

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.github/workflows/umbral-pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
run: pip install mypy ruff
125125

126126
- name: Run mypy.stubtest
127-
run: python -m mypy.stubtest umbral_pre --allowlist stubtest-allowlist.txt
127+
run: python -m mypy.stubtest umbral_pre
128128
working-directory: umbral-pre-python
129129

130130
- name: Run ruff

umbral-pre-python/stubtest-allowlist.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

umbral-pre-python/umbral_pre/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PublicKey:
6464
@final
6565
class Signer:
6666

67-
def __init__(self, secret_key: SecretKey):
67+
def __new__(cls, secret_key: SecretKey):
6868
...
6969

7070
def sign(self, message: bytes) -> Signature:
@@ -237,7 +237,7 @@ class CurvePoint:
237237
@final
238238
class Parameters:
239239

240-
def __init__(self) -> None:
240+
def __new__(cls):
241241
...
242242

243243
u: CurvePoint
@@ -246,8 +246,8 @@ class Parameters:
246246
@final
247247
class ReencryptionEvidence:
248248

249-
def __init__(
250-
self,
249+
def __new__(
250+
cls,
251251
capsule: Capsule,
252252
vcfrag: VerifiedCapsuleFrag,
253253
verifying_pk: PublicKey,

umbral-pre/src/bindings_python.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ pub struct Signer {
207207
#[pymethods]
208208
impl Signer {
209209
#[new]
210-
pub fn new(sk: &SecretKey) -> Self {
211-
umbral_pre::Signer::new(sk.backend.clone()).into()
210+
pub fn new(secret_key: &SecretKey) -> Self {
211+
umbral_pre::Signer::new(secret_key.backend.clone()).into()
212212
}
213213

214214
pub fn sign(&self, message: &[u8]) -> Signature {

0 commit comments

Comments
 (0)