From 633d00713b83642fa8824189365cb426014ed671 Mon Sep 17 00:00:00 2001 From: acheron Date: Sun, 25 Feb 2024 13:24:59 +0100 Subject: [PATCH] Fully check whether the name is a `Pubkey` to fix `misc` test errors Using instruction names that are 43 or 44 in length causes them to not get converted to camelCase in IDL type. --- cli/src/rust_template.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/rust_template.rs b/cli/src/rust_template.rs index 4614752643..abbf2c359f 100644 --- a/cli/src/rust_template.rs +++ b/cli/src/rust_template.rs @@ -18,6 +18,7 @@ use std::{ io::Write as _, path::Path, process::Stdio, + str::FromStr, }; /// Program initialization template @@ -241,7 +242,7 @@ pub fn idl_ts(idl: &Idl) -> Result { 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; }