HeliosLang / compiler

Helios is a DSL for writing Cardano smart contracts. This library lets you compile Helios scripts and build Cardano transactions.
https://www.hyperion-bt.org/helios-book
BSD 3-Clause "New" or "Revised" License
142 stars 31 forks source link

[Enhancement] add getters for Signature pubKey and/or pubKeyHash #82

Closed rjharmon closed 1 year ago

rjharmon commented 1 year ago

I'm having a helios Signature, which I want to correlate to an Address, based on their pub-key-hash. I can see the .pubKeyHash in the interface to the address. But the Signature object, though it has a private member for the pubKey, doesn't make it available with a public (documented) accessor. I can get to it through .dump(), but that's not documented.

Seems like there should be getters for pubKey and/or pubKeyHash

christianschmitz commented 1 year ago

v0.13.38 of the Helios library implements pubKey and pubKeyHash getters for the Signature class.

Note: signature.pubKey returns a PubKey instance which in turn wrap the raw bytes, so you can do signature.pubKey.bytes to get the bytes, or signature.pubKey.hex to get the hexadecimal representation.

christianschmitz commented 1 year ago

Good call!

rjharmon commented 1 year ago

thank you!