From be31bc59fc782e15418c6457681ada6e2bbc341f Mon Sep 17 00:00:00 2001 From: acheron Date: Fri, 8 Nov 2024 11:44:38 +0100 Subject: [PATCH] cli: Fix `shell` command failing due to outdated program initialization --- cli/src/rust_template.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/src/rust_template.rs b/cli/src/rust_template.rs index a1e7b127a3..a8c954bf64 100644 --- a/cli/src/rust_template.rs +++ b/cli/src/rust_template.rs @@ -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}, @@ -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 )?; }