{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
module Cardano.Ledger.Shelley.RewardProvenance (
RewardProvenance (..),
RewardProvenancePool (..),
Desirability (..),
)
where
import Cardano.Ledger.BaseTypes (BlocksMade (..))
import Cardano.Ledger.Binary (DecCBOR (..), EncCBOR (..))
import Cardano.Ledger.Binary.Coders
import Cardano.Ledger.Coin (Coin (..))
import Cardano.Ledger.Crypto
import Cardano.Ledger.Keys (KeyHash (..), KeyRole (..))
import Cardano.Ledger.PoolParams (PoolParams (..))
import Control.DeepSeq (NFData)
import Data.Aeson (FromJSON, ToJSON)
import Data.Default (Default (..))
import Data.Map.Strict (Map)
import Data.Word (Word64)
import GHC.Generics
import NoThunks.Class (NoThunks (..))
import Numeric.Natural (Natural)
data RewardProvenancePool c = RewardProvenancePool
{ forall c. RewardProvenancePool c -> Natural
poolBlocksP :: !Natural
, forall c. RewardProvenancePool c -> Rational
sigmaP :: !Rational
, forall c. RewardProvenancePool c -> Rational
sigmaAP :: !Rational
, forall c. RewardProvenancePool c -> Coin
ownerStakeP :: !Coin
, forall c. RewardProvenancePool c -> PoolParams c
poolParamsP :: !(PoolParams c)
, forall c. RewardProvenancePool c -> Rational
pledgeRatioP :: !Rational
, forall c. RewardProvenancePool c -> Coin
maxPP :: !Coin
, forall c. RewardProvenancePool c -> Rational
appPerfP :: !Rational
, forall c. RewardProvenancePool c -> Coin
poolRP :: !Coin
, forall c. RewardProvenancePool c -> Coin
lRewardP :: !Coin
}
deriving (RewardProvenancePool c -> RewardProvenancePool c -> Bool
forall c. RewardProvenancePool c -> RewardProvenancePool c -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RewardProvenancePool c -> RewardProvenancePool c -> Bool
$c/= :: forall c. RewardProvenancePool c -> RewardProvenancePool c -> Bool
== :: RewardProvenancePool c -> RewardProvenancePool c -> Bool
$c== :: forall c. RewardProvenancePool c -> RewardProvenancePool c -> Bool
Eq, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall c x.
Rep (RewardProvenancePool c) x -> RewardProvenancePool c
forall c x.
RewardProvenancePool c -> Rep (RewardProvenancePool c) x
$cto :: forall c x.
Rep (RewardProvenancePool c) x -> RewardProvenancePool c
$cfrom :: forall c x.
RewardProvenancePool c -> Rep (RewardProvenancePool c) x
Generic)
instance NoThunks (RewardProvenancePool c)
instance NFData (RewardProvenancePool c)
deriving instance Crypto c => FromJSON (RewardProvenancePool c)
deriving instance Crypto c => ToJSON (RewardProvenancePool c)
instance Crypto c => Default (RewardProvenancePool c) where
def :: RewardProvenancePool c
def = forall c.
Natural
-> Rational
-> Rational
-> Coin
-> PoolParams c
-> Rational
-> Coin
-> Rational
-> Coin
-> Coin
-> RewardProvenancePool c
RewardProvenancePool Natural
0 Rational
0 Rational
0 (Integer -> Coin
Coin Integer
0) forall a. Default a => a
def Rational
0 (Integer -> Coin
Coin Integer
0) Rational
0 (Integer -> Coin
Coin Integer
0) (Integer -> Coin
Coin Integer
0)
data Desirability = Desirability
{ Desirability -> Double
desirabilityScore :: !Double
, Desirability -> Double
hitRateEstimate :: !Double
}
deriving (Desirability -> Desirability -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Desirability -> Desirability -> Bool
$c/= :: Desirability -> Desirability -> Bool
== :: Desirability -> Desirability -> Bool
$c== :: Desirability -> Desirability -> Bool
Eq, Int -> Desirability -> ShowS
[Desirability] -> ShowS
Desirability -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Desirability] -> ShowS
$cshowList :: [Desirability] -> ShowS
show :: Desirability -> String
$cshow :: Desirability -> String
showsPrec :: Int -> Desirability -> ShowS
$cshowsPrec :: Int -> Desirability -> ShowS
Show, forall x. Rep Desirability x -> Desirability
forall x. Desirability -> Rep Desirability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Desirability x -> Desirability
$cfrom :: forall x. Desirability -> Rep Desirability x
Generic)
instance NoThunks Desirability
instance NFData Desirability
data RewardProvenance c = RewardProvenance
{ forall c. RewardProvenance c -> Word64
spe :: !Word64
, forall c. RewardProvenance c -> BlocksMade c
blocks :: !(BlocksMade c)
, forall c. RewardProvenance c -> Coin
maxLL :: !Coin
, forall c. RewardProvenance c -> Coin
deltaR1 :: !Coin
, forall c. RewardProvenance c -> Coin
deltaR2 :: !Coin
, forall c. RewardProvenance c -> Coin
r :: !Coin
, forall c. RewardProvenance c -> Coin
totalStake :: !Coin
, forall c. RewardProvenance c -> Integer
blocksCount :: !Integer
, forall c. RewardProvenance c -> Rational
d :: !Rational
, forall c. RewardProvenance c -> Integer
expBlocks :: !Integer
, forall c. RewardProvenance c -> Rational
eta :: !Rational
, forall c. RewardProvenance c -> Coin
rPot :: !Coin
, forall c. RewardProvenance c -> Coin
deltaT1 :: !Coin
, forall c. RewardProvenance c -> Coin
activeStake :: !Coin
, forall c.
RewardProvenance c
-> Map (KeyHash 'StakePool c) (RewardProvenancePool c)
pools ::
!( Map
(KeyHash 'StakePool c)
(RewardProvenancePool c)
)
, forall c.
RewardProvenance c -> Map (KeyHash 'StakePool c) Desirability
desirabilities ::
!(Map (KeyHash 'StakePool c) Desirability)
}
deriving (RewardProvenance c -> RewardProvenance c -> Bool
forall c. RewardProvenance c -> RewardProvenance c -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RewardProvenance c -> RewardProvenance c -> Bool
$c/= :: forall c. RewardProvenance c -> RewardProvenance c -> Bool
== :: RewardProvenance c -> RewardProvenance c -> Bool
$c== :: forall c. RewardProvenance c -> RewardProvenance c -> Bool
Eq, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall c x. Rep (RewardProvenance c) x -> RewardProvenance c
forall c x. RewardProvenance c -> Rep (RewardProvenance c) x
$cto :: forall c x. Rep (RewardProvenance c) x -> RewardProvenance c
$cfrom :: forall c x. RewardProvenance c -> Rep (RewardProvenance c) x
Generic)
deriving instance FromJSON Desirability
deriving instance ToJSON Desirability
deriving instance Crypto c => FromJSON (RewardProvenance c)
deriving instance Crypto c => ToJSON (RewardProvenance c)
instance NoThunks (RewardProvenance c)
instance NFData (RewardProvenance c)
instance Default (RewardProvenance c) where
def :: RewardProvenance c
def =
forall c.
Word64
-> BlocksMade c
-> Coin
-> Coin
-> Coin
-> Coin
-> Coin
-> Integer
-> Rational
-> Integer
-> Rational
-> Coin
-> Coin
-> Coin
-> Map (KeyHash 'StakePool c) (RewardProvenancePool c)
-> Map (KeyHash 'StakePool c) Desirability
-> RewardProvenance c
RewardProvenance
Word64
0
(forall c. Map (KeyHash 'StakePool c) Natural -> BlocksMade c
BlocksMade forall a. Default a => a
def)
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
Integer
0
Rational
0
Integer
0
Rational
0
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
(Integer -> Coin
Coin Integer
0)
forall a. Default a => a
def
forall a. Default a => a
def
mylines :: Int -> [String] -> String
mylines :: Int -> Context -> String
mylines Int
n Context
xs = Context -> String
unlines (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Int -> a -> [a]
replicate Int
n Char
' ' forall a. [a] -> [a] -> [a]
++) Context
xs)
instance Show (RewardProvenancePool c) where
show :: RewardProvenancePool c -> String
show RewardProvenancePool c
t =
String
"RewardProvenancePool\n"
forall a. [a] -> [a] -> [a]
++ Int -> Context -> String
mylines
Int
3
[ String
"poolBlocks = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Natural
poolBlocksP RewardProvenancePool c
t)
, String
"sigma = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Rational
sigmaP RewardProvenancePool c
t)
, String
"sigmaA = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Rational
sigmaAP RewardProvenancePool c
t)
, String
"ownerStake = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Coin
ownerStakeP RewardProvenancePool c
t)
, String
"poolParams = " forall a. [a] -> [a] -> [a]
++ forall c. PoolParams c -> String
showPoolParams (forall c. RewardProvenancePool c -> PoolParams c
poolParamsP RewardProvenancePool c
t)
, String
"pledgeRatio = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Rational
pledgeRatioP RewardProvenancePool c
t)
, String
"maxP = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Coin
maxPP RewardProvenancePool c
t)
, String
"appPerf = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Rational
appPerfP RewardProvenancePool c
t)
, String
"poolR = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Coin
poolRP RewardProvenancePool c
t)
, String
"lReward = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenancePool c -> Coin
lRewardP RewardProvenancePool c
t)
]
showPoolParams :: PoolParams c -> String
showPoolParams :: forall c. PoolParams c -> String
showPoolParams PoolParams c
x =
String
"PoolParams\n"
forall a. [a] -> [a] -> [a]
++ Int -> Context -> String
mylines
Int
6
[ String
"poolId = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> KeyHash 'StakePool c
ppId PoolParams c
x)
, String
"poolVrf = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> VRFVerKeyHash 'StakePoolVRF c
ppVrf PoolParams c
x)
, String
"poolPledge = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> Coin
ppPledge PoolParams c
x)
, String
"poolCost = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> Coin
ppCost PoolParams c
x)
, String
"poolMargin = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> UnitInterval
ppMargin PoolParams c
x)
, String
"poolRAcnt = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> RewardAccount c
ppRewardAccount PoolParams c
x)
, String
"poolOwners = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> Set (KeyHash 'Staking c)
ppOwners PoolParams c
x)
, String
"poolRelays = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> StrictSeq StakePoolRelay
ppRelays PoolParams c
x)
, String
"poolMD = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. PoolParams c -> StrictMaybe PoolMetadata
ppMetadata PoolParams c
x)
]
instance Show (RewardProvenance c) where
show :: RewardProvenance c -> String
show RewardProvenance c
t =
String
"RewardProvenance\n"
forall a. [a] -> [a] -> [a]
++ Int -> Context -> String
mylines
Int
3
[ String
"spe = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Word64
spe RewardProvenance c
t)
, String
"blocks = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> BlocksMade c
blocks RewardProvenance c
t)
, String
"maxLL = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
maxLL RewardProvenance c
t)
, String
"deltaR1 = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
deltaR1 RewardProvenance c
t)
, String
"deltaR2 = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
deltaR2 RewardProvenance c
t)
, String
"r = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
r RewardProvenance c
t)
, String
"totalStake = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
totalStake RewardProvenance c
t)
, String
"blocksCount = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Integer
blocksCount RewardProvenance c
t)
, String
"d = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Rational
d RewardProvenance c
t)
, String
"expBlocks = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Integer
expBlocks RewardProvenance c
t)
, String
"eta = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Rational
eta RewardProvenance c
t)
, String
"rPot = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
rPot RewardProvenance c
t)
, String
"deltaT1 = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
deltaT1 RewardProvenance c
t)
, String
"activeStake = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c. RewardProvenance c -> Coin
activeStake RewardProvenance c
t)
, String
"pools = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c.
RewardProvenance c
-> Map (KeyHash 'StakePool c) (RewardProvenancePool c)
pools RewardProvenance c
t)
, String
"desirabilities = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall c.
RewardProvenance c -> Map (KeyHash 'StakePool c) Desirability
desirabilities RewardProvenance c
t)
]
instance EncCBOR Desirability where
encCBOR :: Desirability -> Encoding
encCBOR (Desirability Double
p1 Double
p2) =
forall (w :: Wrapped) t. Encode w t -> Encoding
encode forall a b. (a -> b) -> a -> b
$ forall t. t -> Encode ('Closed 'Dense) t
Rec Double -> Double -> Desirability
Desirability forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Double
p1 forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Double
p2
instance DecCBOR Desirability where
decCBOR :: forall s. Decoder s Desirability
decCBOR = forall (w :: Wrapped) t s. Decode w t -> Decoder s t
decode forall a b. (a -> b) -> a -> b
$ forall t. t -> Decode ('Closed 'Dense) t
RecD Double -> Double -> Desirability
Desirability forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
instance Crypto c => EncCBOR (RewardProvenancePool c) where
encCBOR :: RewardProvenancePool c -> Encoding
encCBOR (RewardProvenancePool Natural
p1 Rational
p2 Rational
p3 Coin
p4 PoolParams c
p5 Rational
p6 Coin
p7 Rational
p8 Coin
p9 Coin
p10) =
forall (w :: Wrapped) t. Encode w t -> Encoding
encode forall a b. (a -> b) -> a -> b
$
forall t. t -> Encode ('Closed 'Dense) t
Rec forall c.
Natural
-> Rational
-> Rational
-> Coin
-> PoolParams c
-> Rational
-> Coin
-> Rational
-> Coin
-> Coin
-> RewardProvenancePool c
RewardProvenancePool
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Natural
p1
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p2
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p3
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p4
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To PoolParams c
p5
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p6
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p7
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p8
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p9
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p10
instance Crypto c => DecCBOR (RewardProvenancePool c) where
decCBOR :: forall s. Decoder s (RewardProvenancePool c)
decCBOR =
forall (w :: Wrapped) t s. Decode w t -> Decoder s t
decode forall a b. (a -> b) -> a -> b
$
forall t. t -> Decode ('Closed 'Dense) t
RecD forall c.
Natural
-> Rational
-> Rational
-> Coin
-> PoolParams c
-> Rational
-> Coin
-> Rational
-> Coin
-> Coin
-> RewardProvenancePool c
RewardProvenancePool
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
instance Crypto c => EncCBOR (RewardProvenance c) where
encCBOR :: RewardProvenance c -> Encoding
encCBOR (RewardProvenance Word64
p1 BlocksMade c
p2 Coin
p3 Coin
p4 Coin
p5 Coin
p6 Coin
p7 Integer
p8 Rational
p9 Integer
p10 Rational
p11 Coin
p12 Coin
p13 Coin
p14 Map (KeyHash 'StakePool c) (RewardProvenancePool c)
p15 Map (KeyHash 'StakePool c) Desirability
p16) =
forall (w :: Wrapped) t. Encode w t -> Encoding
encode forall a b. (a -> b) -> a -> b
$
forall t. t -> Encode ('Closed 'Dense) t
Rec forall c.
Word64
-> BlocksMade c
-> Coin
-> Coin
-> Coin
-> Coin
-> Coin
-> Integer
-> Rational
-> Integer
-> Rational
-> Coin
-> Coin
-> Coin
-> Map (KeyHash 'StakePool c) (RewardProvenancePool c)
-> Map (KeyHash 'StakePool c) Desirability
-> RewardProvenance c
RewardProvenance
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Word64
p1
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To BlocksMade c
p2
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p3
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p4
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p5
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p6
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p7
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Integer
p8
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p9
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Integer
p10
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Rational
p11
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p12
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p13
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Coin
p14
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Map (KeyHash 'StakePool c) (RewardProvenancePool c)
p15
forall (w :: Wrapped) a t (r :: Density).
Encode w (a -> t) -> Encode ('Closed r) a -> Encode w t
!> forall t. EncCBOR t => t -> Encode ('Closed 'Dense) t
To Map (KeyHash 'StakePool c) Desirability
p16
instance Crypto c => DecCBOR (RewardProvenance c) where
decCBOR :: forall s. Decoder s (RewardProvenance c)
decCBOR =
forall (w :: Wrapped) t s. Decode w t -> Decoder s t
decode forall a b. (a -> b) -> a -> b
$
forall t. t -> Decode ('Closed 'Dense) t
RecD forall c.
Word64
-> BlocksMade c
-> Coin
-> Coin
-> Coin
-> Coin
-> Coin
-> Integer
-> Rational
-> Integer
-> Rational
-> Coin
-> Coin
-> Coin
-> Map (KeyHash 'StakePool c) (RewardProvenancePool c)
-> Map (KeyHash 'StakePool c) Desirability
-> RewardProvenance c
RewardProvenance
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From
forall (w1 :: Wrapped) a t (w :: Density).
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! forall t (w :: Wrapped). DecCBOR t => Decode w t
From