trident icon indicating copy to clipboard operation
trident copied to clipboard

🐛 [BUG] - Failed to Parse Generics

Open mdulin2 opened this issue 1 year ago • 3 comments

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 avatar Feb 03 '25 17:02 mdulin2

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.

mdulin2 avatar Feb 10 '25 16:02 mdulin2

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.

lukacan avatar Feb 11 '25 09:02 lukacan

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.

mdulin2 avatar Feb 24 '25 19:02 mdulin2