Skip to content

Commit

Permalink
Fully check whether the name is a Pubkey to fix misc test errors
Browse files Browse the repository at this point in the history
Using instruction names that are 43 or 44 in length causes them to not get converted to camelCase in IDL type.
  • Loading branch information
acheroncrypto committed Feb 25, 2024
1 parent 086e3af commit 633d007
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/src/rust_template.rs
Expand Up @@ -18,6 +18,7 @@ use std::{
io::Write as _,
path::Path,
process::Stdio,
str::FromStr,
};

/// Program initialization template
Expand Down Expand Up @@ -241,7 +242,7 @@ pub fn idl_ts(idl: &Idl) -> Result<String> {
let name = cur.get(1).unwrap().as_str();

// Do not modify pubkeys
if matches!(name.len(), 43 | 44) {
if Pubkey::from_str(name).is_ok() {
return acc;
}

Expand Down

0 comments on commit 633d007

Please sign in to comment.