Ad
  • Default User Avatar

    Im new to Solidity and im getting these error, "expected 300000000000000000 to equal 200000000000000000. The numerical values of the given "ethers.BigNumber" and "ethers.BigNumber" inputs were compared, and they differed.",
    where i could be the problem
    "expected 76025 to be below 75000. The numerical values of the given "ethers.BigNumber" and "number" inputs were compared, and they differed.", where i could optimize ?

  • Custom User Avatar

    Thanks for your feedback. Function argument having a uint type rules out the negative indexes. Trying to pass a negative number as a uint would not event reach a contract, it would fail on hardhat level. However I admit that I do not check if the user has modified any of the required method signatures by e.g. changing the uint to int. Added the test checking if the interface is left unmodified.

  • Custom User Avatar

    For get function, you may have a negative index, therefore, it should be invalid (because formally negative indexes shouldn't work in Solidity) and the call must be reverted. However, there's no check for the negatives, and my solution, despite not having them either, passes all the tests.

    Either write in the description that the input _input will be non-negative or add some negative indexes to the tests, please. (if strictly, I would propose to add float numerals and/or non-numerals, but I couldn't find any info about receiving the type of the variable. =/)

    Other than that, this kata is great, hope it will get out of the Beta ^.^

  • Custom User Avatar

    Of course. Fixed.

  • Custom User Avatar

    Thanks for the feedback, added some additional tests, also for the case of getting an item with a non-existing index.

  • Custom User Avatar

    Trying to get an item from an empty queue should revert.

    This is not tested.

  • Custom User Avatar

    Initial code has contract WaitingListInitial but the required contract name is WaitingList, so it should be contract WaitingList.