-
Notifications
You must be signed in to change notification settings - Fork 29
Remove ProtocolParametersUpdate #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| {-# LANGUAGE DataKinds #-} | ||
| {-# LANGUAGE EmptyCase #-} | ||
| {-# LANGUAGE FlexibleContexts #-} | ||
| {-# LANGUAGE GADTs #-} | ||
| {-# LANGUAGE NamedFieldPuns #-} | ||
Check warningCode scanning / HLint Unused LANGUAGE pragma Warning generated
cardano-api/gen/Test/Gen/Cardano/Api/Internal/Shared.hs:5:1-31: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE NamedFieldPuns #-} Perhaps you should remove it. |
||
| {-# LANGUAGE OverloadedStrings #-} | ||
Check warningCode scanning / HLint Unused LANGUAGE pragma Warning generated
cardano-api/gen/Test/Gen/Cardano/Api/Internal/Shared.hs:6:1-34: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE OverloadedStrings #-} Perhaps you should remove it. |
||
| {-# LANGUAGE RankNTypes #-} | ||
| {-# LANGUAGE RecordWildCards #-} | ||
Check warningCode scanning / HLint Unused LANGUAGE pragma Warning generated
cardano-api/gen/Test/Gen/Cardano/Api/Internal/Shared.hs:8:1-32: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE RecordWildCards #-} Perhaps you should remove it. Note: may require {-# LANGUAGE DisambiguateRecordFields #-} adding to the top of the file |
||
| {-# LANGUAGE ScopedTypeVariables #-} | ||
| {-# LANGUAGE TupleSections #-} | ||
Check warningCode scanning / HLint Unused LANGUAGE pragma Warning generated
cardano-api/gen/Test/Gen/Cardano/Api/Internal/Shared.hs:10:1-30: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE TupleSections #-} Perhaps you should remove it. |
||
| {-# LANGUAGE TypeApplications #-} | ||
Check warningCode scanning / HLint Unused LANGUAGE pragma Warning generated
cardano-api/gen/Test/Gen/Cardano/Api/Internal/Shared.hs:11:1-33: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE TypeApplications #-} Perhaps you should remove it. |
||
| {-# OPTIONS_GHC -Wno-deprecations #-} | ||
|
|
||
| module Test.Gen.Cardano.Api.Internal.Shared | ||
| ( genCostModels | ||
| , genEpochNo | ||
| , genSeed | ||
| , genSigningKey | ||
| , genVerificationKey | ||
| , genVerificationKeyHash | ||
| ) | ||
| where | ||
|
|
||
| import Cardano.Api | ||
| import Cardano.Api.Ledger () | ||
|
|
||
| import Cardano.Crypto.DSIGN.Class qualified as Crypto | ||
| import Cardano.Crypto.Seed qualified as Crypto | ||
| import Cardano.Ledger.Alonzo.Scripts qualified as Alonzo | ||
|
|
||
| import Test.Cardano.Ledger.Alonzo.Arbitrary () | ||
| import Test.Cardano.Ledger.Conway.Arbitrary () | ||
|
|
||
| import Hedgehog | ||
| import Hedgehog.Gen as Gen | ||
| import Hedgehog.Gen.QuickCheck qualified as Q | ||
| import Hedgehog.Range as Range | ||
|
|
||
| genEpochNo :: Gen EpochNo | ||
| genEpochNo = EpochNo <$> Gen.word64 (Range.linear 0 10) | ||
|
|
||
| genCostModels :: MonadGen m => m Alonzo.CostModels | ||
| genCostModels = Q.arbitrary | ||
|
|
||
| genVerificationKeyHash | ||
| :: () | ||
| => HasTypeProxy keyrole | ||
| => Key keyrole | ||
| => AsType keyrole | ||
| -> Gen (Hash keyrole) | ||
| genVerificationKeyHash roletoken = | ||
| verificationKeyHash <$> genVerificationKey roletoken | ||
|
|
||
| genVerificationKey | ||
| :: () | ||
| => HasTypeProxy keyrole | ||
| => Key keyrole | ||
| => AsType keyrole | ||
| -> Gen (VerificationKey keyrole) | ||
| genVerificationKey roletoken = getVerificationKey <$> genSigningKey roletoken | ||
|
|
||
| genSigningKey :: Key keyrole => AsType keyrole -> Gen (SigningKey keyrole) | ||
| genSigningKey roletoken = do | ||
| seed <- genSeed (fromIntegral seedSize) | ||
| let sk = deterministicSigningKey roletoken seed | ||
| return sk | ||
| where | ||
| seedSize :: Word | ||
| seedSize = deterministicSigningKeySeedSize roletoken | ||
|
|
||
| genSeed :: Int -> Gen Crypto.Seed | ||
| genSeed n = Crypto.mkSeedFromBytes <$> Gen.bytes (Range.singleton n) | ||
Check warning
Code scanning / HLint
Unused LANGUAGE pragma Warning generated