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

Remove price calculation #1762

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Remove price calculation #1762

merged 2 commits into from
Nov 23, 2023

Conversation

moisses89
Copy link
Member

Closes #1758

@moisses89 moisses89 force-pushed the remove_price_service branch from c9640a7 to 225cdc9 Compare November 17, 2023 13:14
@moisses89 moisses89 force-pushed the remove_price_service branch from 47fb133 to dacb44b Compare November 22, 2023 09:40
@moisses89 moisses89 marked this pull request as ready for review November 22, 2023 09:45
@moisses89 moisses89 requested a review from a team as a code owner November 22, 2023 09:45
@moisses89
Copy link
Member Author

@Uxio0 this shouln´t be included on the next release until 30th November but could be in staging until that day.

@@ -72,6 +67,11 @@ def get_price_address(self) -> ChecksumAddress:
return self.token_address


class FiatCode(Enum):
USD = 1
EUR = 2
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this Enum class while we keep balance with price. I think that we should do this in other issue because this needs to be coordinated with clients, for example safe-client-gateway.

round(123.4 * 0.4 * (tokens_value / 1e18), 4),
round(123.4 * 0.4, 4),
0.0,
datetime.datetime.utcfromtimestamp(0),
Copy link
Member Author

Choose a reason for hiding this comment

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

From clients atre expected a date, how we cannot say when was calculated I decided to put epoch 0.

0.0,
datetime.utcfromtimestamp(0),
0.0,
0.0,
FiatCode.USD.name,
)
Copy link
Member Author

Choose a reason for hiding this comment

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

@hectorgomezv just to inform you, the transaction service will return eth_value as 0, timestamp when was calculated as 1970-01... (epoch 0), fiat_balance 0 and fiat_conversion as 0.
This is affecting the endpoint /v1/safes/{address}/balances/usd/

Copy link
Member

Choose a reason for hiding this comment

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

Thank you @moisses89! No problem at all from the CGW perspective, the service is not using that endpoint anymore.

@moisses89 moisses89 merged commit 9f1e316 into master Nov 23, 2023
5 checks passed
@moisses89 moisses89 deleted the remove_price_service branch November 23, 2023 13:42
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2023
@Uxio0 Uxio0 added the breaking_change Breaking Change label Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking_change Breaking Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove price calculation from tx service
3 participants