x/evm/types: use ethtypes.Transaction.To for cheaper retrieval (#835)

Following suit with PR #828, this change cuts down the expenses
from using .To doubly; yet using the Go in-condition variable idiom.

Updates #826
This commit is contained in:
Emmanuel T Odeke 2021-12-13 17:28:02 -08:00 committed by GitHub
parent a2f246c2a6
commit 423944bf79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -18,8 +18,8 @@ func newAccessListTx(tx *ethtypes.Transaction) (*AccessListTx, error) {
} }
v, r, s := tx.RawSignatureValues() v, r, s := tx.RawSignatureValues()
if tx.To() != nil { if to := tx.To(); to != nil {
txData.To = tx.To().Hex() txData.To = to.Hex()
} }
if tx.Value() != nil { if tx.Value() != nil {

View File

@ -20,8 +20,8 @@ func newDynamicFeeTx(tx *ethtypes.Transaction) (*DynamicFeeTx, error) {
} }
v, r, s := tx.RawSignatureValues() v, r, s := tx.RawSignatureValues()
if tx.To() != nil { if to := tx.To(); to != nil {
txData.To = tx.To().Hex() txData.To = to.Hex()
} }
if tx.Value() != nil { if tx.Value() != nil {

View File

@ -17,8 +17,8 @@ func newLegacyTx(tx *ethtypes.Transaction) (*LegacyTx, error) {
} }
v, r, s := tx.RawSignatureValues() v, r, s := tx.RawSignatureValues()
if tx.To() != nil { if to := tx.To(); to != nil {
txData.To = tx.To().Hex() txData.To = to.Hex()
} }
if tx.Value() != nil { if tx.Value() != nil {