pop_chains/new_pallet/
new_pallet_options.rs1use clap::ValueEnum;
2use strum_macros::{EnumIter, EnumMessage};
3
4#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage, ValueEnum)]
7pub enum TemplatePalletConfigCommonTypes {
8 #[strum(
10 message = "RuntimeEvent",
11 detailed_message = "This type will enable your pallet to emit events."
12 )]
13 RuntimeEvent,
14 #[strum(
18 message = "RuntimeOrigin",
19 detailed_message = "This type will be helpful if your pallet needs to deal with the outer RuntimeOrigin enum, or if your pallet needs to use custom origins. Note: If you have run the command using -o, this type will be added anyway."
20 )]
21 RuntimeOrigin,
22 #[strum(
24 message = "Currency",
25 detailed_message = "This type will allow your pallet to interact with the native currency of the blockchain."
26 )]
27 Currency,
28}
29
30#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage, ValueEnum)]
32pub enum TemplatePalletStorageTypes {
33 #[strum(
35 message = "StorageValue",
36 detailed_message = "A storage value is a single value of a given type stored on-chain."
37 )]
38 StorageValue,
39 #[strum(
41 message = "StorageMap",
42 detailed_message = "A storage map is a mapping of keys to values of a given type stored on-chain."
43 )]
44 StorageMap,
45 #[strum(
48 message = "CountedStorageMap",
49 detailed_message = "A wrapper around a StorageMap and a StorageValue (with the value being u32) to keep track of how many items are in a map."
50 )]
51 CountedStorageMap,
52 #[strum(
54 message = "StorageDoubleMap",
55 detailed_message = "This structure associates a pair of keys with a value of a specified type stored on-chain."
56 )]
57 StorageDoubleMap,
58 #[strum(
61 message = "StorageNMap",
62 detailed_message = "This structure associates an arbitrary number of keys with a value of a specified type stored on-chain."
63 )]
64 StorageNMap,
65 #[strum(
68 message = "CountedStorageNMap",
69 detailed_message = "A wrapper around a StorageNMap and a StorageValue (with the value being u32) to keep track of how many items are in a map."
70 )]
71 CountedStorageNMap,
72}
73
74#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage)]
77pub enum TemplatePalletOptions {
78 #[strum(
80 message = "DefaultConfig",
81 detailed_message = "Use a default configuration for your config trait."
82 )]
83 DefaultConfig,
84 #[strum(message = "GenesisConfig", detailed_message = "Add a genesis config to your pallet.")]
86 GenesisConfig,
87 #[strum(message = "Custom Origin", detailed_message = "Add a custom origin to your pallet.")]
89 CustomOrigin,
90}