You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some tests need to compare PublicKeys from the two crates mentioned above (example).
It seems like there’s no straightforward way for the conversion since the only way to generate a workspaces::types::PublicKey from data is Deserialize. Which leads to this inefficient and awkward conversion.
Maybe there’s a more efficient and elegant conversion which I’ve been missing? If not, it would be great if such a conversion could be supported.
workspaces::types::PublicKey is just a wrapper around near-crypto::PublicKey. So for workspaces it might be possible to support the conversion via:
Get the bytes of a near_sdk::PublicKey (as_bytes()).
Convert the bytes to near_crypto::PublicKey (e.g. via this function) and then wrap it in workspaces::types::PublicKey.
The text was updated successfully, but these errors were encountered:
Some tests need to compare
PublicKey
s from the two crates mentioned above (example).It seems like there’s no straightforward way for the conversion since the only way to generate a
workspaces::types::PublicKey
from data is Deserialize. Which leads to this inefficient and awkward conversion.Maybe there’s a more efficient and elegant conversion which I’ve been missing? If not, it would be great if such a conversion could be supported.
workspaces::types::PublicKey
is just a wrapper aroundnear-crypto::PublicKey
. So forworkspaces
it might be possible to support the conversion via:near_sdk::PublicKey
(as_bytes()).near_crypto::PublicKey
(e.g. via this function) and then wrap it inworkspaces::types::PublicKey
.The text was updated successfully, but these errors were encountered: