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

🐛 [BUG] - Failed to Parse Generics #263

Open
mdulin2 opened this issue Feb 3, 2025 · 3 comments
Open

🐛 [BUG] - Failed to Parse Generics #263

mdulin2 opened this issue Feb 3, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@mdulin2
Copy link

mdulin2 commented Feb 3, 2025

Description

I have an Anchor Solana contract that I'm trying to build a fuzzer for. Unfortunately, the templated code gehttps://github.com/wormhole-foundation/native-token-transfersneration is failing when it comes across generics:

Failed to parse ./
example-native-token-transfers/solana/target/idl/example_native_token_transfers.json: invalid type: string "A", expected internally tagged enum IdlTypeDefGeneric at line 2310 column 11

Here is the entry in the IDL that is causing issues.

"types": [
    {
      "name": "NttManagerMessage",
      "generics": [
        "A"
      ],
      ....
    }

Since the code generation did not work, I'm afraid that if I implement all of the necessary functionality myself that the fuzzer will not work as well. I'm okay with implementing the scaffolding myself but want to ensure that it won't be a waste of time.

I tried bringing this up in the Discord but never got a response either.

Reproduction steps

1. Download https://github.com/wormhole-foundation/native-token-transfers. 
2. Install Trident
3. Run `trident fuzz add`. Notice that it fails to generate the templated code.

Reproduction URL

https://github.com/wormhole-foundation/native-token-transfers

Screenshots

Logs

OS

No response

@mdulin2 mdulin2 added the bug Something isn't working label Feb 3, 2025
@mdulin2
Copy link
Author

mdulin2 commented Feb 10, 2025

I mainly want to know if I can run the fuzzer with generics. I can build out the template code that failed but I don't want to do that unless I know that the fuzzer will still work.

@lukacan
Copy link
Collaborator

lukacan commented Feb 11, 2025

Hello, thanks for reporting the issue. You should still be able to fuzz even though Trident could not initialize the template. However, I'm not completely sure —I’ll have a look at the issue.

@mdulin2
Copy link
Author

mdulin2 commented Feb 24, 2025

Okay, thanks! I'll try to get a fuzzer going on some of this stuff but I appreciate you all taking a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants