Lession 7: Lottery, test : test_get_entrance_fee, not getting correct values. #1524
-
Hello, i am not getting correct values for entrance_fee = lot.getEntranceFee()
expected_entrance_fee = Web3.toWei(0.025, "ether")
expected_entrance_fee2 = 25000000000000000
print(entrance_fee)
print(expected_entrance_fee)
print(expected_entrance_fee2)
assert entrance_fee == expected_entrance_fee ===================================
so obviously: function getEntranceFee() public view returns (uint256)
{
(, int256 prize, , , ) = eth_to_usd_price_fee.latestRoundData();
uint256 adjustedPrize = uint256(prize) * 10**10;
USDentryFee = 50 * 10**18;
uint256 costToEnter = (USDentryFee * 10**18) / adjustedPrize;
return costToEnter;
} Which is almost the same as code on github. I am not sure where im making mistake. Any Help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Beta Was this translation helpful? Give feedback.
-
Can you please double check the |
Beta Was this translation helpful? Give feedback.
Can you please double check the
initial_answer
anddecimals
for your aggregator mock? The values should be as follows:initial_answer = 200000000000
decimals = 8