{-# LANGUAGE DataKinds #-}
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.Keys (KeyRole (..))
import Test.Cardano.Ledger.Core.KeyPair (KeyPair (..), mkAddr)
import Test.Cardano.Ledger.Shelley.Utils (RawSeed (..), mkKeyPair)
alicePay :: KeyPair Payment
alicePay :: KeyPair Payment
alicePay = VKey Payment -> SignKeyDSIGN DSIGN -> KeyPair Payment
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Payment
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
0 Word64
0 Word64
0 Word64
0 Word64
0)
aliceStake :: KeyPair Staking
aliceStake :: KeyPair Staking
aliceStake = VKey Staking -> SignKeyDSIGN DSIGN -> KeyPair Staking
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Staking
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
1 Word64
1 Word64
1 Word64
1 Word64
1)
aliceAddr :: Addr
aliceAddr :: Addr
aliceAddr = KeyPair Payment -> KeyPair Staking -> Addr
forall p s.
(MakeCredential p Payment, MakeStakeReference s) =>
p -> s -> Addr
mkAddr KeyPair Payment
alicePay KeyPair Staking
aliceStake
bobPay :: KeyPair Payment
bobPay :: KeyPair Payment
bobPay = VKey Payment -> SignKeyDSIGN DSIGN -> KeyPair Payment
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Payment
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
2 Word64
2 Word64
2 Word64
2 Word64
2)
bobStake :: KeyPair Staking
bobStake :: KeyPair Staking
bobStake = VKey Staking -> SignKeyDSIGN DSIGN -> KeyPair Staking
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Staking
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
3 Word64
3 Word64
3 Word64
3 Word64
3)
bobAddr :: Addr
bobAddr :: Addr
bobAddr = KeyPair Payment -> KeyPair Staking -> Addr
forall p s.
(MakeCredential p Payment, MakeStakeReference s) =>
p -> s -> Addr
mkAddr KeyPair Payment
bobPay KeyPair Staking
bobStake
carlPay :: KeyPair Payment
carlPay :: KeyPair Payment
carlPay = VKey Payment -> SignKeyDSIGN DSIGN -> KeyPair Payment
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Payment
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
4 Word64
4 Word64
4 Word64
4 Word64
4)
carlStake :: KeyPair Staking
carlStake :: KeyPair Staking
carlStake = VKey Staking -> SignKeyDSIGN DSIGN -> KeyPair Staking
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Staking
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
5 Word64
5 Word64
5 Word64
5 Word64
5)
carlAddr :: Addr
carlAddr :: Addr
carlAddr = KeyPair Payment -> KeyPair Staking -> Addr
forall p s.
(MakeCredential p Payment, MakeStakeReference s) =>
p -> s -> Addr
mkAddr KeyPair Payment
carlPay KeyPair Staking
carlStake
dariaPay :: KeyPair Payment
dariaPay :: KeyPair Payment
dariaPay = VKey Payment -> SignKeyDSIGN DSIGN -> KeyPair Payment
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Payment
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
6 Word64
6 Word64
6 Word64
6 Word64
6)
dariaStake :: KeyPair Staking
dariaStake :: KeyPair Staking
dariaStake = VKey Staking -> SignKeyDSIGN DSIGN -> KeyPair Staking
forall (kd :: KeyRole). VKey kd -> SignKeyDSIGN DSIGN -> KeyPair kd
KeyPair VKey Staking
forall {kd :: KeyRole}. VKey kd
vk SignKeyDSIGN DSIGN
sk
where
(SignKeyDSIGN DSIGN
sk, VKey kd
vk) = RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
forall (kd :: KeyRole). RawSeed -> (SignKeyDSIGN DSIGN, VKey kd)
mkKeyPair (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> RawSeed
RawSeed Word64
7 Word64
7 Word64
7 Word64
7 Word64
7)
dariaAddr :: Addr
dariaAddr :: Addr
dariaAddr = KeyPair Payment -> KeyPair Staking -> Addr
forall p s.
(MakeCredential p Payment, MakeStakeReference s) =>
p -> s -> Addr
mkAddr KeyPair Payment
dariaPay KeyPair Staking
dariaStake