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

cli: Fix shell command failing due to outdated program initialization #3351

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- cli: Use OS-agnostic paths ([#3307](https://github.com/coral-xyz/anchor/pull/3307)).
- avm: Use `rustc 1.79.0` when installing versions older than v0.31 ([#3315](https://github.com/coral-xyz/anchor/pull/3315)).
- cli: Fix priority fee calculation causing panic on localnet ([#3318](https://github.com/coral-xyz/anchor/pull/3318)).
- cli: Fix `shell` command failing due to outdated program initialization ([#3351](https://github.com/coral-xyz/anchor/pull/3351)).

### Breaking

Expand Down
7 changes: 3 additions & 4 deletions cli/src/rust_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
};
use anyhow::Result;
use clap::{Parser, ValueEnum};
use heck::{ToPascalCase, ToSnakeCase};
use heck::{ToLowerCamelCase, ToPascalCase, ToSnakeCase};
use solana_sdk::{
pubkey::Pubkey,
signature::{read_keypair_file, write_keypair_file, Keypair},
Expand Down Expand Up @@ -590,11 +590,10 @@ anchor.setProvider(provider);
write!(
&mut eval_string,
r#"
anchor.workspace.{} = new anchor.Program({}, new PublicKey("{}"), provider);
anchor.workspace.{} = new anchor.Program({}, provider);
"#,
program.name.to_pascal_case(),
program.name.to_lower_camel_case(),
serde_json::to_string(&program.idl)?,
program.program_id
)?;
}

Expand Down
Loading