core/types: reorder methods

This commit is contained in:
Felix Lange 2025-03-19 11:15:19 +01:00
parent afcd548f5f
commit 95ad65ff9c

View file

@ -221,11 +221,6 @@ func newModernSigner(chainID *big.Int, fork forks.Fork) Signer {
return s return s
} }
func (s *modernSigner) supportsType(txtype byte) bool {
_, ok := s.txtypes[txtype]
return ok
}
func (s *modernSigner) ChainID() *big.Int { func (s *modernSigner) ChainID() *big.Int {
return s.chainID return s.chainID
} }
@ -235,6 +230,15 @@ func (s *modernSigner) Equal(s2 Signer) bool {
return ok && s.chainID.Cmp(other.chainID) == 0 && maps.Equal(s.txtypes, other.txtypes) && s.legacy.Equal(other.legacy) return ok && s.chainID.Cmp(other.chainID) == 0 && maps.Equal(s.txtypes, other.txtypes) && s.legacy.Equal(other.legacy)
} }
func (s *modernSigner) Hash(tx *Transaction) common.Hash {
return tx.inner.sigHash(s.chainID)
}
func (s *modernSigner) supportsType(txtype byte) bool {
_, ok := s.txtypes[txtype]
return ok
}
func (s *modernSigner) Sender(tx *Transaction) (common.Address, error) { func (s *modernSigner) Sender(tx *Transaction) (common.Address, error) {
tt := tx.Type() tt := tx.Type()
if !s.supportsType(tt) { if !s.supportsType(tt) {
@ -271,10 +275,6 @@ func (s *modernSigner) SignatureValues(tx *Transaction, sig []byte) (R, S, V *bi
return R, S, V, nil return R, S, V, nil
} }
func (s *modernSigner) Hash(tx *Transaction) common.Hash {
return tx.inner.sigHash(s.chainID)
}
// NewPragueSigner returns a signer that accepts // NewPragueSigner returns a signer that accepts
// - EIP-7702 set code transactions // - EIP-7702 set code transactions
// - EIP-4844 blob transactions // - EIP-4844 blob transactions