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:
parent
a2f246c2a6
commit
423944bf79
@ -18,8 +18,8 @@ func newAccessListTx(tx *ethtypes.Transaction) (*AccessListTx, error) {
|
||||
}
|
||||
|
||||
v, r, s := tx.RawSignatureValues()
|
||||
if tx.To() != nil {
|
||||
txData.To = tx.To().Hex()
|
||||
if to := tx.To(); to != nil {
|
||||
txData.To = to.Hex()
|
||||
}
|
||||
|
||||
if tx.Value() != nil {
|
||||
|
@ -20,8 +20,8 @@ func newDynamicFeeTx(tx *ethtypes.Transaction) (*DynamicFeeTx, error) {
|
||||
}
|
||||
|
||||
v, r, s := tx.RawSignatureValues()
|
||||
if tx.To() != nil {
|
||||
txData.To = tx.To().Hex()
|
||||
if to := tx.To(); to != nil {
|
||||
txData.To = to.Hex()
|
||||
}
|
||||
|
||||
if tx.Value() != nil {
|
||||
|
@ -17,8 +17,8 @@ func newLegacyTx(tx *ethtypes.Transaction) (*LegacyTx, error) {
|
||||
}
|
||||
|
||||
v, r, s := tx.RawSignatureValues()
|
||||
if tx.To() != nil {
|
||||
txData.To = tx.To().Hex()
|
||||
if to := tx.To(); to != nil {
|
||||
txData.To = to.Hex()
|
||||
}
|
||||
|
||||
if tx.Value() != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user