Skip to content

Commit 5728a85

Browse files
authored
Problem: encrypto_to_validators fail if any validator not registered (crypto-org-chain#1438)
* Problem: encrypto_to_validators fail if any validator not registered Solution: - just log the error and continue, more UX friendly. * improve log * improve log
1 parent 01dca97 commit 5728a85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

x/e2ee/client/cli/encrypt_to_validators.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli
22

33
import (
44
"context"
5+
"fmt"
56
"io"
67
"os"
78

@@ -63,9 +64,15 @@ func EncryptToValidatorsCommand() *cobra.Command {
6364

6465
recipients := make([]age.Recipient, len(recs))
6566
for i, key := range rsp.Keys {
67+
if len(key) == 0 {
68+
fmt.Fprintf(os.Stderr, "missing encryption key for validator %s\n", recs[i])
69+
continue
70+
}
71+
6672
recipient, err := age.ParseX25519Recipient(key)
6773
if err != nil {
68-
return err
74+
fmt.Fprintf(os.Stderr, "invalid encryption key for validator %s, %v\n", recs[i], err)
75+
continue
6976
}
7077
recipients[i] = recipient
7178
}

0 commit comments

Comments
 (0)