diff --git a/common/rs/src/codec_types.rs b/common/rs/src/codec_types.rs index 82984ff8..76bcc7cb 100644 --- a/common/rs/src/codec_types.rs +++ b/common/rs/src/codec_types.rs @@ -3,7 +3,7 @@ use parity_scale_codec::{Decode, Encode}; use sp_std::{collections::btree_map::BTreeMap, prelude::*}; #[cfg(feature = "ink")] -use codec_types_derive::EmptySpreadLayout; +use codec_types_derive::SpreadLayoutOneStorageCell; #[cfg(feature = "ink")] use ink_storage::traits::PackedLayout; @@ -16,7 +16,7 @@ pub mod mtc { use super::*; #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Emo { pub id: u16, @@ -24,7 +24,7 @@ pub mod mtc { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct GradeAndBoard { pub grade: u8, @@ -32,12 +32,12 @@ pub mod mtc { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Board(pub Vec); #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct BoardEmo { pub mtc_emo_ids: Vec, @@ -46,14 +46,14 @@ pub mod mtc { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Ghost { pub history: Vec, } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct GradeAndGhostBoard { pub grade: u8, @@ -61,12 +61,12 @@ pub mod mtc { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct GhostBoard(pub Vec); #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct GhostBoardEmo { pub base_id: u16, @@ -74,7 +74,7 @@ pub mod mtc { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum GhostState { Active { health: u8 }, @@ -92,17 +92,17 @@ pub mod mtc { use super::*; #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Catalog(pub Vec); #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct CatalogLine(pub Vec); #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum PlayerOperation { Buy { mtc_emo_id: u16, index: u8 }, @@ -121,12 +121,12 @@ pub mod mtc { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct BoardLogs(pub Vec); #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum BoardLog { Add { @@ -170,12 +170,12 @@ pub mod mtc { use super::*; #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Logs(pub Vec); #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Log { Attack { @@ -244,12 +244,12 @@ pub mod emo { use super::*; #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Bases(pub BTreeMap); #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Base { pub id: u16, @@ -262,7 +262,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Typ { Human, @@ -277,7 +277,7 @@ pub mod emo { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct Attributes { pub attack: u16, @@ -290,7 +290,7 @@ pub mod emo { use super::*; #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Ability { Shop(emo::ability::shop::Shop), @@ -306,7 +306,7 @@ pub mod emo { use super::*; #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Shop { Pre(emo::ability::shop::Pre), @@ -320,7 +320,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Pre { Normal(emo::ability::shop::NormalAction), @@ -333,7 +333,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Peri { AsOneself { @@ -355,7 +355,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Special { Placeholder, @@ -367,7 +367,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum PeriAsOneselfTrigger { Set, @@ -383,7 +383,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum PeriAsAllyTrigger { AllySet { @@ -399,7 +399,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum PeriAsAllyAction { OneselfTripleNormal(emo::ability::shop::NormalAction), @@ -412,7 +412,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum NormalAction { SetEmo { @@ -459,7 +459,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum RandomAction { IncreaseStatsOfMenagerie { @@ -479,7 +479,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum AsAllyAction { TriggerSetActions, @@ -495,7 +495,7 @@ pub mod emo { use super::*; #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Battle { General(emo::ability::battle::General), @@ -508,7 +508,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum General { AsOneself { @@ -530,7 +530,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Special { Shield, @@ -544,7 +544,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum GeneralAsOneselfTrigger { Pre, @@ -568,7 +568,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum GeneralAsAllyTrigger { AllySet { @@ -587,7 +587,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum GeneralAsAllyAction { OneselfTripleNormal(emo::ability::battle::NormalAction), @@ -600,7 +600,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum NormalAction { SetEmo { @@ -648,7 +648,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum AsAllyAction { TriggerRetireActions, @@ -661,7 +661,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum TargetOrRandom { Target(emo::ability::Target), @@ -677,7 +677,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Target { Oneself, @@ -693,7 +693,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Destination { Left, @@ -707,7 +707,7 @@ pub mod emo { } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub struct TypOptAndIsTripleOpt { pub typ_opt: Option, @@ -715,7 +715,7 @@ pub mod emo { } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug, Encode, Decode)] - #[cfg_attr(feature = "ink", derive(PackedLayout, EmptySpreadLayout))] + #[cfg_attr(feature = "ink", derive(PackedLayout, SpreadLayoutOneStorageCell))] #[cfg_attr(feature = "ink-std", derive(TypeInfo, StorageLayout))] pub enum Side { Ally,