-
Notifications
You must be signed in to change notification settings - Fork 244
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
fix: add support for nested arrays returned by oracles #5132
Conversation
Co-authored-by: Álvaro Rodríguez <[email protected]>
🚀 Deployed on https://666ad6247e757b1143f882d4--noir-docs.netlify.app |
Can you add a test case for this? |
I wonder how to unit test Oracles? |
You should be able to use the mock oracle |
Thank you, I added a test using a mock oracle |
We should be able to refactor this so that we remove some duplication on how we're writing arrays into memory. I'm ok taking in some tech debt here however. If we're not handling this in this PR then can you add make an issue to handle this in future? We should add some extra test cases involving nested types including struts however. |
Description
Problem*
Resolves #4561
Summary*
Generates brillig arrays of arrays during brillig-gen for types having nested arrays.
Populate these nested brillig arrays in the brillig VM when data returned from oracles does not match the size of the outer array
Additional Context
For this to work, it is required that the oracle returns flatten values, although its Noir signature is a nested type.
It's certainly possible to deserialise nested json arrays but I could not get it done easily so it'll be better handled in a separate PR.
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.