-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: Include struct names in ABIs #2266
feat: Include struct names in ABIs #2266
Conversation
The full path should be known when the DefCollector is collecting all the structs in each file in the crate. That is also when the StructType is originally created so you should be able to add a field to it and store the extra file information there. |
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
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.
👍
* master: chore: Reuse workspace target directory in wasm build script (#2312) feat(nargo): Add `--workspace` flag to run commands in every package (#2313) chore(frontend): Replace `ModuleOrigin` with `Location` on `ModuleData` (#2308) fix: Fix 3 parser test cases in parsing (#2284) fix: Require package names to be non-empty (#2293) fix(nargo)!: Remove `-p` short flag from the `--program-dir` flag (#2300) feat: optionally output a debug artifact on compile (#2260) chore: `nargo info` now prints information as a prettified table (#2282) fix(lsp): Pass `--program-dir` to test command from codelens (#2292) fix(nargo): Allow `--program-dir` flag anywhere in a command (#2290) feat: Execute brillig opcodes with constant inputs at compile-time (#2190) feat: Add basic benchmarking (#2213) feat: Include struct names in ABIs (#2266) feat(nargo): Add `--exact` flag to `nargo test` (#2272)
* master: (23 commits) chore: Reuse workspace target directory in wasm build script (#2312) feat(nargo): Add `--workspace` flag to run commands in every package (#2313) chore(frontend): Replace `ModuleOrigin` with `Location` on `ModuleData` (#2308) fix: Fix 3 parser test cases in parsing (#2284) fix: Require package names to be non-empty (#2293) fix(nargo)!: Remove `-p` short flag from the `--program-dir` flag (#2300) feat: optionally output a debug artifact on compile (#2260) chore: `nargo info` now prints information as a prettified table (#2282) fix(lsp): Pass `--program-dir` to test command from codelens (#2292) fix(nargo): Allow `--program-dir` flag anywhere in a command (#2290) feat: Execute brillig opcodes with constant inputs at compile-time (#2190) feat: Add basic benchmarking (#2213) feat: Include struct names in ABIs (#2266) feat(nargo): Add `--exact` flag to `nargo test` (#2272) fix: Fix assignment when both `mut` and `&mut` are used (#2264) feat: Add `assert_constant` (#2242) feat(nargo): Add support for contracts in `nargo check` (#2267) chore(ci): Name wasm job more clearly (#2269) chore(ci): Create cache key with consideration to target (#2273) chore(ci): Run publish workflow against PRs (#2268) ...
Include struct names in the output ABI, which is useful for autogenerating types that follow the same naming.
Related to #2238. It doesn't fix the issue since it'd need the full path to the struct, which I couldn't find on the
StructType
. My guess is there may be a mapping fromCrateId
(part of theStructId
) to files somewhere. Any tips on where to get this info from would be appreciated, and I can try including it in a follow up PR or this one.{ "name": "entrypoint", "functionType": "secret", "isInternal": false, "parameters": [ { "name": "payload", "type": { "kind": "struct", + "name": "EntrypointPayload", "fields": [ { "name": "flattened_args_hashes", "type": { "kind": "array", "length": 4, "type": { "kind": "field" } } },