@@ -239,9 +239,27 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block)
239
239
if errors .Is (err , utils .ErrResourceBusy ) {
240
240
return nil , httpHeader , rpccore .ErrInternal .CloneWithData (rpccore .ThrottledVMErr )
241
241
}
242
+
243
+ txs := make ([]string , len (block .Transactions ))
244
+ for i , tx := range block .Transactions {
245
+ txs [i ] = tx .Hash ().String ()
246
+ }
247
+
242
248
// Since we are tracing an existing block, we know that there should be no errors during execution. If we encounter any,
243
249
// report them as unexpected errors
244
- return nil , httpHeader , rpccore .ErrUnexpectedError .CloneWithData (err .Error ())
250
+ return nil , httpHeader , rpccore .ErrUnexpectedError .CloneWithData (struct {
251
+ Error string `json:"error"`
252
+ StateBlock uint64 `json:"state_block"`
253
+ ParentBlock string `json:"parent_block"`
254
+ Number uint64 `json:"number"`
255
+ Txs []string `json:"txs"`
256
+ }{
257
+ Error : err .Error (),
258
+ StateBlock : core .GetBlockNumber (state ),
259
+ ParentBlock : block .ParentHash .String (),
260
+ Number : block .Number ,
261
+ Txs : txs ,
262
+ })
245
263
}
246
264
247
265
result := make ([]TracedBlockTransaction , len (executionResult .Traces ))
0 commit comments