We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1cb54f commit 2b5b78eCopy full SHA for 2b5b78e
1 file changed
lang/attribute/program/src/declare_program/mods/constants.rs
@@ -13,6 +13,13 @@ pub fn gen_constants_mod(idl: &Idl) -> proc_macro2::TokenStream {
13
let (ty, val) = match &c.ty {
14
IdlType::Bytes => (quote!(&[u8]), quote! { &#val }),
15
IdlType::String => (quote!(&str), val),
16
+ IdlType::Pubkey => {
17
+ let pubkey_str = c.value.to_string();
18
+ (
19
+ quote!(anchor_lang::prelude::Pubkey),
20
+ quote!(anchor_lang::prelude::Pubkey::from_str_const(#pubkey_str)),
21
+ )
22
+ }
23
_ => (convert_idl_type_to_syn_type(&c.ty).to_token_stream(), val),
24
};
25
0 commit comments