{-# LANGUAGE DataKinds #-}

-- |
-- Module      : Test.Cardano.Ledger.Mary.Examples.Cast
-- Description : Cast of characters for Mary ledger examples
--
-- The cast of Characters for Mary Ledger Examples
module Test.Cardano.Ledger.Mary.Examples.Cast (
  alicePay,
  aliceStake,
  aliceAddr,
  bobPay,
  bobStake,
  bobAddr,
  carlPay,
  carlStake,
  carlAddr,
  dariaPay,
  dariaStake,
  dariaAddr,
) where

import Cardano.Ledger.Address (Addr (..))
import Cardano.Ledger.Crypto (StandardCrypto)
import Cardano.Ledger.Keys (
  KeyRole (..),
 )
import Test.Cardano.Ledger.Core.KeyPair (KeyPair (..), mkAddr)
import Test.Cardano.Ledger.Shelley.Utils (RawSeed (..), mkKeyPair)

-- | Alice's payment key pair
alicePay :: KeyPair 'Payment StandardCrypto
alicePay :: KeyPair 'Payment StandardCrypto
alicePay = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
0 Word64
0 Word64
0 Word64
0 Word64
0)

-- | Alice's stake key pair
aliceStake :: KeyPair 'Staking StandardCrypto
aliceStake :: KeyPair 'Staking StandardCrypto
aliceStake = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
1 Word64
1 Word64
1 Word64
1 Word64
1)

-- | Alice's base address
aliceAddr :: Addr StandardCrypto
aliceAddr :: Addr StandardCrypto
aliceAddr = forall c.
Crypto c =>
(KeyPair 'Payment c, KeyPair 'Staking c) -> Addr c
mkAddr (KeyPair 'Payment StandardCrypto
alicePay, KeyPair 'Staking StandardCrypto
aliceStake)

-- | Bob's payment key pair
bobPay :: KeyPair 'Payment StandardCrypto
bobPay :: KeyPair 'Payment StandardCrypto
bobPay = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
2 Word64
2 Word64
2 Word64
2 Word64
2)

-- | Bob's stake key pair
bobStake :: KeyPair 'Staking StandardCrypto
bobStake :: KeyPair 'Staking StandardCrypto
bobStake = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
3 Word64
3 Word64
3 Word64
3 Word64
3)

-- | Bob's address
bobAddr :: Addr StandardCrypto
bobAddr :: Addr StandardCrypto
bobAddr = forall c.
Crypto c =>
(KeyPair 'Payment c, KeyPair 'Staking c) -> Addr c
mkAddr (KeyPair 'Payment StandardCrypto
bobPay, KeyPair 'Staking StandardCrypto
bobStake)

-- Carl's payment key pair
carlPay :: KeyPair 'Payment StandardCrypto
carlPay :: KeyPair 'Payment StandardCrypto
carlPay = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
4 Word64
4 Word64
4 Word64
4 Word64
4)

-- | Carl's stake key pair
carlStake :: KeyPair 'Staking StandardCrypto
carlStake :: KeyPair 'Staking StandardCrypto
carlStake = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
5 Word64
5 Word64
5 Word64
5 Word64
5)

-- | Carl's address
carlAddr :: Addr StandardCrypto
carlAddr :: Addr StandardCrypto
carlAddr = forall c.
Crypto c =>
(KeyPair 'Payment c, KeyPair 'Staking c) -> Addr c
mkAddr (KeyPair 'Payment StandardCrypto
carlPay, KeyPair 'Staking StandardCrypto
carlStake)

-- | Daria's payment key pair
dariaPay :: KeyPair 'Payment StandardCrypto
dariaPay :: KeyPair 'Payment StandardCrypto
dariaPay = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
6 Word64
6 Word64
6 Word64
6 Word64
6)

-- | Daria's stake key pair
dariaStake :: KeyPair 'Staking StandardCrypto
dariaStake :: KeyPair 'Staking StandardCrypto
dariaStake = forall (kd :: KeyRole) c.
VKey kd c -> SignKeyDSIGN (DSIGN c) -> KeyPair kd c
KeyPair forall {kd :: KeyRole}. VKey kd StandardCrypto
vk SignKeyDSIGN (DSIGN StandardCrypto)
sk
  where
    (SignKeyDSIGN (DSIGN StandardCrypto)
sk, VKey kd StandardCrypto
vk) = forall c (kd :: KeyRole).
DSIGNAlgorithm (DSIGN c) =>
RawSeed -> (SignKeyDSIGN (DSIGN c), VKey kd c)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
7 Word64
7 Word64
7 Word64
7 Word64
7)

-- | Daria's address
dariaAddr :: Addr StandardCrypto
dariaAddr :: Addr StandardCrypto
dariaAddr = forall c.
Crypto c =>
(KeyPair 'Payment c, KeyPair 'Staking c) -> Addr c
mkAddr (KeyPair 'Payment StandardCrypto
dariaPay, KeyPair 'Staking StandardCrypto
dariaStake)