Skip to content

Rename program module from anchor_test to pythexample - #168

Merged
mikemaccana merged 1 commit into
mainfrom
claude/quirky-bardeen-xadv0c
Sep 29, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/quirky-bardeen-xadv0c

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Summary

Renamed the #[program] module from anchor_test to pythexample in 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

  • Renamed #[program] pub mod anchor_test to #[program] pub mod pythexample in both basics/pyth/anchor-v1/programs/pythexample/src/lib.rs and basics/pyth/anchor/programs/pythexample/src/lib.rs
  • Updated CHANGELOG entries documenting the fix in both versions

Details

Anchor generates IDL files named after the #[program] module name. The module was incorrectly named anchor_test while the crate is named pythexample, causing the IDL to be written to target/idl/anchor_test.json. Surfpool 1.6 expects the IDL at target/idl/pythexample.json when deploying the program during anchor 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

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
@mikemaccana
mikemaccana merged commit 8679a5c into main Sep 29, 2026
24 checks passed
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

Successfully merging this pull request may close these issues.

1 participant