Skip to content

Commit

Permalink
shovel: deployed contract address data (#277)
Browse files Browse the repository at this point in the history
Added contract address from transaction receipt rpc response to Receipt struct. This can be null so current filters ops don't work to only filter non null contract address values.
  • Loading branch information
regynald authored Nov 18, 2024
1 parent c167042 commit cb9264e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dig/dig.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ func (lwc *logWithCtx) get(name string) any {
return &lwc.t.GasPrice
case "tx_effective_gas_price":
return &lwc.t.EffectiveGasPrice
case "tx_contract_address":
return lwc.t.ContractAddress.Bytes()
case "tx_max_priority_fee_per_gas":
return &lwc.t.MaxPriorityFeePerGas
case "tx_max_fee_per_gas":
Expand Down
1 change: 1 addition & 0 deletions eth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ type Receipt struct {
GasUsed Uint64
EffectiveGasPrice uint256.Int
Logs Logs
ContractAddress Bytes
}

type Header struct {
Expand Down
2 changes: 2 additions & 0 deletions jrpc2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ type receiptResult struct {
GasUsed eth.Uint64 `json:"gasUsed"`
EffectiveGasPrice uint256.Int `json:"effectiveGasPrice"`
Logs eth.Logs `json:"logs"`
ContractAddress eth.Bytes `json:"contractAddress"`
}

type receiptResp struct {
Expand Down Expand Up @@ -709,6 +710,7 @@ func (c *Client) receipts(ctx context.Context, url string, bm blockmap, start, l
tx.GasUsed = resps[i].Result[j].GasUsed
tx.EffectiveGasPrice = resps[i].Result[j].EffectiveGasPrice
tx.Logs = make([]eth.Log, len(resps[i].Result[j].Logs))
tx.ContractAddress.Write(resps[i].Result[j].ContractAddress)
copy(tx.Logs, resps[i].Result[j].Logs)
}
}
Expand Down

0 comments on commit cb9264e

Please sign in to comment.