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

Unable to depend on ic-utils for http_request interface; use of IDLValue in HttpResponse causes candid to panic #203

Open
paulyoung opened this issue Jun 5, 2021 · 0 comments

Comments

@paulyoung
Copy link
Contributor

As mentioned in #201, I was hoping to depend on the http_request interface from ic-utils.

Having worked around that issue I ran into another: Panicked at 'internal error: entered unreachable code' in the candid value parser.

@chenyan-dfinity had some thoughts on how to address this in dfinity/candid#242

Daniel-Bloom-dfinity added a commit to Daniel-Bloom-dfinity/agent-rs that referenced this issue Mar 7, 2022
re: dfinity#221 dfinity#203

Turns out you can actually get around candid's limitation on `IDLValue`. It just takes some careful rejiggering.

First, use `Reserved` to match anything. This seems like a valid use of `Reserved`, and should basically always be supported.

Second, use `deserialize_ignored_any` to actually get all the content with our own visitor (really just a copy of `IDLValueVisitor`). This is a little bit of a hack, but it works.
ericswanson-dfinity pushed a commit that referenced this issue Mar 7, 2022
* feat: Remake tokens generic
re: #221 #203

Turns out you can actually get around candid's limitation on `IDLValue`. It just takes some careful rejiggering.

First, use `Reserved` to match anything. This seems like a valid use of `Reserved`, and should basically always be supported.

Second, use `deserialize_ignored_any` to actually get all the content with `IDLValueVisitor`. This is a little bit of a hack, but it works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant