Skip to content

Commit b2e6acc

Browse files
committed
accounts/usbwallet: simplify code using -= operator (ethereum#17904)
1 parent 2597c58 commit b2e6acc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

accounts/usbwallet/ledger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
351351
signer = new(types.HomesteadSigner)
352352
} else {
353353
signer = types.NewEIP155Signer(chainID)
354-
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
354+
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
355355
}
356356
signed, err := tx.WithSignature(signer, signature)
357357
if err != nil {

accounts/usbwallet/trezor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
223223
} else {
224224
// Trezor backend does not support typed transactions yet.
225225
signer = types.NewEIP155Signer(chainID)
226-
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
226+
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
227227
}
228228

229229
// Inject the final signature into the transaction and sanity check the sender

0 commit comments

Comments
 (0)