{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}

module Cardano.Ledger.State.Vector where

import Cardano.Ledger.Coin
import Cardano.Ledger.Credential
import Cardano.Ledger.Keys as Keys
import Cardano.Ledger.State (StakePoolParams)
import Control.DeepSeq
import Data.Map.Strict as Map

data SnapShotM = SnapShotM
  { SnapShotM -> Map (Credential Staking) (CompactForm Coin)
ssStake :: !(Map (Credential Staking) (CompactForm Coin))
  , SnapShotM -> Map (Credential Staking) (KeyHash StakePool)
ssDelegations :: !(Map (Credential Staking) (KeyHash StakePool))
  , SnapShotM -> Map (KeyHash StakePool) StakePoolParams
ssStakePoolParams :: !(Map (KeyHash StakePool) StakePoolParams)
  }

instance NFData SnapShotM where
  rnf :: SnapShotM -> ()
rnf (SnapShotM Map (Credential Staking) (CompactForm Coin)
s Map (Credential Staking) (KeyHash StakePool)
d Map (KeyHash StakePool) StakePoolParams
p) = Map (Credential Staking) (CompactForm Coin)
s Map (Credential Staking) (CompactForm Coin) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Map (Credential Staking) (KeyHash StakePool)
d Map (Credential Staking) (KeyHash StakePool) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Map (KeyHash StakePool) StakePoolParams -> ()
forall a. NFData a => a -> ()
rnf Map (KeyHash StakePool) StakePoolParams
p

data SnapShotsM = SnapShotsM
  { SnapShotsM -> SnapShotM
ssPstakeMark :: !SnapShotM
  , SnapShotsM -> SnapShotM
ssPstakeSet :: !SnapShotM
  , SnapShotsM -> SnapShotM
ssPstakeGo :: !SnapShotM
  , SnapShotsM -> Coin
ssFeeSS :: !Coin
  }

instance NFData SnapShotsM where
  rnf :: SnapShotsM -> ()
rnf (SnapShotsM SnapShotM
r SnapShotM
s SnapShotM
g Coin
f) = SnapShotM
r SnapShotM -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` SnapShotM
s SnapShotM -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` SnapShotM
g SnapShotM -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Coin -> ()
forall a. NFData a => a -> ()
rnf Coin
f