Skip to content

Commit

Permalink
cli: Fix shell command failing due to outdated program initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Nov 8, 2024
1 parent 0109f4a commit be31bc5
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit be31bc5

Please sign in to comment.