review feedback

This commit is contained in:
Sina Mahmoodi 2025-02-18 19:02:11 +01:00 committed by lightclient
parent d9c516cdeb
commit bf8ed1caa2
No known key found for this signature in database
GPG key ID: 657913021EF45A6A

View file

@ -75,13 +75,14 @@ func (r *simCallResult) MarshalJSON() ([]byte, error) {
// simBlockResult is the result of a simulated block.
type simBlockResult struct {
sim *simulator
fullTx bool
chainConfig *params.ChainConfig
Block *types.Block
Calls []simCallResult
}
func (r *simBlockResult) MarshalJSON() ([]byte, error) {
blockData := RPCMarshalBlock(r.Block, true, r.sim.fullTx, r.sim.chainConfig)
blockData := RPCMarshalBlock(r.Block, true, r.fullTx, r.chainConfig)
blockData["calls"] = r.Calls
return json.Marshal(blockData)
}
@ -148,7 +149,7 @@ func (sim *simulator) execute(ctx context.Context, blocks []simBlock) ([]*simBlo
if err != nil {
return nil, err
}
results[bi] = &simBlockResult{sim: sim, Block: result, Calls: callResults}
results[bi] = &simBlockResult{fullTx: sim.fullTx, chainConfig: sim.chainConfig, Block: result, Calls: callResults}
parent = result.Header()
prevHeaders = append(prevHeaders, parent)
}