Skip to content

Commit e3897dc

Browse files
committed
Add fromAddress and toAddress in callBundle
1 parent 05f64f8 commit e3897dc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

internal/ethapi/api.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,7 @@ func (s *BundleAPI) CallBundle(ctx context.Context, encodedTxs []hexutil.Bytes,
22212221
coinbaseBalanceBefore := state.GetBalance(coinbase)
22222222

22232223
bundleHash := sha3.NewLegacyKeccak256()
2224+
signer := types.MakeSigner(s.b.ChainConfig(), blockNumber)
22242225
var totalGasUsed uint64
22252226
gasFees := new(big.Int)
22262227
for i, tx := range txs {
@@ -2233,9 +2234,15 @@ func (s *BundleAPI) CallBundle(ctx context.Context, encodedTxs []hexutil.Bytes,
22332234
}
22342235

22352236
txHash := tx.Hash().String()
2237+
from, err := types.Sender(signer, tx)
2238+
if err != nil {
2239+
return nil, fmt.Errorf("err: %w; txhash %s", err, tx.Hash())
2240+
}
22362241
jsonResult := map[string]interface{}{
2237-
"txHash": txHash,
2238-
"gasUsed": receipt.GasUsed,
2242+
"txHash": txHash,
2243+
"gasUsed": receipt.GasUsed,
2244+
"fromAddress": from.String(),
2245+
"toAddress": tx.To().String(),
22392246
}
22402247
totalGasUsed += receipt.GasUsed
22412248
gasFeesTx := new(big.Int).Mul(big.NewInt(int64(receipt.GasUsed)), tx.GasPrice())

0 commit comments

Comments
 (0)