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) { func getTestAccount(t *testing.T, dir string) (conf *node.Config, account accounts.Account) {
// create key // create key
conf = &node.Config{ conf = &node.Config{
DataDir: dir, DataDir: dir,
IPCPath: "bzzd.ipc", IPCPath: "bzzd.ipc",
NoUSB: true, NoUSB: true,
SmartCard: false,
} }
n, err := node.New(conf) n, err := node.New(conf)
if err != nil { if err != nil {

View file

@ -130,7 +130,7 @@ var (
} }
SmartCardFlag = cli.StringFlag{ SmartCardFlag = cli.StringFlag{
Name: "pcscd-sock", 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", Value: "/run/pcscd/pcscd.comm",
} }
NetworkIdFlag = cli.Uint64Flag{ 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 { if fi, err := os.Stat(ctx.GlobalString(SmartCardFlag.Name)); err == nil {
cfg.SmartCard = fi.Mode()&os.ModeType == os.ModeSocket 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.NoDiscovery = true
conf.Stack.P2P.NAT = nil conf.Stack.P2P.NAT = nil
conf.Stack.NoUSB = true conf.Stack.NoUSB = true
conf.Stack.SmartCard = false
// listen on a localhost port, which we set when we // listen on a localhost port, which we set when we
// initialise NodeConfig (usually a random port) // initialise NodeConfig (usually a random port)

View file

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