zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

Remove `MarketStatus::Suspended`

Open maltekliemann opened this issue 2 years ago • 1 comments

This status is unused and should be removed completely.

maltekliemann avatar Jun 13 '22 08:06 maltekliemann

Note that removing an item from the MarketStatus enum will require a storage migration. This is what the substrate docs say about the encoding of enums:

A fixed number of variants, each mutually exclusive and potentially implying a further value or series of values. Encoded as the first byte identifying the index of the variant that the value is. Any further bytes are used to encode any data that the variant implies. Thus, no more than 256 variants are supported.

So...

#[derive(Clone, Copy, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)]
pub enum MarketStatus {
    Proposed,
    Active,
    Suspended,
    // All of these need to be migrated:
    Closed,
    CollectingSubsidy,
    InsufficientSubsidy,
    Reported,
    Disputed,
    Resolved,
}

maltekliemann avatar Jul 07 '22 10:07 maltekliemann