Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SafeRelevantTransaction default timestamp #2347

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

falvaradorodriguez
Copy link
Contributor

@falvaradorodriguez falvaradorodriguez commented Nov 27, 2024

Sometimes when reindexing a safe, if a missing Tx appears, it is being inserted with the current date instead of the correct date.

This causes an order problem in the all-transactions endpoint.

@falvaradorodriguez falvaradorodriguez marked this pull request as ready for review November 27, 2024 15:09
@falvaradorodriguez falvaradorodriguez requested a review from a team as a code owner November 27, 2024 15:09
@@ -603,7 +603,7 @@ def __process_decoded_transaction(
SafeRelevantTransaction.objects.get_or_create(
ethereum_tx=ethereum_tx,
safe=contract_address,
defaults={"timestamp": ethereum_tx.created},
defaults={"timestamp": ethereum_tx.block.timestamp},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the related field included in the queryset ethereum_tx?
If not this will create a new request to database for each ethereum_tx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed using internal_tx 👍

falvaradorodriguez and others added 2 commits November 27, 2024 16:23
Co-authored-by: Uxío <[email protected]>
Co-authored-by: Uxío <[email protected]>
@falvaradorodriguez falvaradorodriguez self-assigned this Nov 27, 2024
@falvaradorodriguez falvaradorodriguez merged commit 0f50f62 into main Nov 28, 2024
5 checks passed
@falvaradorodriguez falvaradorodriguez deleted the fix-all-transactions-endpoint-order branch November 28, 2024 12:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants