Use TryFrom instead of From+panic for Builtin#11140
Conversation
|
It looks like @rokob hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
|
[clabot:check] |
|
It looks like @rokob signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
We are not using rustfmt that is the reason why you get errors I guess and note that we are using tabs instead of spaces, please use the Officially, we use the latest stable compiler |
niklasad1
left a comment
There was a problem hiding this comment.
Hi, thanks for your contribution.
It definitely is on the right track with some formating nits otherwise it looks good but it needs to be merged/rebased with master.
dvdplm
left a comment
There was a problem hiding this comment.
lgtm, and thank you for the PR!
b500fc7 to
f949bd1
Compare
f949bd1 to
9601f54
Compare
|
I got rid of the extraneous lines that were just formatting noise and not part of this actual change. |
Fixes #11134
Currently there is a panic if a bad builtin name is entered in the chain spec. This PR replaces that panic by returning an Error instead of panicking in that situation and then using TryFrom instead of From to create the Builder type.
I'm not sure what compiler version you are using as I got errors and a ton of change from running rustfmt, so I finagled it to run over just my changes but there might still be some stylistic issues.
Also, the code is a bit convoluted but I wanted to put this up to make sure this is what you are looking for before cleaning it up a bit.