avoid the unexpected situation (#163)

This commit is contained in:
maskpp 2022-09-26 10:32:47 +08:00 committed by GitHub
parent 3a7da33cd5
commit ca2e576d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -356,9 +356,12 @@ func (api *API) fillBlockResult(env *traceEnv, block *types.Block) (*types.Block
} }
} }
// only zktrie model has the ability to get `mptwitness`.
if api.backend.ChainConfig().Zktrie {
if err := zkproof.FillBlockResultForMPTWitness(zkproof.MPTWitnessType(api.backend.CacheConfig().MPTWitness), blockResult); err != nil { if err := zkproof.FillBlockResultForMPTWitness(zkproof.MPTWitnessType(api.backend.CacheConfig().MPTWitness), blockResult); err != nil {
log.Error("fill mpt witness fail", "error", err) log.Error("fill mpt witness fail", "error", err)
} }
}
return blockResult, nil return blockResult, nil
} }