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

Type 'XXX' does not satisfy the constraint 'Idl'. #3521

Open
AngouNin opened this issue Jan 28, 2025 · 0 comments
Open

Type 'XXX' does not satisfy the constraint 'Idl'. #3521

AngouNin opened this issue Jan 28, 2025 · 0 comments

Comments

@AngouNin
Copy link

AngouNin commented Jan 28, 2025

Hi, everyone.
I am testing my solana contract with anchor.
My anchor version is 2.9.0.
I run "anchor build" and then idl file was generated in /target directory.
But I can see following error in this code.

import * as anchor from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import { PublicKey, SystemProgram } from "@solana/web3.js";
import { expect } from "chai";
import { XXX } from "../target/types/xxx";

describe("initialize_program", () => {
  // Configure the client to use the local cluster or devnet.
  anchor.setProvider(anchor.AnchorProvider.env());
  const program = anchor.workspace.XXX  as Program<XXX>;

So has an error.

Type 'XXX' does not satisfy the constraint 'Idl'.
Type 'XXX' is missing the following properties from type 'Idl': address, metadatats(2344)

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