cmd/geth: standardize the action of importing bls account#2020
Merged
brilliant-lx merged 4 commits intobnb-chain:developfrom Dec 5, 2023
buddh0:improve_bls_account_import
Merged
cmd/geth: standardize the action of importing bls account#2020brilliant-lx merged 4 commits intobnb-chain:developfrom buddh0:improve_bls_account_import
brilliant-lx merged 4 commits intobnb-chain:developfrom
buddh0:improve_bls_account_import
Conversation
keefel
reviewed
Nov 30, 2023
keefel
reviewed
Nov 30, 2023
keefel
reviewed
Nov 30, 2023
brilliant-lx
approved these changes
Dec 5, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cmd/geth: standardize the action of importing bls account
Rationale
there are 3 issues when using
geth bls accountno trim '\r\n' when read password from file.
when use vim or
echocommand to write password into a file, a '\r' or '\n' will be added automaticlythis PR will do the trim by following
geth accountsome related flags have not set field
Category, so they will not be displayed in help infothis PR fix it
putting a bls private key into wallet viewed as a
newactiononly putting a keystore file into wallet will be viewed as a
importactionbut
geth accountcan put a private key into wallet by aimportactionand others, in metamask, the import action both accept a file including a private key or a keystore file
so in this PR, putting a bls private key into wallet will be viewed as a
importaction instead of anewaction.when new a bls account, use the bls wallet password to encrypt it into a keystore file
so no need a
blsaccountpasswordany more, bring much convenientwhen import a bls account with a keystore file, rename
blsaccountpasswordtoimportedaccountpassword,to reduce ambiguity.
to demostrate the usage of
geth bls account, a shell is provided,and using it to test these above features is easily
Example
run

bash bls-account-usage-demo.shin bsc/cmd/geth/testdataChanges
Notable changes: