@@ -18,6 +18,7 @@ import (
18
18
"github.com/ethereum/go-ethereum/accounts/abi"
19
19
"github.com/ethereum/go-ethereum/accounts/abi/bind"
20
20
"github.com/ethereum/go-ethereum/common"
21
+ "github.com/ethereum/go-ethereum/core"
21
22
geth_types "github.com/ethereum/go-ethereum/core/types"
22
23
"github.com/sirupsen/logrus"
23
24
)
@@ -87,37 +88,37 @@ func GetEth1Transaction(hash common.Hash) (*types.Eth1TxData, error) {
87
88
txPageData .BlockNumber = header .Number .Int64 ()
88
89
txPageData .Timestamp = time .Unix (int64 (header .Time ), 0 )
89
90
90
- msg , err := tx . AsMessage ( geth_types .NewLondonSigner (tx .ChainId ()), header .BaseFee )
91
+ msg , err := core . TransactionToMessage ( tx , geth_types .NewLondonSigner (tx .ChainId ()), header .BaseFee )
91
92
if err != nil {
92
93
return nil , fmt .Errorf ("error converting tx %v to message: %v" , hash , err )
93
94
}
94
- txPageData .From = msg .From ()
95
- txPageData .Nonce = msg .Nonce ()
95
+ txPageData .From = msg .From
96
+ txPageData .Nonce = msg .Nonce
96
97
txPageData .Type = receipt .Type
97
98
txPageData .TypeFormatted = utils .FormatTransactionType (receipt .Type )
98
99
txPageData .TxnPosition = receipt .TransactionIndex
99
100
100
- txPageData .Gas .MaxPriorityFee = msg .GasTipCap () .Bytes ()
101
- txPageData .Gas .MaxFee = msg .GasFeeCap () .Bytes ()
101
+ txPageData .Gas .MaxPriorityFee = msg .GasTipCap .Bytes ()
102
+ txPageData .Gas .MaxFee = msg .GasFeeCap .Bytes ()
102
103
if header .BaseFee != nil {
103
104
txPageData .Gas .BlockBaseFee = header .BaseFee .Bytes ()
104
105
}
105
106
txPageData .Gas .Used = receipt .GasUsed
106
- txPageData .Gas .Limit = msg .Gas ()
107
- txPageData .Gas .UsedPerc = float64 (receipt .GasUsed ) / float64 (msg .Gas () )
107
+ txPageData .Gas .Limit = msg .GasLimit
108
+ txPageData .Gas .UsedPerc = float64 (receipt .GasUsed ) / float64 (msg .GasLimit )
108
109
if receipt .Type >= 2 {
109
110
tmp := new (big.Int )
110
111
tmp .Add (tmp , header .BaseFee )
111
- if t := * new (big.Int ).Sub (msg .GasFeeCap () , tmp ); t .Cmp (msg .GasTipCap () ) == - 1 {
112
+ if t := * new (big.Int ).Sub (msg .GasFeeCap , tmp ); t .Cmp (msg .GasTipCap ) == - 1 {
112
113
tmp .Add (tmp , & t )
113
114
} else {
114
- tmp .Add (tmp , msg .GasTipCap () )
115
+ tmp .Add (tmp , msg .GasTipCap )
115
116
}
116
117
txPageData .Gas .EffectiveFee = tmp .Bytes ()
117
118
txPageData .Gas .TxFee = tmp .Mul (tmp , big .NewInt (int64 (receipt .GasUsed ))).Bytes ()
118
119
} else {
119
- txPageData .Gas .EffectiveFee = msg .GasFeeCap () .Bytes ()
120
- txPageData .Gas .TxFee = msg .GasFeeCap () .Mul (msg .GasFeeCap () , big .NewInt (int64 (receipt .GasUsed ))).Bytes ()
120
+ txPageData .Gas .EffectiveFee = msg .GasFeeCap .Bytes ()
121
+ txPageData .Gas .TxFee = msg .GasFeeCap .Mul (msg .GasFeeCap , big .NewInt (int64 (receipt .GasUsed ))).Bytes ()
121
122
}
122
123
123
124
if receipt .Status != 1 {
@@ -135,17 +136,17 @@ func GetEth1Transaction(hash common.Hash) (*types.Eth1TxData, error) {
135
136
if err != nil {
136
137
return nil , fmt .Errorf ("error loading token transfers from tx %v: %v" , hash , err )
137
138
}
138
- txPageData .InternalTxns , err = db .BigtableClient .GetInternalTransfersForTransaction (tx .Hash ().Bytes (), msg .From () .Bytes ())
139
+ txPageData .InternalTxns , err = db .BigtableClient .GetInternalTransfersForTransaction (tx .Hash ().Bytes (), msg .From .Bytes ())
139
140
if err != nil {
140
141
return nil , fmt .Errorf ("error loading internal transfers from tx %v: %v" , hash , err )
141
142
}
142
143
}
143
- txPageData .FromName , err = db .BigtableClient .GetAddressName (msg .From () .Bytes ())
144
+ txPageData .FromName , err = db .BigtableClient .GetAddressName (msg .From .Bytes ())
144
145
if err != nil {
145
146
return nil , fmt .Errorf ("error retrieveing from name for tx %v: %v" , hash , err )
146
147
}
147
- if msg .To () != nil {
148
- txPageData .ToName , err = db .BigtableClient .GetAddressName (msg .To () .Bytes ())
148
+ if msg .To != nil {
149
+ txPageData .ToName , err = db .BigtableClient .GetAddressName (msg .To .Bytes ())
149
150
if err != nil {
150
151
return nil , fmt .Errorf ("error retrieveing to name for tx %v: %v" , hash , err )
151
152
}
0 commit comments