aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
3 stars 4 forks source link

Add sign_raw() #50

Closed MHHukiewitz closed 1 year ago

MHHukiewitz commented 1 year ago

BaseAccount.sign_raw() accepts raw bytes and outputs a signature as a string in the preferred encoding.

This allows signing of arbitrary data besides Aleph messages, making it a useful tool in dApp development.

MHHukiewitz commented 1 year ago

Relies on #49

hoh commented 1 year ago

The diff looks good to me. Do we have any test on the new sign_raw method ?

hoh commented 1 year ago

Relies on #49

Squashed and pushed on master. Can you rebase on it ?

hoh commented 1 year ago

As discussed, sign_raw should return Bytes. The rest looks good to me.

MHHukiewitz commented 1 year ago

After suggestion by @hoh I changed the signature of sign_raw(buffer: bytes) -> str: to sign_raw(buffer: bytes) -> bytes:.

As this involves a bit more invasive refactoring, I decided that it would only make sense to add more unit tests, especially to the non-existent Cosmos and Substrate (Polkadot) tests.