mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 12:27:18 +00:00
Windows friendly stdin reads for passwords (#5010)
* cast os.stdin filehandle since on windows syscall.Stdin is not int * import ordering * Merge branch 'master' into prysm-5008-windows-stdin-not-int
This commit is contained in:
parent
e635e5b205
commit
5961aaf588
@ -7,7 +7,6 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
contract "github.com/prysmaticlabs/prysm/contracts/deposit-contract"
|
||||
@ -136,7 +135,7 @@ func CreateValidatorAccount(path string, passphrase string) (string, string, err
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
log.Info("Create a new validator account for eth2")
|
||||
log.Info("Enter a password:")
|
||||
bytePassword, err := terminal.ReadPassword(syscall.Stdin)
|
||||
bytePassword, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
if err != nil {
|
||||
log.Fatalf("Could not read account password: %v", err)
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/bls"
|
||||
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
||||
@ -63,7 +62,7 @@ func NewKeystore(input string) (KeyManager, string, error) {
|
||||
} else {
|
||||
if opts.Passphrase == "" {
|
||||
log.Info("Enter your validator account password:")
|
||||
bytePassword, err := terminal.ReadPassword(syscall.Stdin)
|
||||
bytePassword, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
if err != nil {
|
||||
return nil, keystoreOptsHelp, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user