Skip to content

Problem with test FundMe.sol // [FAIL: assertion failed: 6 != 4] testPriceFeedVersionIsAccurate() (gas: 18905) #2597

Answered by EngrPips
pollersan asked this question in Q&A
Discussion options

You must be logged in to vote

What I did was modify that part of the code so the RPC works depending on the network I'm using, which helps me avoid the error. I really appreciate your response; I just wanted to make sure I wasn't missing anything.

Code updated for me:

    function testPriceFeedVersionIsAccurate() public {
        uint256 version = fundMe.getVersion();
           uint256 expectedVersion; // Cambiar a uint256

    if (block.chainid == 11155111) { // Sepolia
        expectedVersion = 4; // Adjust version for Sepolia
    } else if (block.chainid == 1) { // Mainnet
        expectedVersion = 6; // Adjust version for Mainnet
    } else if (block.chainid == 31337) { // Anvil
        expectedVersion = 4; // A…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@pollersan
Comment options

@EngrPips
Comment options

@pollersan
Comment options

@EngrPips
Comment options

Answer selected by pollersan
@liumOazed
Comment options

@EngrPips
Comment options

@liumOazed
Comment options

@EngrPips
Comment options

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