Skip to content

Commit 331fa6d

Browse files
Evgenyfjl
authored andcommitted
accounts/usbwallet: simplify code using -= operator (#17904)
1 parent 3e92c85 commit 331fa6d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎accounts/usbwallet/ledger.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
350350
signer = new(types.HomesteadSigner)
351351
} else {
352352
signer = types.NewEIP155Signer(chainID)
353-
signature[64] = signature[64] - byte(chainID.Uint64()*2+35)
353+
signature[64] -= byte(chainID.Uint64()*2 + 35)
354354
}
355355
signed, err := tx.WithSignature(signer, signature)
356356
if err != nil {

‎accounts/usbwallet/trezor.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
221221
signer = new(types.HomesteadSigner)
222222
} else {
223223
signer = types.NewEIP155Signer(chainID)
224-
signature[64] = signature[64] - byte(chainID.Uint64()*2+35)
224+
signature[64] -= byte(chainID.Uint64()*2 + 35)
225225
}
226226
// Inject the final signature into the transaction and sanity check the sender
227227
signed, err := tx.WithSignature(signer, signature)

0 commit comments

Comments
 (0)