[factory] add error details
@@ -530,10 +530,11 @@ func (ws *workingSet) ValidateBlock(ctx context.Context, blk *block.Block) error
return err
}
if !blk.VerifyDeltaStateDigest(digest) {
- return block.ErrDeltaStateMismatch
+ return errors.Wrapf(block.ErrDeltaStateMismatch, "digest in block '%x' vs digest in workingset '%x'", blk.DeltaStateDigest(), digest)
}
- if !blk.VerifyReceiptRoot(calculateReceiptRoot(ws.receipts)) {
- return block.ErrReceiptRootMismatch
+ receiptRoot := calculateReceiptRoot(ws.receipts)
+ if !blk.VerifyReceiptRoot(receiptRoot) {
+ return errors.Wrapf(block.ErrReceiptRootMismatch, "receipt root in block '%x' vs receipt root in workingset '%x'", blk.ReceiptRoot(), receiptRoot)
}
return nil
