From afaa9e10061bc4262d7f443b21871b8f339f7cdc Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Fri, 22 Nov 2019 17:06:47 +0100 Subject: [PATCH 1/2] accounts/usbwallet: fix staticcheck warnings --- accounts/usbwallet/ledger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 17ca9223ffe5..feebc1b60446 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -162,8 +162,8 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio return common.Address{}, nil, accounts.ErrWalletClosed } // Ensure the wallet is capable of signing the given transaction - if chainID != nil && w.version[0] <= 1 && w.version[1] <= 0 && w.version[2] <= 2 { - return common.Address{}, nil, fmt.Errorf("Ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2]) + if chainID != nil && w.version[0] <= 1 && w.version[2] <= 2 { + return common.Address{}, nil, fmt.Errorf("ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2]) } // All infos gathered and metadata checks out, request signing return w.ledgerSign(path, tx, chainID) From 482db9c596b7c89d416693e57767e56327a258d3 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Tue, 26 Nov 2019 11:33:38 +0100 Subject: [PATCH 2/2] review feedback --- accounts/usbwallet/ledger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index feebc1b60446..64eae64f689a 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -163,7 +163,8 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio } // Ensure the wallet is capable of signing the given transaction if chainID != nil && w.version[0] <= 1 && w.version[2] <= 2 { - return common.Address{}, nil, fmt.Errorf("ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2]) + //lint:ignore ST1005 brand name displayed on the console + return common.Address{}, nil, fmt.Errorf("Ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2]) } // All infos gathered and metadata checks out, request signing return w.ledgerSign(path, tx, chainID)