pop_chains/new_pallet/
new_pallet_options.rs1use clap::ValueEnum;
2use serde::Serialize;
3use strum_macros::{EnumIter, EnumMessage};
4
5#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage, ValueEnum, Serialize)]
8pub enum TemplatePalletConfigCommonTypes {
9 #[strum(
11 message = "RuntimeEvent",
12 detailed_message = "This type will enable your pallet to emit events."
13 )]
14 RuntimeEvent,
15 #[strum(
19 message = "RuntimeOrigin",
20 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."
21 )]
22 RuntimeOrigin,
23 #[strum(
25 message = "Currency",
26 detailed_message = "This type will allow your pallet to interact with the native currency of the blockchain."
27 )]
28 Currency,
29}
30
31#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage, ValueEnum, Serialize)]
33pub enum TemplatePalletStorageTypes {
34 #[strum(
36 message = "StorageValue",
37 detailed_message = "A storage value is a single value of a given type stored on-chain."
38 )]
39 StorageValue,
40 #[strum(
42 message = "StorageMap",
43 detailed_message = "A storage map is a mapping of keys to values of a given type stored on-chain."
44 )]
45 StorageMap,
46 #[strum(
49 message = "CountedStorageMap",
50 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."
51 )]
52 CountedStorageMap,
53 #[strum(
55 message = "StorageDoubleMap",
56 detailed_message = "This structure associates a pair of keys with a value of a specified type stored on-chain."
57 )]
58 StorageDoubleMap,
59 #[strum(
62 message = "StorageNMap",
63 detailed_message = "This structure associates an arbitrary number of keys with a value of a specified type stored on-chain."
64 )]
65 StorageNMap,
66 #[strum(
69 message = "CountedStorageNMap",
70 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."
71 )]
72 CountedStorageNMap,
73}
74
75#[derive(Debug, Copy, Clone, PartialEq, EnumIter, EnumMessage)]
78pub enum TemplatePalletOptions {
79 #[strum(
81 message = "DefaultConfig",
82 detailed_message = "Use a default configuration for your config trait."
83 )]
84 DefaultConfig,
85 #[strum(message = "GenesisConfig", detailed_message = "Add a genesis config to your pallet.")]
87 GenesisConfig,
88 #[strum(message = "Custom Origin", detailed_message = "Add a custom origin to your pallet.")]
90 CustomOrigin,
91}