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

encode shelley addresses with their final encoding (bech32 / base58) #1746

Merged
merged 8 commits into from
Jun 15, 2020

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Jun 12, 2020

Issue Number

N/A

Overview

Still, I kept support for base16 when decoding addresses, so that we don't necessarily break compatibility with cardano-cli.

Comments

@KtorZ KtorZ requested a review from Anviking June 12, 2020 08:50
@KtorZ KtorZ self-assigned this Jun 12, 2020
@KtorZ KtorZ added the Feature Mark a PR as adding a new feature, for auto-generated CHANGELOG label Jun 12, 2020
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

👍

_decodeAddress x = validateWithLedger =<< W.Address <$> fromHex x
_encodeAddress :: W.Address -> Text
_encodeAddress (W.Address bytes) =
if isJust (CBOR.deserialiseCbor CBOR.decodeAddressPayload bytes)
Copy link
Member

Choose a reason for hiding this comment

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

A golden here would be nice; I don't think a mistake here would be caught

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. I intended to add some tests, hence the draft 👍

@KtorZ KtorZ marked this pull request as ready for review June 15, 2020 10:20
@KtorZ KtorZ force-pushed the KtorZ/shelley-address-encoding branch from 443d15b to 09e3fa1 Compare June 15, 2020 10:31
@KtorZ
Copy link
Member Author

KtorZ commented Jun 15, 2020

bors try

iohk-bors bot added a commit that referenced this pull request Jun 15, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 15, 2020

try

Build failed

@KtorZ
Copy link
Member Author

KtorZ commented Jun 15, 2020

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 15, 2020

@iohk-bors iohk-bors bot merged commit 7e05e48 into master Jun 15, 2020
@iohk-bors iohk-bors bot deleted the KtorZ/shelley-address-encoding branch June 15, 2020 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Mark a PR as adding a new feature, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants