Create validator wallet#481
Conversation
| "Create a new wallet and print its mnemonic; optionally save as password-protected JSON (recommended) or PEM (not recommended)", | ||
| ) | ||
| sub.add_argument( | ||
| "--validator-wallet", |
There was a problem hiding this comment.
I wonder whether we should have a separate sub-command, instead.
E.g.
mxpy wallet ... (for user wallets)
mxpy validator-wallet ...
Especially since other sub-sub-commands of mxpy wallet do not make sense for this kind of wallets (e.g. bech32, convert etc.). Actually, some convert functionality could be useful (e.g. PEM to raw hex), but, overall, maybe we can have them separately.
💭
There was a problem hiding this comment.
Moved to a separate sub-command
|
|
||
| def sign_message_by_validator(message: str, validator: ValidatorSigner) -> SignedMessage: | ||
| message_computer = MessageComputer() | ||
| serialized_message = message_computer.compute_bytes_for_signing(Message(message.encode())) |
There was a problem hiding this comment.
For validator wallets, this is not e regular use-case. In the few cases when validator wallets are required to sign a message, they sign the plain variant (raw bytes). Not this special enveloping:
As far as I know (see validators CLI of mxpy).
| sub.add_argument("--message", required=True, help="the message you want to sign") | ||
| sub.add_argument("--pem", required=True, type=str, help="the path to a validator pem file") | ||
| sub.add_argument( | ||
| "--validator-index", |
There was a problem hiding this comment.
Can also be simply "index".
| ) | ||
| sub.add_argument("--infile", required=True, help="the pem file of the wallet") | ||
| sub.add_argument( | ||
| "--index", |
Added functionality to create a validator wallet.
Also added functionality to sign a message using a validator wallet and to verify a messages using a bls validator pubkey.