test: use "expectCall" overload with "count" param#31
Conversation
2c8b0e8 to
96f39de
Compare
There was a problem hiding this comment.
Why not define the count parameter as uint64 in the expect call function parameters? This way, when calling the function with the batch size, the conversion will be handled automatically.
Why not use this function directly in the expect call where the count is 1?
If you choose not to make the change to the function suggested above, I would recommend replacing uint64(1) with just 1.
Because we would have to cast all parameters, e.g.
It wouldn't be handled automatically, no.
Because that's the old
Huh, not sure why I did not write it like that in the first place! Good idea. |
f312c58 to
1653337
Compare
|
@andreivladbrg is this good to merge now? |
1653337 to
2185b4d
Compare
RIght, in this case let's declare |
|
If we do that, we will have issues with Also, defining the Let's stick with |
|
@andreivladbrg - good to merge now? |
I don't think that's correct, there would be no impact on anything.
I cannot think of one. Can you give an example?
IMO there is no reason to stick with |
|
Created this PR #34 to address it |
|
It doesn't make sense to define the type of a variable/ constant based on its use in a particular helper function. To make an analogy - you don't change all door locks in your house because your front door needs to have a particular lock for whatever reason.
When fuzzing the batch size, you would have to cast the call count to
Quite the opposite - no reason to use |
You're right insofar as Solidity does the typecasting implicitly in this case, but as my previous comment explained, doing so would only give us homework in the long haul. Again - we don't define the type of a variable based on its use in a particular helper function (or set of helper functions). |
|
I had a change of heart about this:
There's a whole slew of issues caused by using the I will stick with the |
I'm going to respond with an analogy as well. If you change the doors that the locks are used on, and the locks are no longer compatible, then you'll need to replace the locks than trying to modify the old locks to "work" with the new doors.
It would be made automatically. |
You did not continue the analogy in a clear way, as you did not specify what "doors" you are referring to (non-front-door or front-door, or something in between). Also - why bother with using a non-standard door lock (
that's impossible to know beforehand because of Turing-completeness. |
|
Anyway, for the sake of moving along with this PR, I am happy to concede this point and use However, if we do this, you will have to bear the responsibility for fixing any future issues arising from incompatibilities between |
build: bump prb-test
2185b4d to
bad662d
Compare
test: change "BATCH_SIZE" type to "uint64"
|
@andreivladbrg - I pushed a commit to change the type of I still think this is a mistake because (again) we don't set the type of generic variables like Good to merge now? |
Yes |
Addresses #30.
Note: CI is still failing due to
test_BatchCancelMultiple. This is another bug for which I will create a separate issue.