review feedback

This commit is contained in:
Sina Mahmoodi 2025-02-18 19:02:11 +01:00
parent 1dcdcdfab3
commit 2bfa0ea65e
1 changed files with 6 additions and 5 deletions

View File

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