PatrickAlphaC / smartcontract-lottery

MIT License
79 stars 113 forks source link

TypeError: constructor requires no arguments #80

Closed My922 closed 2 years ago

My922 commented 2 years ago

I'm trying to do the test for test_get_entrance_fee, but the test always show: TypeError: constructor requires no arguments

I don't know what's going on.

Here's my test code:

Screen Shot 2022-07-29 at 5 44 31 PM

Here's my sol file:

Screen Shot 2022-07-29 at 5 45 30 PM Screen Shot 2022-07-29 at 5 46 49 PM

And this is the error:

Screen Shot 2022-07-29 at 5 46 21 PM
PatrickAlphaC commented 2 years ago

Can you:

  1. Make this a discusson on the full repo? https://github.com/smartcontractkit/full-blockchain-solidity-course-py/
  2. Follow this section for formatting questions? https://www.youtube.com/watch?t=19846&v=gyMwXuJrbJQ&feature=youtu.be

It looks like your lottery doesn't take constructor arguments (see your constructor function in lottery.sol) and your passing it args (see your line withLottery.deploy()`). Remove those args.

My922 commented 2 years ago

Thank you! problem solved.