Rename program module from anchor_test to pythexample - #168
Merged
Merged
Conversation
The Anchor v1 job has failed on basics/pyth/anchor-v1 since Surfpool 1.6.0 became the latest release (passed on 1.5.0 on Sept 14, failed Sept 21 and Sept 23). `anchor test` stopped at "Surfpool startup failed: Runbook execution failed" before any test ran. The #[program] module was called `anchor_test`, so the IDL's metadata.name was `anchor_test` and Anchor wrote it to target/idl/anchor_test.json. Surfpool 1.6 deploys each program at startup through a runbook that reads target/idl/<program>.json, i.e. target/idl/pythexample.json, which did not exist. Pyth was the only anchor-v1 project whose module name differed from its crate's lib name. Rename the module to `pythexample` in both copies, keeping the Anchor v2 copy in step with v1. Nothing else refers to the old name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X69iLEdcB8g5Pc4QccCsri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renamed the
#[program]module fromanchor_testtopythexamplein both Anchor v1 and v0 versions of the Pyth example program to match the crate name and ensure the generated IDL file is named correctly.Changes
#[program] pub mod anchor_testto#[program] pub mod pythexamplein bothbasics/pyth/anchor-v1/programs/pythexample/src/lib.rsandbasics/pyth/anchor/programs/pythexample/src/lib.rsDetails
Anchor generates IDL files named after the
#[program]module name. The module was incorrectly namedanchor_testwhile the crate is namedpythexample, causing the IDL to be written totarget/idl/anchor_test.json. Surfpool 1.6 expects the IDL attarget/idl/pythexample.jsonwhen deploying the program duringanchor test, resulting in a "Runbook execution failed" error before any tests could run. This change aligns the module name with the crate name to fix the IDL generation.https://claude.ai/code/session_01X69iLEdcB8g5Pc4QccCsri