Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Add PythErrors.sol #36

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Add PythErrors.sol #36

merged 2 commits into from
Nov 29, 2022

Conversation

ali-behjati
Copy link
Contributor

@ali-behjati ali-behjati commented Nov 25, 2022

Add PythErrors and use them in the contract. This will reduce the contract size significantly.

Based on my changes it reduces current size of the contract (after merging this) from 23.69 to 20.94 KB (The limit is 24 KB)

This change might be considered breaking as people might have already try/catch it and checked the actual message (although unlikely). It's breaking for off-chain consumers such as price pusher. However, since we have not deployed the v2 contract, I consider it minor. Moving forward we should mark our not-deployed changes as alpha or beta. This one is going to be deployed soon and I don't add alpha/beta.

Note: On this PR I also modified parsePriceFeedUpdates in the mock contract to be similar to the actual implementation.

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

this is much better than depending on the error message text also

@ali-behjati
Copy link
Contributor Author

@jayantk yeah definitely. However it is still not very well supported.. I liked it more if I could use it within require and also I could test it in truffle easier (I adopted a custom code to handle it)

@ali-behjati ali-behjati merged commit 11d6bcf into main Nov 29, 2022
@ali-behjati ali-behjati deleted the abehjati/add-errors branch November 29, 2022 12:36
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