Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pkg/keychain/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const (

var (
ErrMutuallyExlusiveKeySource = errors.New("key source flags --key, --ewoq, --ledger/--ledger-addrs are mutually exclusive")
ErrStoredKeyOrEwoqOnMainnet = errors.New("key sources --key, --ewoq are not available for mainnet operations")
ErrStoredKeyOnMainnet = errors.New("--key flag is not supported for mainnet operations, please use ledger instead")
ErrNonEwoqKeyOnMainnet = errors.New("key source --ewoq is not available for mainnet operations")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also advice to use ledger here

ErrNonEwoqKeyOnDevnet = errors.New("key source --ewoq is the only one available for devnet operations")
ErrEwoqKeyOnFuji = errors.New("key source --ewoq is not available for fuji operations")
)
Expand Down Expand Up @@ -157,8 +158,11 @@ func GetKeychainFromCmdLineFlags(
}
case network.Kind == models.Mainnet:
// mainnet requires ledger usage
if keyName != "" || useEwoq {
return nil, ErrStoredKeyOrEwoqOnMainnet
if keyName != "" {
return nil, ErrStoredKeyOnMainnet
}
if useEwoq {
return nil, ErrNonEwoqKeyOnMainnet
}
useLedger = true
}
Expand Down
Loading