瀏覽代碼

: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]
 #[account]
 #[bolt_account(component_id = "{}")]
 #[bolt_account(component_id = "{}")]
-#[derive(Copy)]
 pub struct {} {{
 pub struct {} {{
     pub x: i64,
     pub x: i64,
     pub y: i64,
     pub y: i64,
     pub z: i64,
     pub z: i64,
+    #[max_len(20)]
+    pub description: String,
 }}
 }}
 "#,
 "#,
             anchor_cli::rust_template::get_or_create_program_id(name),
             anchor_cli::rust_template::get_or_create_program_id(name),
@@ -104,6 +105,8 @@ pub struct Position {{
     pub x: i64,
     pub x: i64,
     pub y: i64,
     pub y: i64,
     pub z: i64,
     pub z: i64,
+    #[max_len(20)]
+    pub description: String,
 }}
 }}
 "#,
 "#,
             anchor_cli::rust_template::get_or_create_program_id(name),
             anchor_cli::rust_template::get_or_create_program_id(name),