Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
x/evm/types: use ethtypes.Transaction.To for cheaper retrieval (#835)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
odeke-em authored Dec 14, 2021
1 parent a2f246c commit 423944b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions x/evm/types/access_list_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/dynamic_fee_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/legacy_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 423944b

Please sign in to comment.