Skip to content

Commit

Permalink
Add example with MIR certificate with non-registered credential
Browse files Browse the repository at this point in the history
The MIR certificate in the example also contains an instantaneous reward that is
not paid out because the corresponding stake credential is not registered at the
time of the reward update.
  • Loading branch information
mgudemann committed Nov 6, 2019
1 parent adab89d commit ada9625
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shelley/chain-and-ledger/executable-spec/test/Examples.hs
Expand Up @@ -359,6 +359,9 @@ dariaStake = KeyPair vk sk
dariaAddr :: Addr
dariaAddr = mkAddr (dariaPay, dariaStake)

dariaSHK :: Credential
dariaSHK = (KeyHashObj . hashKey . vKey) dariaStake

-- * Example 1 - apply CHAIN transition to an empty block


Expand Down Expand Up @@ -511,7 +514,8 @@ txbodyEx2A = TxBody
, RegKey bobSHK
, RegKey carlSHK
, RegPool alicePoolParams
] ++ [InstantaneousRewards (Map.fromList [(carlSHK, 110)])]))
] ++ [InstantaneousRewards (Map.fromList [ (carlSHK, 110)
, (dariaSHK, 99)])]))
Map.empty
(Coin 3)
(Slot 10)
Expand Down Expand Up @@ -606,7 +610,8 @@ dsEx2A = dsEx1
, _rewards = Map.fromList [ (RewardAcnt aliceSHK, Coin 0)
, (RewardAcnt bobSHK, Coin 0)
, (RewardAcnt carlSHK, Coin 0)]
, _irwd = Map.fromList [(carlSHK, 110)]
, _irwd = Map.fromList [ (carlSHK, 110)
, (dariaSHK, 99)]
}

psEx2A :: PState
Expand Down Expand Up @@ -716,7 +721,8 @@ delegsEx2B = Map.fromList

dsEx2B :: DState
dsEx2B = dsEx2A { _delegations = delegsEx2B
, _irwd = Map.fromList [(carlSHK, Coin 110)] }
, _irwd = Map.fromList [ (carlSHK, Coin 110)
, (dariaSHK, Coin 99)] }

expectedLSEx2B :: LedgerState
expectedLSEx2B = LedgerState
Expand Down

0 comments on commit ada9625

Please sign in to comment.