mowblox / emt-marketplace

The goal is to help people become really good at what they do through decentralized mentorship.
https://emt-marketplace.vercel.app
Apache License 2.0
1 stars 3 forks source link

Assertion Error in EMTMarketplace Test #15

Closed mickeymond closed 10 months ago

mickeymond commented 10 months ago

@Jovells Please note and resolve the Assertion Error below image

Jovells commented 10 months ago

This test case is for the scenario where a user has already downvoted and tries to downvote again. The assertion fails because the contract is currently designed to prevent a user from downvoting if they have not previously upvoted, preventing the test case from playing out correctly. So it will automatically pass after that aspect of the contract has been fixed

mickeymond commented 10 months ago

This test case is for the scenario where a user has already downvoted and tries to downvote again. The assertion fails because the contract is currently designed to prevent a user from downvoting if they have not previously upvoted, preventing the test case from playing out correctly. So it will automatically pass after that aspect of the contract has been fixed

@od41 This has to do with our exchange on how the UPVOTE & DOWNVOTE should behave. Whether the TWITTER way or the YOUTUBE way which also goes ahead to influence how the MINTING & BURNING of the MENT reputation token is done when either of the actions are taken. Where are we settling at?

Jovells commented 10 months ago

This test case is for the scenario where a user has already downvoted and tries to downvote again. The assertion fails because the contract is currently designed to prevent a user from downvoting if they have not previously upvoted, preventing the test case from playing out correctly. So it will automatically pass after that aspect of the contract has been fixed

@od41 This has to do with our exchange on how the UPVOTE & DOWNVOTE should behave. Whether the TWITTER way or the YOUTUBE way which also goes ahead to influence how the MINTING & BURNING of the MENT reputation token is done when either of the actions are taken. Where are we settling at?

With regards to that, I have created a flowchart to demonstrate what I have in mind. you can find it here https://whimsical.com/8bQLgJrKtpJgKKLSSy5PFu

posted it in Asana too.

od41 commented 10 months ago

It's the YOUTUBE way. @mickeymond I believe we had settled this on Friday, & @Jovells suggested an approach to implement it.

Finally when calculating the total MENT to be awarded, multiply by the MENT per upvote or downvote before subtracting. For example, content creator gets 10 votes: 7 are Upvotes, 3 are Downvotes.

Reward MENT = (7 x 10) - (3 x 5) = 70-15 => 55 MENT

As opposed to: ~(7-3) x 10 = 4 x 10 = 40 MENT~