Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Wallets: validate wallet YAML file using JSON Schema #1600
Conversation
| + - desktop | ||
| + properties: | ||
| + desktop: | ||
| + description: Wallets than run on desktop operating systems |
|
Concept ACK: This is the best present a wallet maintainer could wish for. I spend quite a bit of time reviewing the syntax of submissions and, more often than not, I have to have more than one offline cycle with submitters to fix the YAML. In addition, we finally have a schema to refer submitters to so that they have a better chance of getting it right in the first place. I'm excited to no longer have to check string lengths myself by hand. Scoring change in choose-your-wallet.html: ACK wallets.yaml schema: ACK (with slight typo comment above) Thanks very much @harding PR: utACK |
|
@crwatkins your comment made me realize that the initial commit doesn't limit the length of the main string, the wallet description, because that's pulled from the translation YAML (e.g. Instead, I've pushed a commit that causes the template compile to fail if that field is too long, as well as a setting on the wallets page that lets us adjust it. Here's an example of the error produced:
I set the max to 418 characters, which is the longest description we have in any translation at present (BitGo in French). This is rather a bit longer than we've encouraged for English, I believe, but:
For testing this newest commit, I diffed the resultant HTML between this commit and the previous commit and verified there were only whitespace changes. In the new commit, I also fixed the typo that @crwatkins identified (thanks!). |
|
utACK |
wbnns
added
the
Merge Scheduled
label
May 19, 2017
wbnns
self-assigned this
May 19, 2017
|
Unless others object, this will be merged on Saturday, May 20th. Thanks guys. |
harding commentedMay 16, 2017
As mentioned in #1592, I wanted to validate the 1,100-line wallet YAML to ensure consistency between entries. I also wanted to better document the entry format since even I sometimes wonder which option does what.
This PR validates the wallet entries against a pretty strict schema. It's not perfect---I've put in some TODOs where we could be more strict with changes to the current format---but I think it's better than nothing.
Some examples:
In #1592, I discovered Electrum declared an
androidplatform without declaring a defaultmobileplatform, so it wasn't being counted as a mobile wallet. If that problem hadn't already been fixed, the schema would've caught it:In this PR, I've fixed two issues. The first was that Copay declared "Linux" as a supported OS on its Mobile platform entry. I checked #888 where we added Copay and that was never discussed, so I think it's just a copy/paste typo. The schema reported that:
The other issue was that ArcBit was missing the
privacynetworkfield on just one of its supported platforms (Android). Again, I think this was a typo because I don't see it discussed in the PR where ArcBit was added, #1459In addition to the validation, this PR also links to the schema from the documentation for adding a new wallet.