KyberNetwork / smart-contracts

Main smart contracts for Kyber Network, including the main platform contract, reserve contracts etc.
https://kyber.network
MIT License
378 stars 341 forks source link

Add fuzz tests for trade flow #962

Closed manhlx3006 closed 4 years ago

manhlx3006 commented 4 years ago

Wrapped networkSimulator into a function that is triggered from tradeFuzzTests.js file. Can update numberLoops if want to run more trades

ilanDoron commented 4 years ago

ok

so please for assert make it stand out very clear!!!

On Wed, Jul 8, 2020 at 12:27 PM Le Xuan Manh notifications@github.com wrote:

@manhlx3006 commented on this pull request.

In scripts/networkSimulator.js https://github.com/KyberNetwork/smart-contracts/pull/962#discussion_r451407959 :

  • await expectRevert.unspecified(
  • networkProxy.tradeWithHintAndFee(
  • srcAddress,
  • tradeData.srcQty,
  • destAddress,
  • recipientAddress,
  • tradeData.maxDestAmount,
  • tradeData.minConversionRate,
  • taker, // platform wallet
  • tradeData.platformFeeBps,
  • tradeData.hint,
  • {from: taker, value: callValue, gasPrice: gasPrice}
  • )
  • )
  • } else if (errorMessage == "assertion") {
  • await expectRevert.assertion(

I don't have any tests that supposed to assert. But if we can catch some tests that go to this option, it means we should take a look. I will add this to summary message

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KyberNetwork/smart-contracts/pull/962#discussion_r451407959, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNXTBL2XACXY4ZN3UILM5TR2Q3XJANCNFSM4NFZX3GA .