mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-17 12:37:49 +00:00
Add Python binding for loading trusted setup from filename
This commit is contained in:
parent
2628661be5
commit
90eadda3cb
@ -55,6 +55,21 @@
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(SWIGPYTHON)
|
||||||
|
%typemap(in) FILE* {
|
||||||
|
if (PyUnicode_Check($input)) {
|
||||||
|
$1 = fopen(PyUnicode_AsUTF8($input), "r");
|
||||||
|
if ($1 == NULL) {
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "failed to load file");
|
||||||
|
SWIG_fail;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "expected bytes (utf-8 encoded file path)");
|
||||||
|
SWIG_fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
%array_class(scalar_t, scalars)
|
%array_class(scalar_t, scalars)
|
||||||
%array_class(BLSFieldElement, BLSFieldElements)
|
%array_class(BLSFieldElement, BLSFieldElements)
|
||||||
%pointer_class(PolynomialEvalForm, PolynomialEvalFormPtr)
|
%pointer_class(PolynomialEvalForm, PolynomialEvalFormPtr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user