Remove unused Transaction.Size (#6545)

This commit is contained in:
Andrew Ashikhmin 2023-01-10 11:03:34 +01:00 committed by GitHub
parent 919fc390be
commit 19af2009dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 34 deletions

View File

@ -98,16 +98,6 @@ func (tx AccessListTx) GetAccessList() AccessList {
return tx.AccessList return tx.AccessList
} }
func (tx *AccessListTx) Size() common.StorageSize {
if size := tx.size.Load(); size != nil {
return size.(common.StorageSize)
}
c := tx.EncodingSize()
c++ // TxType
tx.size.Store(common.StorageSize(c))
return common.StorageSize(c)
}
func (tx AccessListTx) Protected() bool { func (tx AccessListTx) Protected() bool {
return true return true
} }

View File

@ -106,15 +106,6 @@ func (tx DynamicFeeTransaction) GetAccessList() AccessList {
return tx.AccessList return tx.AccessList
} }
func (tx *DynamicFeeTransaction) Size() common.StorageSize {
if size := tx.size.Load(); size != nil {
return size.(common.StorageSize)
}
c := tx.EncodingSize()
tx.size.Store(common.StorageSize(c))
return common.StorageSize(c)
}
func (tx DynamicFeeTransaction) EncodingSize() int { func (tx DynamicFeeTransaction) EncodingSize() int {
payloadSize, _, _, _ := tx.payloadSize() payloadSize, _, _, _ := tx.payloadSize()
envelopeSize := payloadSize envelopeSize := payloadSize

View File

@ -187,15 +187,6 @@ func (tx LegacyTx) copy() *LegacyTx {
return cpy return cpy
} }
func (tx *LegacyTx) Size() common.StorageSize {
if size := tx.size.Load(); size != nil {
return size.(common.StorageSize)
}
c := tx.EncodingSize()
tx.size.Store(common.StorageSize(c))
return common.StorageSize(c)
}
func (tx LegacyTx) EncodingSize() int { func (tx LegacyTx) EncodingSize() int {
payloadSize, _, _ := tx.payloadSize() payloadSize, _, _ := tx.payloadSize()
return payloadSize return payloadSize

View File

@ -206,10 +206,6 @@ func (tx StarknetTransaction) SigningHash(chainID *big.Int) common.Hash {
}) })
} }
func (tx StarknetTransaction) Size() common.StorageSize {
panic("implement me")
}
func (tx StarknetTransaction) GetAccessList() AccessList { func (tx StarknetTransaction) GetAccessList() AccessList {
panic("implement me") panic("implement me")
} }

View File

@ -70,7 +70,6 @@ type Transaction interface {
FakeSign(address common.Address) (Transaction, error) FakeSign(address common.Address) (Transaction, error)
Hash() common.Hash Hash() common.Hash
SigningHash(chainID *big.Int) common.Hash SigningHash(chainID *big.Int) common.Hash
Size() common.StorageSize
GetData() []byte GetData() []byte
GetAccessList() AccessList GetAccessList() AccessList
Protected() bool Protected() bool
@ -97,7 +96,6 @@ type TransactionMisc struct {
// caches // caches
hash atomic.Value //nolint:structcheck hash atomic.Value //nolint:structcheck
size atomic.Value //nolint:structcheck
from atomic.Value from atomic.Value
} }