-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(test): Functions foundry tests use OCR contracts & a higher tx.gasprice #10635
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
s_subscriptionId, | ||
5500 | ||
); | ||
/// @dev Overload to give transmitterGasToUse as 0, which gives default tx gas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than before, but still has a lot of repeated code. Is there a better way to structure this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a single _reportAndStore and just pass the required args every time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of repeated code
Like what? The only repeated code I see is the fulfillment data, but I think that's better to not re-use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a single _reportAndStore and just pass the required args every time?
This will make it harder to read & write the test case itself.
If the overloaded function is used, then the args are filled in by it aren't relevant to the test.
I'm open to making this change though if you think it will make it easier to grok
How about having a natspec on the overloaded ones that say what was filled in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would help. I just want to make sure I able to grok everything during review and I got a bit confused during the overloaded funcs
s_subscriptionId, | ||
5500 | ||
); | ||
/// @dev Overload to give transmitterGasToUse as 0, which gives default tx gas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a single _reportAndStore and just pass the required args every time?
entriesAfterRequest2[0].data, | ||
(address, uint64, address, bytes, uint16, bytes32, uint64, FunctionsResponse.Commitment) | ||
function _reportAndStore( | ||
uint256[] memory requestNumberKeys, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is requestNumberKeys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just the internal key for where to find the request in the test environment state s_requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add natspec docs to the helpers if that would help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding the various _reportAndStore()
functions a bit difficult to reason about as I keep having to switch back and forth between Setup.t.sol
and FunctionsRouter.t.sol
to see what each overloaded function is supposed to do.
e2fb10d
to
0e798c5
Compare
0e798c5
to
62bb674
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional comments!
e4682c0
to
e1b7e9a
Compare
SonarQube Quality Gate |
No description provided.