|
|
@ -331,11 +331,7 @@ func (s eip2930Signer) Sender(tx *Transaction) (common.Address, error) { |
|
|
|
V, R, S := tx.RawSignatureValues() |
|
|
|
V, R, S := tx.RawSignatureValues() |
|
|
|
switch tx.Type() { |
|
|
|
switch tx.Type() { |
|
|
|
case LegacyTxType: |
|
|
|
case LegacyTxType: |
|
|
|
if !tx.Protected() { |
|
|
|
return s.EIP155Signer.Sender(tx) |
|
|
|
return HomesteadSigner{}.Sender(tx) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
V = new(big.Int).Sub(V, s.chainIdMul) |
|
|
|
|
|
|
|
V.Sub(V, big8) |
|
|
|
|
|
|
|
case AccessListTxType: |
|
|
|
case AccessListTxType: |
|
|
|
// AL txs are defined to use 0 and 1 as their recovery
|
|
|
|
// AL txs are defined to use 0 and 1 as their recovery
|
|
|
|
// id, add 27 to become equivalent to unprotected Homestead signatures.
|
|
|
|
// id, add 27 to become equivalent to unprotected Homestead signatures.
|
|
|
@ -372,15 +368,7 @@ func (s eip2930Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *bi |
|
|
|
func (s eip2930Signer) Hash(tx *Transaction) common.Hash { |
|
|
|
func (s eip2930Signer) Hash(tx *Transaction) common.Hash { |
|
|
|
switch tx.Type() { |
|
|
|
switch tx.Type() { |
|
|
|
case LegacyTxType: |
|
|
|
case LegacyTxType: |
|
|
|
return rlpHash([]interface{}{ |
|
|
|
return s.EIP155Signer.Hash(tx) |
|
|
|
tx.Nonce(), |
|
|
|
|
|
|
|
tx.GasPrice(), |
|
|
|
|
|
|
|
tx.Gas(), |
|
|
|
|
|
|
|
tx.To(), |
|
|
|
|
|
|
|
tx.Value(), |
|
|
|
|
|
|
|
tx.Data(), |
|
|
|
|
|
|
|
s.chainId, uint(0), uint(0), |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
case AccessListTxType: |
|
|
|
case AccessListTxType: |
|
|
|
return prefixedRlpHash( |
|
|
|
return prefixedRlpHash( |
|
|
|
tx.Type(), |
|
|
|
tx.Type(), |
|
|
|