-
Notifications
You must be signed in to change notification settings - Fork 168
BM-1900: add VerifierLayeredRouter #1319
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
Conversation
| // Expect exactly 2 calls, to verifier A/B with TEST_RECEIPT_x and TEST_MANGLED_RECEIPT_x. | ||
| vm.expectCall(address(verifierMockA), new bytes(0), 2); | ||
| vm.expectCall(address(verifierMockA), abi.encodeCall(IRiscZeroVerifier.verifyIntegrity, TEST_RECEIPT_A), 1); | ||
| vm.expectCall( | ||
| address(verifierMockA), abi.encodeCall(IRiscZeroVerifier.verifyIntegrity, TEST_MANGLED_RECEIPT_A), 1 | ||
| ); | ||
| vm.expectCall(address(verifierMockB), new bytes(0), 2); | ||
| vm.expectCall(address(verifierMockB), abi.encodeCall(IRiscZeroVerifier.verifyIntegrity, TEST_RECEIPT_B), 1); | ||
| vm.expectCall( | ||
| address(verifierMockB), abi.encodeCall(IRiscZeroVerifier.verifyIntegrity, TEST_MANGLED_RECEIPT_B), 1 | ||
| ); | ||
| layeredRouter.verifyIntegrity(TEST_RECEIPT_A); |
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 it hard to follow the expectCall's here and below.
Its hard to map each call to a specific invocation of verifyIntegrity, and it says we expect 2 calls but there are 6 vm.expectCall invocations.
Any way to split the tests or make it clearer somehow?
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.
So that, specifically vm.expectCall(address(verifierMockA), new bytes(0), 2); is a trick to assess how many calls to expect for that address, in this case 2; then, we assert the actual calls. It's kept it as is so to match the RiscZeroVerifierRouter on the risc0-ethereum repo.
Adds the
VerifierLayeredRoutercontract.It also adds a copy of the
RiscZeroVerifierRouteras we need to add thevirtualproperty to the methods we override. Can be removed once those changes land torisc0-ethereum(risc0/risc0-ethereum#703)