diff --git a/codama-korok-visitors/src/identify_field_types_visitor.rs b/codama-korok-visitors/src/identify_field_types_visitor.rs index ceded95..7d635bf 100644 --- a/codama-korok-visitors/src/identify_field_types_visitor.rs +++ b/codama-korok-visitors/src/identify_field_types_visitor.rs @@ -61,6 +61,9 @@ pub fn get_type_node(ty: &syn::Type) -> Option { ("" | "solana_sdk::pubkey" | "solana_program" | "solana_pubkey", "Pubkey", []) => { Some(PublicKeyTypeNode::new().into()) } + ("" | "solana_address" | "solana_address::address", "Address", []) => { + Some(PublicKeyTypeNode::new().into()) + } ("" | "std::string", "String", []) => Some( SizePrefixTypeNode::new(StringTypeNode::utf8(), NumberTypeNode::le(U32)).into(), ), diff --git a/codama-korok-visitors/tests/identify_field_types_visitor/public_key_type_node.rs b/codama-korok-visitors/tests/identify_field_types_visitor/public_key_type_node.rs index 5b62928..011f4b6 100644 --- a/codama-korok-visitors/tests/identify_field_types_visitor/public_key_type_node.rs +++ b/codama-korok-visitors/tests/identify_field_types_visitor/public_key_type_node.rs @@ -21,4 +21,17 @@ fn it_identifies_pubkey_types() { Some(PublicKeyTypeNode::new().into()) ); assert_eq!(get_node_from_type(quote! { Pubkey }), None); + assert_eq!( + get_node_from_type(quote! { Address }), + Some(PublicKeyTypeNode::new().into()) + ); + assert_eq!( + get_node_from_type(quote! { solana_address::Address }), + Some(PublicKeyTypeNode::new().into()) + ); + assert_eq!( + get_node_from_type(quote! { solana_address::address::Address }), + Some(PublicKeyTypeNode::new().into()) + ); + assert_eq!(get_node_from_type(quote! { Address }), None); }