Skip to content

Commit

Permalink
Fix: contract stats endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jul 16, 2023
1 parent 6f1830b commit 42f14ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/postgres/operation/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ func (storage *Storage) ContractStats(address string) (stats operation.ContractS
Order("timestamp desc").
Limit(1).
Select(&stats.LastAction); err != nil {
return stats, err
if !storage.IsRecordNotFound(err) {
return stats, err
}
}

var sourceLastAction time.Time
Expand All @@ -478,7 +480,9 @@ func (storage *Storage) ContractStats(address string) (stats operation.ContractS
Order("timestamp desc").
Limit(1).
Select(&sourceLastAction); err != nil {
return stats, err
if !storage.IsRecordNotFound(err) {
return stats, err
}
}

if sourceLastAction.After(stats.LastAction) {
Expand Down

0 comments on commit 42f14ad

Please sign in to comment.