0

Here is my idl:

use solana_idlgen::idlgen;
idlgen!({

    "version": "0.1.0",
    "name": "wba_prereq",
    "instructions": [
        {
            "name": "complete",
            "accounts": [
                {
                    "name": "signer",
                    "isMut": true,
                    "isSigner": true
                },
                {
                    "name": "prereq",
                    "isMut": true,
                    "isSigner": false
                },
                {
                    "name": "systemProgram",
                    "isMut": false,
                    "isSigner": false
                }
            ],
            "args": [
                {
                    "name": "github",
                    "type": "bytes"
                }
            ]
        },
        {
            "name": "update",
            "accounts": [
                {
                    "name": "signer",
                    "isMut": true,
                    "isSigner": true
                },
                {
                    "name": "prereq",
                    "isMut": true,
                    "isSigner": false
                },
                {
                    "name": "systemProgram",
                    "isMut": false,
                    "isSigner": false
                }
            ],
            "args": [
                {
                    "name": "github",
                    "type": "bytes"
                }
            ]
        }
    ],
    "accounts": [
        {
            "name": "PrereqAccount",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "github",
                        "type": "bytes"
                    },
                    {
                        "name": "key",
                        "type": "publicKey"
                    }
                ]
            }
        }
    ],
    "errors": [
        {
            "code": 6000,
            "name": "InvalidGithubAccount",
            "msg": "Invalid Github account"
        }
    ],

    "metadata": {
        "address": "HC2oqz2p6DEWfrahenqdq2moUcga9c9biqRBcdK3XKU1"
    }
});

When I run anchor build for my project, I face the following issues:

error[E0599]: no method named try_to_vec found for reference &UpdateArgs in the current scope
  --> src/programs/wba_prereq.rs:3:1
   |
3  |   idlgen!({
   |  _^
4  | |
5  | |     "version": "0.1.0",
6  | |     "name": "wba_prereq",
...  |
89 | |     }
90 | | });
   | |__^ method not found in &UpdateArgs``

This is cargo.toml:

[package]
name = "airdrop-rust"
version = "0.1.0"
edition = "2021"

[dependencies]
solana-sdk = "1.17.6"
bs58 = "0.5.0"
solana-client = "1.17.6"
solana-program = "1.17.6"
borsh = "1.0.0"
solana-idlgen = { git = "https://github.com/deanmlittle/solana-idlgen.git" }

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.