Skip to content

Lesson 7: Incorrect Decimals? 06:29:31 #498

Answered by cromewar
abdulrabbani00 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually my bad I was expecting another zero, but as your code does not have it, the 0.014 might be correct so the error is not by that side, the eth price for 50$ is 0.012, so your test would pass setting them bellow and above that number, however the entrance fee is returning a bigger number as it's not converting the floating numbers. Anyways you will change that test later on the course as is just intended to be used on local networks,

I have a workaround for you, don't use to Wei for this test, use just numbers (your know 11 * 10.... and 14*10...). let us know it this works for you.

This is how the function will like later:

def test_get_entrance_fee():
    if network.show_active() not 

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@abdulrabbani00
Comment options

@cromewar
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants