Skip to content

Lesson 9: [FAIL. Reason: expected an emit, but no logs were emitted afterwards. you might have mismatched events or not enough events were emitted] #1982

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

You must be logged in to vote
function testFulfillRandomWordsPicksWinnerResetsAndSendsMoney() public RaffleEnteredAndTimePassed() {
        //Arrange
        uint256 startingIndex = 1;
        uint256 Entrants = 5;
        uint256 recentTimeStamp = lottery.getLastTimeStamp();

        for(uint256 i = startingIndex; i < startingIndex + Entrants; i++) {
            address player = address(uint160(i));
            hoax(player, STARTING_BALANCE);
            lottery.enterLottery{value: ENTERANCE_FEE}();
        }


        uint256 prize = ENTERANCE_FEE * (Entrants + 1);

        vm.recordLogs();
        lottery.performUpkeep("");
        Vm.Log[] memory entries = vm.getRecordedLogs();
        bytes32 requestId = entries[1].

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Chinwuba22
Comment options

@Ifra001
Comment options

@EngrPips
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

@EngrPips
Comment options

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