Skip to content

Commit

Permalink
defaults for the string
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed May 28, 2023
1 parent f1f2f2e commit 4fc4c93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/eventindexer/repo/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ func (r *StatRepository) Save(ctx context.Context, opts eventindexer.SaveStatOpt
return nil, errors.Wrap(err, "r.db.gormDB.FirstOrCreate")
}

if s.AverageProofReward == "" {
s.AverageProofReward = "0"
}

if s.AverageProofTime == "" {
s.AverageProofTime = "0"
}

if opts.ProofReward != nil {
s.NumVerifiedBlocks++
s.AverageProofReward = opts.ProofReward.String()
Expand Down

0 comments on commit 4fc4c93

Please sign in to comment.