Skip to content
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

Return nested arrays in struct from Oracles #5238

Closed
guipublic opened this issue Jun 13, 2024 · 0 comments · Fixed by #5244
Closed

Return nested arrays in struct from Oracles #5238

guipublic opened this issue Jun 13, 2024 · 0 comments · Fixed by #5244
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@guipublic
Copy link
Contributor

Problem

Playing around with complexe structures returned by Oracle calls, I am getting an error when calling the foo_return() oracle call defined below:

type TReturnElem = [Field; 3];
type TReturn = [TReturnElem; 2];
struct TestTypeFoo {
    a: Field,
    b: [[[Field; 3]; 4]; 2],
    c: [TReturnElem; 2],
    d: TReturnElem,
}
#[oracle(foo_return)]
unconstrained fn foo_return() -> (Field, TReturn, TestTypeFoo) {}

The error is Assertion failed: 'Foreign call result array doesn't match expected size'

Happy Case

No error

Project Impact

None

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

Related to issue #4561

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@guipublic guipublic added the enhancement New feature or request label Jun 13, 2024
@guipublic guipublic self-assigned this Jun 13, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jun 13, 2024
@TomAFrench TomAFrench added the bug Something isn't working label Jun 13, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 20, 2024
# Description

## Problem\*

Resolves #5238

## Summary\*
Use nested values when the sizes do not match


## Additional Context



## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants