Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python load from system wide install lib #386

Merged
merged 3 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
base58~=2.1.1
betterproto~=2.0.0b4
grpcio-tools~=1.43.0
grpclib~=0.4.2
grpcio-tools~=1.44.0
grpclib~=0.4.3rc2
requests~=2.27.1
setuptools~=60.5.0
setuptools~=60.10.0
black
flake8
pytest
Expand Down
4 changes: 3 additions & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ python_requires = >=3.7
install_requires =
protobuf>=3.17.3
betterproto>=2.0.0b4
requests>=2.22.0
requests>=2.27.1

[options.packages.find]
exclude = tests
Expand All @@ -47,3 +47,5 @@ libs/windows = libs/windows/okapi.dll
libs/linux = libs/linux/libokapi.so
libs/macos = libs/macos/libokapi.dylib
# TODO - support ARM?
# libs/linux-aarch64 = libs/linux-aarch64/libokapi.so
# libs/linux-armv7 = libs/linux-armv7/libokapi.so
18 changes: 12 additions & 6 deletions python/tests/okapi_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from trinsicokapi.wrapper import DIDKey
from trinsicokapi import didkey
from trinsicokapi.proto.okapi.keys.v1 import GenerateKeyRequest, KeyType

request = GenerateKeyRequest()
request.key_type = KeyType.Ed25519
request.seed = bytes(bytearray([1, 2, 3]))

key_response = DIDKey.generate(request)
print(key_response.key)
def run():
request = GenerateKeyRequest()
request.key_type = KeyType.KEY_TYPE_ED25519
request.seed = bytes(bytearray([1, 2, 3]))

key_response = didkey.generate(request)
print(key_response.key)


if __name__ == "__main__":
run()
4 changes: 4 additions & 0 deletions python/tests/test_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import base58

from tests import okapi_demo
from trinsicokapi import didkey
from trinsicokapi.proto.okapi.keys.v1 import (
GenerateKeyRequest,
Expand Down Expand Up @@ -46,6 +47,9 @@ def test_resolve_key(self):
response = didkey.resolve(ResolveRequest(did=key))
self.assertIsNotNone(response)

def test_okapi_demo(self):
okapi_demo.run()

def assert_valid_key_generated(self, response, crv="Ed25519") -> bytes:
self.assertIsNotNone(response)
self.assertIsNotNone(response.key[0])
Expand Down