accounts/scwallet: holiman's review feedback

This commit is contained in:
Guillaume Ballet 2019-05-03 16:50:19 +02:00
parent d2ae535bb9
commit c65f617a0d
4 changed files with 8 additions and 9 deletions

View file

@ -224,10 +224,9 @@ const testPassphrase = "swarm-test-passphrase"
func getTestAccount(t *testing.T, dir string) (conf *node.Config, account accounts.Account) {
// create key
conf = &node.Config{
DataDir: dir,
IPCPath: "bzzd.ipc",
NoUSB: true,
SmartCard: false,
DataDir: dir,
IPCPath: "bzzd.ipc",
NoUSB: true,
}
n, err := node.New(conf)
if err != nil {

View file

@ -130,7 +130,7 @@ var (
}
SmartCardFlag = cli.StringFlag{
Name: "pcscd-sock",
Usage: "Path to the smartcard daemon (pcscd) socket file",
Usage: "Path to the smartcard daemon (pcscd) socket file (linux only)",
Value: "/run/pcscd/pcscd.comm",
}
NetworkIdFlag = cli.Uint64Flag{
@ -1160,6 +1160,8 @@ func setSmartCard(ctx *cli.Context, cfg *node.Config) {
if fi, err := os.Stat(ctx.GlobalString(SmartCardFlag.Name)); err == nil {
cfg.SmartCard = fi.Mode()&os.ModeType == os.ModeSocket
}
} else {
log.Info("Smartcard support disabled on this platform")
}
}

View file

@ -114,7 +114,6 @@ func (e *ExecAdapter) NewNode(config *NodeConfig) (Node, error) {
conf.Stack.P2P.NoDiscovery = true
conf.Stack.P2P.NAT = nil
conf.Stack.NoUSB = true
conf.Stack.SmartCard = false
// listen on a localhost port, which we set when we
// initialise NodeConfig (usually a random port)

View file

@ -105,9 +105,8 @@ func (s *SimAdapter) NewNode(config *NodeConfig) (Node, error) {
Dialer: s,
EnableMsgEvents: config.EnableMsgEvents,
},
NoUSB: true,
SmartCard: false,
Logger: log.New("node.id", id.String()),
NoUSB: true,
Logger: log.New("node.id", id.String()),
})
if err != nil {
return nil, err