Cyfrin / foundry-smart-contract-lottery-cu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setUp failed reason="You have an active broadcast already."

psych2go opened this issue · comments

When testing an error occured.
command: forge test
error:

2023-07-25T14:32:44.344858Z ERROR forge::runner: setUp failed reason="You have an active broadcast already." contract=0x34a1d3fff3958843c43ad80f30b94c510645c316

Running 1 test for test/unit/RaffleTest.t.sol:RaffleTest
[FAIL. Reason: Setup failed: You have an active broadcast already.] setUp() (gas: 0)
Test result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 4.74ms
Ran 1 test suites: 0 tests passed, 1 failed, 0 skipped (1 total tests)

Failing tests:
Encountered 1 failing test in test/unit/RaffleTest.t.sol:RaffleTest
[FAIL. Reason: Setup failed: You have an active broadcast already.] setUp() (gas: 0)

Encountered a total of 1 failing tests, 0 tests succeeded

How I fix it?

I put the "vm.stopBroadcast();" in the wrong place!