-
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
vrfv2plus: Add batch coordinator tests #13497
Conversation
I see you updated files related to |
emit RandomWordsFulfilled(output1.requestId, output1.randomness, s_subId, 800000000000304103, false, true, false); | ||
|
||
// Fulfill the requests. | ||
s_batchCoordinator.fulfillRandomWords(proofs, rcs); |
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 trying to understand what this test is supposed to check in the end. If it's supposed to check that fulfillRandomWords
will not revert, then it's fine. But if it's supposed to check the expected state caused by calling the fulfillRandomWords
function, then I guess checking the subscription balance might be the best one to check?
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.
To be honest, the main motivation for the test is to have some code from the test to trigger the fulfillRandomWords
so that I can get its gas usage. 😅
So right now, the assertion is quite minimal and it just asserts that the 2 requests are fulfilled.
On hindsight, I don't think we should be doing extensive assertions here as well, as subscription balances check should be done by the coordinator itself. The batch coordinator's job is just to proxy over to the coordinator and fulfill multiple requests. We could do those checks here as well but it will really be a redundant check already covered by the coordinator. If the logic were to change, then we'll need to fix multiple places as well.
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.
LGTM
Quality Gate passedIssues Measures |
* -sender 0x2f1c0761d6e4b1e5f01968d6c746f695e5f3e25d \ | ||
* -native-payment false | ||
*/ | ||
function _printGenerateProofV2PlusCommand( |
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.
nice 👍
No description provided.