eth: improve error messages in ExecutionWitness method

This commit is contained in:
rjl493456442 2026-03-04 10:07:27 +08:00 committed by GitHub
parent 287a55072a
commit 6648bde79f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -498,11 +498,11 @@ func (api *DebugAPI) ExecutionWitness(bn rpc.BlockNumberOrHash) (*stateless.ExtW
bc := api.eth.blockchain bc := api.eth.blockchain
block, err := api.eth.APIBackend.BlockByNumberOrHash(context.Background(), bn) block, err := api.eth.APIBackend.BlockByNumberOrHash(context.Background(), bn)
if err != nil { if err != nil {
return &stateless.ExtWitness{}, fmt.Errorf("block number %v not found", bn) return &stateless.ExtWitness{}, fmt.Errorf("block %v not found", bn)
} }
parent := bc.GetHeader(block.ParentHash(), block.NumberU64()-1) parent := bc.GetHeader(block.ParentHash(), block.NumberU64()-1)
if parent == nil { if parent == nil {
return &stateless.ExtWitness{}, fmt.Errorf("block number %v found, but parent missing", bn) return &stateless.ExtWitness{}, fmt.Errorf("block %v found, but parent missing", bn)
} }
config := core.ExecuteConfig{ config := core.ExecuteConfig{
WriteState: false, WriteState: false,