Skip to content
Discussion options

You must be logged in to vote

@GovindHQ The call should be inside promise.

await new Promise(async (resolve, reject) => {
    lottery.once("WinnerPicked", async function () {
        console.log("wWinnerpicked event fired!");
        try {
            const recentWinner =
                await lottery.getRecentWinner();
            const lotteryState =
                await lottery.getLotteryState();
            const winnerBalance =
                await accounts[0].getBalance();
            const endingTimeStamp =
                await lottery.getLatestTimeStamp();
            await expect(lottery.getPlayer(0)).to.be.reverted;
            assert.equal(
                recentWinner.toString(),
                accounts[0

Replies: 2 comments 3 replies

Comment options

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

@alymurtazamemon
Comment options

Answer selected by GovindHQ
@alymurtazamemon
Comment options

Comment options

You must be logged in to vote
0 replies
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