-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add blob fee calc functions #4440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#[test] | ||
fn test_fake_exp() { | ||
for (factor, num, denom, expected) in &[ | ||
(1u64, 0u64, 1u64, 1u64), | ||
(38493, 0, 1000, 38493), | ||
(0, 1234, 2345, 0), | ||
(1, 2, 1, 6), // approximate 7.389 | ||
(1, 4, 2, 6), | ||
(1, 3, 1, 16), // approximate 20.09 | ||
(1, 6, 2, 18), | ||
(1, 4, 1, 49), // approximate 54.60 | ||
(1, 8, 2, 50), | ||
(10, 8, 2, 542), // approximate 540.598 | ||
(11, 8, 2, 596), // approximate 600.58 | ||
(1, 5, 1, 136), // approximate 148.4 | ||
(1, 5, 2, 11), // approximate 12.18 | ||
(2, 5, 2, 23), // approximate 24.36 | ||
(1, 50000000, 2225652, 5709098764), | ||
] { | ||
let res = fake_exponential(U256::from(*factor), U256::from(*num), U256::from(*denom)); | ||
assert_eq!(res, U256::from(*expected)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Codecov Report
... and 7 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0ac8e8c
to
eae7ed1
Compare
closes #4437
adds calc functions as defined https://eips.ethereum.org/EIPS/eip-4844#helpers