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] Anchor IDL not showing for program #316

Open
mcintyre94 opened this issue Jan 22, 2024 · 0 comments · May be fixed by #317
Open

[Bug] Anchor IDL not showing for program #316

mcintyre94 opened this issue Jan 22, 2024 · 0 comments · May be fixed by #317
Assignees
Labels
bug Something isn't working

Comments

@mcintyre94
Copy link
Collaborator

Describe the bug

A user asked on stackexchange why their anchor IDL doesn't show up on our Explorer: https://solana.stackexchange.com/questions/9569/idls-explorers-curiosity

Explorer link to their program: https://explorer.solana.com/address/propm845StqEBV57ZSnTe8EW8duzAxo5p7h4inhibXV?cluster=devnet

I took a look at Explorer and I think the code that fetches the IDL is this:

export function useAnchorProgram(programAddress: string, url: string): Program | null {
const key = `${programAddress}-${url}`;
const cacheEntry = cachedAnchorProgramPromises[key];
if (cacheEntry === undefined) {
const promise = Program.at(
programAddress,
new Provider(new Connection(url), new NodeWallet(Keypair.generate()), {})
)
.then(program => {
cachedAnchorProgramPromises[key] = {
__type: 'result',
result: program,
};
})
.catch(_ => {
cachedAnchorProgramPromises[key] = { __type: 'result', result: null };
});
cachedAnchorProgramPromises[key] = {
__type: 'promise',
promise,
};
throw promise;
} else if (cacheEntry.__type === 'promise') {
throw cacheEntry.promise;
}
return cacheEntry.result;
}

I put a debugger on line 26 and viewed the reported program on devnet, and got an error "Tuple enum variants not yet implemented."
Screenshot 2024-01-22 at 11 15 15

Their IDL does work on solscan: https://solscan.io/account/propm845StqEBV57ZSnTe8EW8duzAxo5p7h4inhibXV?cluster=devnet#anchorProgramIDL

It also has a suspicious looking enum field:
Screenshot 2024-01-22 at 11 22 47

I'm guessing we need to update our version of Anchor to parse the newest IDLs

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://explorer.solana.com/address/propm845StqEBV57ZSnTe8EW8duzAxo5p7h4inhibXV?cluster=devnet, No Anchor IDL
  2. Go to https://solscan.io/account/propm845StqEBV57ZSnTe8EW8duzAxo5p7h4inhibXV?cluster=devnet#anchorProgramIDL, Anchor IDL displays

Example Links

Expected behavior

Show the Anchor IDL on this program!

@mcintyre94 mcintyre94 added the bug Something isn't working label Jan 22, 2024
@mcintyre94 mcintyre94 self-assigned this Jan 22, 2024
@mcintyre94 mcintyre94 linked a pull request Jan 22, 2024 that will close this issue
@mcintyre94 mcintyre94 changed the title [Bug] Anchor IDL not showing for program on devnet [Bug] Anchor IDL not showing for program Jan 23, 2024
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

Successfully merging a pull request may close this issue.

1 participant