Эх сурвалжийг харах

:sparkles: Add strings to the template (#2)

Gabriele Picco 1 жил өмнө
parent
commit
403a395b1b

+ 4 - 1
cli/src/rust_template.rs

@@ -53,11 +53,12 @@ pub mod {} {{
 
 #[account]
 #[bolt_account(component_id = "{}")]
-#[derive(Copy)]
 pub struct {} {{
     pub x: i64,
     pub y: i64,
     pub z: i64,
+    #[max_len(20)]
+    pub description: String,
 }}
 "#,
             anchor_cli::rust_template::get_or_create_program_id(name),
@@ -104,6 +105,8 @@ pub struct Position {{
     pub x: i64,
     pub y: i64,
     pub z: i64,
+    #[max_len(20)]
+    pub description: String,
 }}
 "#,
             anchor_cli::rust_template::get_or_create_program_id(name),