Skip to content

Commit

Permalink
Support pickling ECPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Mar 9, 2021
1 parent f3abd0e commit ce4110b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions python-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ PYBIND11_MODULE(neo3crypto, m) {
.def("__len__", [](ECPoint& self) {
if (self.is_infinity()) return 1;
return static_cast<int>(self.value_compressed.size());
})
.def("__deepcopy__", [](ECPoint& self, py::object& memodict) {
return ECPoint(self.value_compressed, self.curve, false);
});

m.def("sign", [](const py::bytes& private_key, const py::bytes& message, ECCCURVE curve, py::function hash_func) {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def build_extension(self, ext):
description="Native crypto functions for the NEO 3 Blockchain",
long_description=readme,
long_description_content_type="text/x-rst",
version='0.1',
version='0.2',
license='MIT',
url='https://github.com/CityOfZion/neo3crypto',
classifiers=[
Expand Down

0 comments on commit ce4110b

Please sign in to comment.