accounts/usbwallet: simplify code using -= operator (#17904)

This commit is contained in:
Daniel Liu 2025-01-14 10:56:07 +08:00
parent c0acd9c3ad
commit b469d70433
2 changed files with 2 additions and 2 deletions

View file

@ -351,7 +351,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
signer = new(types.HomesteadSigner)
} else {
signer = types.NewEIP155Signer(chainID)
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
}
signed, err := tx.WithSignature(signer, signature)
if err != nil {

View file

@ -223,7 +223,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
} else {
// Trezor backend does not support typed transactions yet.
signer = types.NewEIP155Signer(chainID)
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
}
// Inject the final signature into the transaction and sanity check the sender