Issue [#446] remove duplicate data transaction history graph (#413)

This commit is contained in:
walker-16 2023-06-15 13:01:57 -03:00 committed by GitHub
parent 9381695d37
commit 97946d5a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -589,6 +589,19 @@ func (r *Repository) GetTransactionCount(ctx context.Context, q *TransactionCoun
}
response = append(response, row)
}
// [QA] The transaction history graph shows the current data twice when filtered by 1W
// https://github.com/wormhole-foundation/wormhole-explorer/issues/406
for i := range response {
if i > 0 {
if q.TimeSpan == "1w" || q.TimeSpan == "1mo" {
response[i].Time = response[i].Time.AddDate(0, 0, -1)
} else if q.TimeSpan == "1d" {
response[i].Time = response[i].Time.Add(-1 * time.Hour)
}
}
}
return response, nil
}