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

Implement Cardano.Api.DeserialiseAnyOf #4639

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

Jimbo4350
Copy link
Contributor

@Jimbo4350 Jimbo4350 commented Nov 16, 2022

Move verification key related serialization to cardano-api and expose a simpler interface.

@Jimbo4350 Jimbo4350 force-pushed the jordan/create-deserialise-any-of branch 2 times, most recently from 4fd4eee to d744c0c Compare November 16, 2022 19:39
@Jimbo4350 Jimbo4350 marked this pull request as ready for review November 16, 2022 19:40
Comment on lines +261 to +263
renderSomeAddressVerificationKey (AGenesisDelegateExtendedVerificationKey vk) =
-- TODO: We could implement a CastVerificationKeyRole GenesisDelegateKey PaymentKey
-- if we want to avoid casting twice.
let genDelegKey = (castVerificationKey vk :: VerificationKey GenesisDelegateKey)
stakePoolKey = castVerificationKey genDelegKey :: VerificationKey StakePoolKey
in serialiseToBech32 stakePoolKey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has the comment become outdated? I don't think you want CastVerificationKeyRole GenesisDelegateKey PaymentKey. It looks to me like you want CastVerificationKeyRole GenesisKey PaymentKey and CastVerificationKeyRole GenesisDelegateKey StatePoolKey

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They all use the same crypto. I could also implement a SerialiseAsBech32 (VerificationKey GenesisDelegateKey) instance as another option.

@Jimbo4350 Jimbo4350 force-pushed the jordan/create-deserialise-any-of branch from d744c0c to 031e0d5 Compare November 17, 2022 16:40
@Jimbo4350
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 17, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit e5b82e6 into master Nov 17, 2022
@iohk-bors iohk-bors bot deleted the jordan/create-deserialise-any-of branch November 17, 2022 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants