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

Stake pool registry format updates #1078

Merged
merged 3 commits into from
Dec 4, 2019

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Nov 28, 2019

Relates to #1076

Overview

This starts updating the types and tests for the new stake pool registry format, which is indexed by pool owner(s) rather than pool id.

{ ticker = unsafeFromText "TICK"
, homepage = "https://12345"
, owner = unsafeFromText "ed25519_pk1z4vh8gva25w07x8574uujuveu8gz43fu6qfln3t4prcavrvcphjsk0pdqs"
, name = "Pooley Mc-Poolface"
Copy link
Member

Choose a reason for hiding this comment

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

[question]

What do you think about testing some weird character sets in the name and/or description? Japanese and Chinese Kanjis, Cyrilic, Emojis and all sort of non-latin characters ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a good idea and we should do this through the QuickCheck generators.
My approach is to "ground" the tests using a fairly simple golden example, which is an actual zip file produced with the registry validator tool*.
Then attempt to test all the corner cases with randomly generated data.

(* however we need to wait for an update of the registry tool before we can download a proper example zip - the current one in this PR is synthetic).

@KtorZ KtorZ force-pushed the rvl/1064/get-stake-pool-metadata branch from 3f782ae to 184a2d8 Compare November 28, 2019 10:02
@rvl rvl force-pushed the rvl/1076/registry-format-updates branch from 9260022 to 413127b Compare November 29, 2019 00:29
@rvl rvl changed the base branch from rvl/1064/get-stake-pool-metadata to master November 29, 2019 00:30
@rvl rvl force-pushed the rvl/1076/registry-format-updates branch from 50fb532 to 137f192 Compare December 2, 2019 04:16
parseJSON = parseJSON >=> either (fail . show . ShowFmt) pure . fromText

instance ToJSON PoolOwner where
toJSON = toJSON . toText
Copy link
Member

Choose a reason for hiding this comment

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

[question]

It now seems a bit inconsistent that we enforce some quite strong validations on the PoolOwner format, whereas we still do not validate other fields (like addresses) for instance. So, what is the rationale here 🤔 ? Shall we also enforce stricter validation for addresses there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The PoolOwner is also going to be extracted from the registration certificate. It's no longer just a field of StakePoolMetadata, so that's why.

Copy link
Member

Choose a reason for hiding this comment

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

Got it 👍

Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

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

LGTM. But I wonder if we shouldn't be more consistent regarding the metadata validation?

@rvl
Copy link
Contributor Author

rvl commented Dec 4, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 4, 2019
1078: Stake pool registry format updates r=rvl a=rvl

Relates to #1076

# Overview

This starts updating the types and tests for the new stake pool registry format, which is indexed by pool owner(s) rather than pool id.


Co-authored-by: Rodney Lorrimar <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 4, 2019

Build succeeded

@iohk-bors iohk-bors bot merged commit 137f192 into master Dec 4, 2019
@KtorZ KtorZ deleted the rvl/1076/registry-format-updates branch December 4, 2019 10:10
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