fix actor string (#12019)

This commit is contained in:
LexLuthr 2024-05-20 16:20:24 +05:30 committed by GitHub
parent 0da9646418
commit 1afe58dcad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -711,10 +711,17 @@ func (a *app) porepPipelineSummary(ctx context.Context) ([]porepPipelineSummary,
var summaries []porepPipelineSummary
for rows.Next() {
var summary porepPipelineSummary
if err := rows.Scan(&summary.Actor, &summary.CountSDR, &summary.CountTrees, &summary.CountPrecommitMsg, &summary.CountWaitSeed, &summary.CountPoRep, &summary.CountCommitMsg, &summary.CountDone, &summary.CountFailed); err != nil {
var actor int64
if err := rows.Scan(&actor, &summary.CountSDR, &summary.CountTrees, &summary.CountPrecommitMsg, &summary.CountWaitSeed, &summary.CountPoRep, &summary.CountCommitMsg, &summary.CountDone, &summary.CountFailed); err != nil {
return nil, xerrors.Errorf("scan: %w", err)
}
summary.Actor = "f0" + summary.Actor
sactor, err := address.NewIDAddress(uint64(actor))
if err != nil {
return nil, xerrors.Errorf("failed to create actor address: %w", err)
}
summary.Actor = sactor.String()
summaries = append(summaries, summary)
}