[#466] cli: support NEP-2 and NEP-6 key formats

NEP-2 is contains WIF encrypted with password.
NEP-6 is format used for neo-go wallets.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-04-21 15:27:32 +03:00 committed by Alex Vanin
parent e9b3488aab
commit 60d74bce67
7 changed files with 152 additions and 37 deletions

View file

@ -51,7 +51,12 @@ var getEpochCmd = &cobra.Command{
Short: "Get current epoch number",
Long: "Get current epoch number",
RunE: func(cmd *cobra.Command, args []string) error {
cli, err := getSDKClient()
key, err := getKey()
if err != nil {
return err
}
cli, err := getSDKClient(key)
if err != nil {
return err
}
@ -72,7 +77,12 @@ var localNodeInfoCmd = &cobra.Command{
Short: "Get local node info",
Long: `Get local node info`,
RunE: func(cmd *cobra.Command, args []string) error {
cli, err := getSDKClient()
key, err := getKey()
if err != nil {
return err
}
cli, err := getSDKClient(key)
if err != nil {
return err
}
@ -105,7 +115,7 @@ var snapshotCmd = &cobra.Command{
return err
}
cli, err := getSDKClient()
cli, err := getSDKClient(key)
if err != nil {
return err
}
@ -134,7 +144,12 @@ var netInfoCmd = &cobra.Command{
Short: "Get information about NeoFS network",
Long: "Get information about NeoFS network",
RunE: func(cmd *cobra.Command, args []string) error {
cli, err := getSDKClient()
key, err := getKey()
if err != nil {
return err
}
cli, err := getSDKClient(key)
if err != nil {
return err
}