From 248a362c3e6847770fc7371ada723df1fec03b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 24 Jan 2020 21:15:02 +0100 Subject: [PATCH] sealing: docstrings for sanity-checks --- checks.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/checks.go b/checks.go index 94ad95771..9baf2d993 100644 --- a/checks.go +++ b/checks.go @@ -22,6 +22,11 @@ type ErrExpiredDeals struct{ error } type ErrBadCommD struct{ error } type ErrExpiredTicket struct{ error } +// checkPieces validates that: +// - Each piece han a corresponding on chain deal +// - Piece commitments match with on chain deals +// - Piece sizes match +// - Deals aren't expired func checkPieces(ctx context.Context, si SectorInfo, api sealingApi) error { head, err := api.ChainHead(ctx) if err != nil { @@ -50,6 +55,8 @@ func checkPieces(ctx context.Context, si SectorInfo, api sealingApi) error { return nil } +// checkSeal checks that data commitment generated in the sealing process +// matches pieces, and that the seal ticket isn't expired func checkSeal(ctx context.Context, maddr address.Address, si SectorInfo, api sealingApi) (err error) { head, err := api.ChainHead(ctx) if err != nil {