Skip to content

Commit 031320c

Browse files
Ciferclaude
andcommitted
Use pointer types for BlockHash/TransactionHash in ActionTrace to handle JSON null
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0fb854f commit 031320c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

rpc/namespaces/ethereum/pre/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ func (a *API) TraceMany(args []CallArgs) ([]evmtypes.PreResult, error) {
130130
for j := range preResList[i].Logs {
131131
preResList[i].Logs[j].BlockHash = blockHash
132132
}
133+
zeroHash := common.Hash{}
133134
for j := range preResList[i].Trace {
134-
preResList[i].Trace[j].BlockHash = blockHash
135-
preResList[i].Trace[j].TransactionHash = common.Hash{}
135+
preResList[i].Trace[j].BlockHash = &blockHash
136+
preResList[i].Trace[j].TransactionHash = &zeroHash
136137
}
137138
}
138139
return preResList, nil

x/vm/types/action_trace.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ type ActionTrace struct {
2525
Action TAction `json:"action"`
2626
Result *TResult `json:"result,omitempty"`
2727
Error string `json:"error,omitempty"`
28-
BlockHash common.Hash `json:"blockHash,omitempty"`
29-
BlockNumber int64 `json:"blockNumber"`
30-
TransactionHash common.Hash `json:"transactionHash,omitempty"`
28+
BlockHash *common.Hash `json:"blockHash,omitempty"`
29+
BlockNumber int64 `json:"blockNumber"`
30+
TransactionHash *common.Hash `json:"transactionHash,omitempty"`
3131
TransactionPosition uint64 `json:"transactionPosition"`
3232
}
3333

0 commit comments

Comments
 (0)