-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor key types #1829
Refactor key types #1829
Conversation
8bc8463
to
26d68f9
Compare
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
26d68f9
to
2b86cd5
Compare
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
store_->generateEd25519Keypair(KeyTypes::GRANDPA, *dev).value(); | ||
store_->generateSr25519Keypair(KeyTypes::BABE, *dev).value(); | ||
store_->generateSr25519Keypair(KeyTypes::IM_ONLINE, *dev).value(); | ||
store_->generateSr25519Keypair(KeyTypes::AUTHORITY_DISCOVERY, *dev) | ||
.value(); | ||
store_->generateSr25519Keypair(KeyTypes::KEY_TYPE_ASGN, *dev).value(); | ||
store_->generateSr25519Keypair(KeyTypes::KEY_TYPE_PARA, *dev).value(); | ||
store_->generateEcdsaKeypair(KeyTypes::BEEFY, *dev).value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be done with a list and a loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would need 3 loops, because of interface, for each crypto type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it might, but it generated different crypto (Ed*, Sr*, Ecdsa) and different purposes. Simplifying with cycle does not seem simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are five sr keys in a row, for example, this can be refactored to a loop. It's not necessary to make everything one loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
|
||
/** | ||
* Types are 32bit integers, which represent encoded 4-char strings | ||
* Makes 32bit integer uin which represent encoded 4-char strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'uin' seems to be a typo.
Referenced issues
no specified
Description of the Change
Transparent conversion KeyType <-> KeyTypeId.
Literals for key (for human readability)
Benefits
Possible Drawbacks
Usage Examples or Tests
Alternate Designs