Skip to content

Commit

Permalink
feat(act): return error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferenc Sárai committed Jul 30, 2024
1 parent d27fa7b commit 8945442
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/check/act/act.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,22 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int
// download act file
his := gFile.HistroryAddress()
c.logger.Infof("ACT file download started: %s", fileAddress.String())
size1, hash1, err1 := client2.DownloadActFile(ctx, fileAddress, &api.DownloadOptions{Act: &act, ActPublicKey: &publisher, ActHistoryAddress: &his})
_, _, err1 := client2.DownloadActFile(ctx, fileAddress, &api.DownloadOptions{Act: &act, ActPublicKey: &publisher, ActHistoryAddress: &his})
if err1 != nil {
return fmt.Errorf("node %s: %w", nodeName1, err1)
}

if !bytes.Equal(file.Hash(), hash1) {
c.logger.Infof("Node %s. ACT file hash not equal. Uploaded size: %d Downloaded size: %d File: %s", nodeName1, file.Size(), size1, file.Address().String())
return errors.New("ACT file retrieval - hash error")
}
return errors.New("ACT file retrieval - hash error")
/*
if !bytes.Equal(file.Hash(), hash1) {
c.logger.Infof("Node %s. ACT file hash not equal. Uploaded size: %d Downloaded size: %d File: %s", nodeName1, file.Size(), size1, file.Address().String())
return errors.New("ACT file retrieval - hash error")
}
c.logger.Info("ACT file downloaded with grantee")
c.logger.Info("ACT file downloaded with grantee")
c.logger.Info("ACT test completed")
c.logger.Info("ACT test completed")
return
return
*/
}

0 comments on commit 8945442

Please sign in to comment.