Преглед на файлове

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

Gabriele Picco преди 1 година
родител
ревизия
403a395b1b
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      cli/src/rust_template.rs

+ 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),