Skip to content

Parse Ogmios protocol ratios instead of evaluating them - #506

Open
SashaMIT wants to merge 1 commit into
Python-Cardano:mainfrom
SashaMIT:codered-ogmios-ratio
Open

SashaMIT wants to merge 1 commit into
Python-Cardano:mainfrom
SashaMIT:codered-ogmios-ratio

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

  • OgmiosV6ChainContext._fetch_protocol_param passed pledge influence, monetary expansion, treasury expansion, and script prices through eval. A value of 1+1 was accepted as 2.
  • Those fields now go through the existing _fraction_parser, which only accepts numerator/denominator. 1/10 is still 0.1, and 721/10000000 is still the memory price.

Test plan

  • pytest test/pycardano/backend/test_ogmios_v6_ratio.py fails on tip (Failed: DID NOT RAISE ValueError for 1+1) and passes after the change (2 passed).

Made with Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant