From f447036c189ae57903132d90311540bd8ca70821 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Tue, 22 Oct 2024 13:10:22 +0200 Subject: [PATCH] Refactor: Remove SomeKeyPair --- .../src/Testnet/Process/Cli/DRep.hs | 9 +++--- .../src/Testnet/Process/Cli/Transaction.hs | 5 +-- cardano-testnet/src/Testnet/Types.hs | 4 --- .../Cardano/Testnet/Test/Cli/KesPeriodInfo.hs | 2 +- .../Testnet/Test/Cli/LeadershipSchedule.hs | 32 ++++++++++--------- .../Cardano/Testnet/Test/Cli/Query.hs | 6 ++-- .../Testnet/Test/Gov/CommitteeAddNew.hs | 5 +-- .../Cardano/Testnet/Test/Gov/DRepActivity.hs | 3 +- .../Cardano/Testnet/Test/Gov/DRepDeposit.hs | 3 +- .../Cardano/Testnet/Test/Gov/NoConfidence.hs | 9 +++--- .../Testnet/Test/Gov/PParamChangeFailsSPO.hs | 3 +- .../Testnet/Test/Gov/PredefinedAbstainDRep.hs | 12 +++---- .../Test/Gov/ProposeNewConstitution.hs | 5 +-- .../Test/Gov/ProposeNewConstitutionSPO.hs | 7 ++-- 14 files changed, 56 insertions(+), 49 deletions(-) diff --git a/cardano-testnet/src/Testnet/Process/Cli/DRep.hs b/cardano-testnet/src/Testnet/Process/Cli/DRep.hs index eb877002a6b..e24d67e4d00 100644 --- a/cardano-testnet/src/Testnet/Process/Cli/DRep.hs +++ b/cardano-testnet/src/Testnet/Process/Cli/DRep.hs @@ -17,6 +17,7 @@ module Testnet.Process.Cli.DRep ) where import Cardano.Api hiding (Certificate, TxBody) +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (EpochInterval (EpochInterval, unEpochInterval)) import Cardano.Testnet (maybeExtractGovernanceActionIndex) @@ -239,7 +240,7 @@ registerDRep execConfig epochStateView ceo work prefix wallet = do drepRegTxBody <- createCertificatePublicationTxBody execConfig epochStateView sbe baseDir "reg-cert-txbody" drepRegCert wallet drepSignedRegTx <- signTx execConfig cEra baseDir "signed-reg-tx" - drepRegTxBody [SomeKeyPair drepKeyPair, SomeKeyPair $ paymentKeyInfoPair wallet] + drepRegTxBody [Some drepKeyPair, Some $ paymentKeyInfoPair wallet] submitTx execConfig cEra drepSignedRegTx return drepKeyPair @@ -286,8 +287,8 @@ delegateToDRep execConfig epochStateView sbe work prefix -- Sign transaction repRegSignedRegTx1 <- signTx execConfig cEra baseDir "signed-reg-tx" - repRegTxBody1 [ SomeKeyPair $ paymentKeyInfoPair payingWallet - , SomeKeyPair skeyPair] + repRegTxBody1 [ Some $ paymentKeyInfoPair payingWallet + , Some skeyPair] -- Submit transaction submitTx execConfig cEra repRegSignedRegTx1 @@ -398,7 +399,7 @@ makeActivityChangeProposal execConfig epochStateView ceo work ] signedProposalTx <- signTx execConfig cEra baseDir "signed-proposal" - (File proposalBody) [SomeKeyPair $ paymentKeyInfoPair wallet] + (File proposalBody) [Some $ paymentKeyInfoPair wallet] submitTx execConfig cEra signedProposalTx diff --git a/cardano-testnet/src/Testnet/Process/Cli/Transaction.hs b/cardano-testnet/src/Testnet/Process/Cli/Transaction.hs index 6f4e691ac81..1c134b6c07f 100644 --- a/cardano-testnet/src/Testnet/Process/Cli/Transaction.hs +++ b/cardano-testnet/src/Testnet/Process/Cli/Transaction.hs @@ -15,6 +15,7 @@ module Testnet.Process.Cli.Transaction ) where import Cardano.Api hiding (Certificate, TxBody) +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (Coin (unCoin)) import Prelude @@ -146,14 +147,14 @@ signTx -> FilePath -- ^ Base directory path where the signed transaction file will be stored. -> String -- ^ Prefix for the output signed transaction file name. The extension will be @.tx@. -> File TxBody In -- ^ Transaction body to be signed, obtained using 'createCertificatePublicationTxBody' or similar. - -> [SomeKeyPair] -- ^ List of key pairs used for signing the transaction. + -> [Some KeyPair] -- ^ List of key pairs used for signing the transaction. -> m (File SignedTx In) signTx execConfig cEra work prefix txBody signatoryKeyPairs = do let signedTx = File (work prefix <> ".tx") void $ execCli' execConfig $ [ anyEraToString cEra, "transaction", "sign" , "--tx-body-file", unFile txBody - ] ++ (concat [["--signing-key-file", signingKeyFp kp] | SomeKeyPair kp <- signatoryKeyPairs]) ++ + ] ++ (concat [["--signing-key-file", signingKeyFp kp] | Some kp <- signatoryKeyPairs]) ++ [ "--out-file", unFile signedTx ] return signedTx diff --git a/cardano-testnet/src/Testnet/Types.hs b/cardano-testnet/src/Testnet/Types.hs index 3acfff190cd..82315444c0b 100644 --- a/cardano-testnet/src/Testnet/Types.hs +++ b/cardano-testnet/src/Testnet/Types.hs @@ -26,7 +26,6 @@ module Testnet.Types , KeyPair(..) , verificationKeyFp , signingKeyFp - , SomeKeyPair(..) , VKey , SKey , VrfKey @@ -97,9 +96,6 @@ verificationKeyFp = unFile . verificationKey signingKeyFp :: KeyPair k -> FilePath signingKeyFp = unFile . signingKey -data SomeKeyPair = forall a. SomeKeyPair (KeyPair a) -deriving instance Show SomeKeyPair - -- | Verification key tag data VKey k diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs index 5dac297e521..b0c1414acd5 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs @@ -94,7 +94,7 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs let node1SocketPath = Api.File $ IO.sprocketSystemName node1sprocket termEpoch = EpochNo 3 epochStateView <- getEpochStateView configurationFile node1SocketPath - (stakePoolId, stakePoolColdSigningKey, stakePoolColdVKey, _, _) + (stakePoolId, KeyPair{signingKey=File stakePoolColdSigningKey, verificationKey=File stakePoolColdVKey}, _) <- registerSingleSpo asbe 1 tempAbsPath configurationFile node1SocketPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs index faaf80a2ba2..10c4fa990a0 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs @@ -101,7 +101,7 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \ let node1SocketPath = Api.File $ IO.sprocketSystemName node1sprocket termEpoch = EpochNo 15 epochStateView <- getEpochStateView configurationFile node1SocketPath - (stakePoolIdNewSpo, stakePoolColdSigningKey, stakePoolColdVKey, vrfSkey, _) + (stakePoolIdNewSpo, KeyPair{signingKey=File stakePoolColdSigningKey, verificationKey=File stakePoolColdVKey}, KeyPair{signingKey=File vrfSkey}) <- registerSingleSpo asbe 1 tempAbsPath configurationFile node1SocketPath @@ -117,30 +117,32 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \ let testStakeDelegator = work "test-delegator" H.createDirectoryIfMissing_ testStakeDelegator - let testDelegatorVkeyFp = testStakeDelegator "test-delegator.vkey" - testDelegatorSKeyFp = testStakeDelegator "test-delegator.skey" - testDelegatorPaymentVKeyFp = testStakeDelegator "test-delegator-payment.vkey" - testDelegatorPaymentSKeyFp = testStakeDelegator "test-delegator-payment.skey" + let testDelegatorKeys = KeyPair + { signingKey = File $ testStakeDelegator "test-delegator.skey" + , verificationKey = File $ testStakeDelegator "test-delegator.vkey" + } + testDelegatorPaymentKeys = KeyPair + { signingKey = File $ testStakeDelegator "test-delegator-payment.skey" + , verificationKey = File $ testStakeDelegator "test-delegator-payment.vkey" + } testDelegatorRegCertFp = testStakeDelegator "test-delegator.regcert" testDelegatorDelegCert = testStakeDelegator "test-delegator.delegcert" - cliStakeAddressKeyGen - $ KeyPair (File testDelegatorVkeyFp) (File testDelegatorSKeyFp) - cliAddressKeyGen - $ KeyPair (File testDelegatorPaymentVKeyFp) (File testDelegatorPaymentSKeyFp) + cliStakeAddressKeyGen testDelegatorKeys + cliAddressKeyGen testDelegatorPaymentKeys -- NB: We must include the stake credential testDelegatorPaymentAddr <- execCli [ "latest", "address", "build" , "--testnet-magic", show @Int testnetMagic - , "--payment-verification-key-file", testDelegatorPaymentVKeyFp - , "--stake-verification-key-file", testDelegatorVkeyFp + , "--payment-verification-key-file", verificationKeyFp testDelegatorPaymentKeys + , "--stake-verification-key-file", verificationKeyFp testDelegatorKeys ] testDelegatorStakeAddress <- filter (/= '\n') <$> execCli [ "latest", "stake-address", "build" - , "--stake-verification-key-file", testDelegatorVkeyFp + , "--stake-verification-key-file", verificationKeyFp testDelegatorKeys , "--testnet-magic", show @Int testnetMagic ] @@ -149,7 +151,7 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \ createStakeKeyRegistrationCertificate tempAbsPath (cardanoNodeEra cTestnetOptions) - testDelegatorVkeyFp + (verificationKey testDelegatorKeys) keyDeposit testDelegatorRegCertFp @@ -157,7 +159,7 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \ createStakeDelegationCertificate tempAbsPath sbe - testDelegatorVkeyFp + (verificationKey testDelegatorKeys) stakePoolIdNewSpo testDelegatorDelegCert @@ -197,7 +199,7 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \ , "--tx-body-file", delegRegTestDelegatorTxBodyFp , "--testnet-magic", show @Int testnetMagic , "--signing-key-file", utxoSKeyFile - , "--signing-key-file", testDelegatorSKeyFp + , "--signing-key-file", signingKeyFp testDelegatorKeys , "--out-file", delegRegTestDelegatorTxFp ] diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs index 40e298d0b91..f190ff36fb9 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs @@ -14,6 +14,7 @@ module Cardano.Testnet.Test.Cli.Query ) where import Cardano.Api +import Cardano.Api.Experimental (Some (..)) import qualified Cardano.Api.Genesis as Api import Cardano.Api.Ledger (Coin (Coin), EpochInterval (EpochInterval), StandardCrypto, extractHash, unboundRational) @@ -28,7 +29,6 @@ import qualified Cardano.Ledger.BaseTypes as L import Cardano.Ledger.Core (valueTxOutL) import Cardano.Ledger.Shelley.LedgerState (esLStateL, lsUTxOStateL, nesEpochStateL, utxosUtxoL) -import qualified Cardano.Ledger.TxIn as L import qualified Cardano.Ledger.UTxO as L import Cardano.Testnet @@ -328,7 +328,7 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H. -- Now we create a transaction and check if it exists in the mempool mempoolWork <- H.createDirectoryIfMissing $ work "mempool-test" txBody <- mkSimpleSpendOutputsOnlyTx execConfig epochStateView sbe mempoolWork "tx-body" wallet0 wallet1 10_000_000 - signedTx <- signTx execConfig cEra mempoolWork "signed-tx" txBody [SomeKeyPair $ paymentKeyInfoPair wallet0] + signedTx <- signTx execConfig cEra mempoolWork "signed-tx" txBody [Some $ paymentKeyInfoPair wallet0] submitTx execConfig cEra signedTx txId <- retrieveTransactionId execConfig signedTx -- And we check @@ -350,7 +350,7 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H. -- Submit a transaction to publish the reference script txBody <- mkSpendOutputsOnlyTx execConfig epochStateView sbe refScriptSizeWork "tx-body" wallet1 [(ReferenceScriptAddress plutusV3Script, transferAmount)] - signedTx <- signTx execConfig cEra refScriptSizeWork "signed-tx" txBody [SomeKeyPair $ paymentKeyInfoPair wallet1] + signedTx <- signTx execConfig cEra refScriptSizeWork "signed-tx" txBody [Some $ paymentKeyInfoPair wallet1] submitTx execConfig cEra signedTx -- Wait until transaction is on chain and obtain transaction identifier txId <- retrieveTransactionId execConfig signedTx diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs index 0f95f58b896..7f307524e50 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs @@ -11,6 +11,7 @@ module Cardano.Testnet.Test.Gov.CommitteeAddNew ) where import Cardano.Api as Api +import Cardano.Api.Experimental (Some (..)) import qualified Cardano.Api.Ledger as L import Cardano.Api.Shelley (ShelleyLedgerEra) @@ -214,7 +215,7 @@ hprop_constitutional_committee_add_new = integrationWorkspace "constitutional-co committeeMembers `H.assertWith` null signedProposalTx <- - signTx execConfig cEra work "signed-proposal" (File txbodyFp) [SomeKeyPair $ paymentKeyInfoPair wallet0] + signTx execConfig cEra work "signed-proposal" (File txbodyFp) [Some $ paymentKeyInfoPair wallet0] submitTx execConfig cEra signedProposalTx governanceActionTxId <- H.noteM $ retrieveTransactionId execConfig signedProposalTx @@ -245,7 +246,7 @@ hprop_constitutional_committee_add_new = integrationWorkspace "constitutional-co , verificationKey = error "unused" } drepSKeys = map (defaultDRepKeyPair . snd) drepVotes - signingKeys = SomeKeyPair <$> paymentKeyInfoPair wallet0:poolNodePaymentKeyPair:drepSKeys + signingKeys = Some <$> paymentKeyInfoPair wallet0:poolNodePaymentKeyPair:drepSKeys voteTxFp <- signTx execConfig cEra gov "signed-vote-tx" voteTxBodyFp signingKeys diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs index d958e9c502a..d35e0737d54 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs @@ -12,6 +12,7 @@ module Cardano.Testnet.Test.Gov.DRepActivity import Cardano.Api as Api import Cardano.Api.Eon.ShelleyBasedEra (ShelleyLedgerEra) +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (EpochInterval (EpochInterval, unEpochInterval), drepExpiry) import Cardano.Ledger.Conway.Core (EraGov, curPParamsGovStateL) @@ -286,7 +287,7 @@ voteChangeProposal execConfig epochStateView sbe work prefix governanceActionTxI voteTxBodyFp <- createVotingTxBody execConfig epochStateView sbe baseDir "vote-tx-body" voteFiles wallet - let signingKeys = SomeKeyPair <$> (paymentKeyInfoPair wallet:(defaultDRepKeyPair . snd <$> votes)) + let signingKeys = Some <$> (paymentKeyInfoPair wallet:(defaultDRepKeyPair . snd <$> votes)) voteTxFp <- signTx execConfig cEra baseDir "signed-vote-tx" voteTxBodyFp signingKeys submitTx execConfig cEra voteTxFp diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs index 4ccd9aa4379..1d5fcca563c 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs @@ -5,6 +5,7 @@ module Cardano.Testnet.Test.Gov.DRepDeposit ) where import Cardano.Api +import Cardano.Api.Experimental (Some (..)) import qualified Cardano.Api.Ledger as L import Cardano.Testnet @@ -84,7 +85,7 @@ hprop_ledger_events_drep_deposits = integrationWorkspace "drep-deposits" $ \temp drepRegTxBody1 <- createCertificatePublicationTxBody execConfig epochStateView sbe drepDir1 "reg-cert-txbody" drepRegCert1 wallet0 drepSignedRegTx1 <- signTx execConfig cEra drepDir1 "signed-reg-tx" - drepRegTxBody1 [SomeKeyPair drepKeyPair1, SomeKeyPair $ paymentKeyInfoPair wallet0] + drepRegTxBody1 [Some drepKeyPair1, Some $ paymentKeyInfoPair wallet0] failToSubmitTx execConfig cEra drepSignedRegTx1 "ConwayDRepIncorrectDeposit" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs index 5e21b03ad43..cdd92a8abe0 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs @@ -9,6 +9,7 @@ module Cardano.Testnet.Test.Gov.NoConfidence ) where import Cardano.Api as Api +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger import Cardano.Api.Shelley @@ -184,7 +185,7 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat ] signedProposalTx <- signTx execConfig cEra work "signed-proposal" - (File txbodyFp) [SomeKeyPair $ paymentKeyInfoPair wallet0] + (File txbodyFp) [Some $ paymentKeyInfoPair wallet0] submitTx execConfig cEra signedProposalTx @@ -216,12 +217,12 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat -- Submit votes voteTxBodyFp <- DRep.createVotingTxBody execConfig epochStateView sbe work "vote-tx-body" allVoteFiles wallet0 - let spoSigningKeys = [SomeKeyPair $ defaultSpoColdKeyPair n | (_, n) <- spoVotes] - drepSigningKeys = [SomeKeyPair $ defaultDRepKeyPair n | (_, n) <- drepVotes] + let spoSigningKeys = [Some $ defaultSpoColdKeyPair n | (_, n) <- spoVotes] + drepSigningKeys = [Some $ defaultDRepKeyPair n | (_, n) <- drepVotes] allVoteSigningKeys = spoSigningKeys ++ drepSigningKeys voteTxFp <- signTx execConfig cEra work "signed-vote-tx" voteTxBodyFp - (SomeKeyPair (paymentKeyInfoPair wallet0) : allVoteSigningKeys) + (Some (paymentKeyInfoPair wallet0) : allVoteSigningKeys) submitTx execConfig cEra voteTxFp diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs index ff4ed11caff..42a8031294a 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs @@ -11,6 +11,7 @@ module Cardano.Testnet.Test.Gov.PParamChangeFailsSPO ) where import Cardano.Api as Api +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (Coin (..), EpochInterval (EpochInterval)) import Cardano.Testnet @@ -180,7 +181,7 @@ failToVoteChangeProposalWithSPOs ceo execConfig epochStateView work prefix voteTxBodyFp <- createVotingTxBody execConfig epochStateView sbe baseDir "vote-tx-body" voteFiles wallet - let signingKeys = SomeKeyPair (paymentKeyInfoPair wallet):(SomeKeyPair . defaultSpoColdKeyPair . snd <$> votes) + let signingKeys = Some (paymentKeyInfoPair wallet):(Some . defaultSpoColdKeyPair . snd <$> votes) voteTxFp <- signTx execConfig cEra baseDir "signed-vote-tx" voteTxBodyFp signingKeys failToSubmitTx execConfig cEra voteTxFp "DisallowedVoters" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs index f0174043d1c..025d2774592 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs @@ -11,6 +11,7 @@ module Cardano.Testnet.Test.Gov.PredefinedAbstainDRep import Cardano.Api as Api import Cardano.Api.Eon.ShelleyBasedEra (ShelleyLedgerEra) +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (EpochInterval (EpochInterval)) import Cardano.Ledger.Conway.Core (ppNOptL) @@ -42,8 +43,7 @@ import qualified Testnet.Process.Run as H import qualified Testnet.Property.Util as H import Testnet.Start.Types import Testnet.Types (KeyPair (..), - PaymentKeyInfo (paymentKeyInfoAddr, paymentKeyInfoPair), - SomeKeyPair (SomeKeyPair), StakingKey) + PaymentKeyInfo (paymentKeyInfoAddr, paymentKeyInfoPair), StakingKey) import Hedgehog import qualified Hedgehog.Extras as H @@ -158,8 +158,8 @@ delegateToAlwaysAbstain execConfig epochStateView sbe work prefix -- Sign transaction repRegSignedRegTx1 <- signTx execConfig cEra baseDir "signed-reg-tx" - repRegTxBody1 [ SomeKeyPair (paymentKeyInfoPair payingWallet) - , SomeKeyPair skeyPair] + repRegTxBody1 [ Some (paymentKeyInfoPair payingWallet) + , Some skeyPair] -- Submit transaction submitTx execConfig cEra repRegSignedRegTx1 @@ -281,7 +281,7 @@ makeDesiredPoolNumberChangeProposal execConfig epochStateView ceo work prefix ] signedProposalTx <- signTx execConfig cEra baseDir "signed-proposal" - (File proposalBody) [SomeKeyPair $ paymentKeyInfoPair wallet] + (File proposalBody) [Some $ paymentKeyInfoPair wallet] submitTx execConfig cEra signedProposalTx @@ -326,7 +326,7 @@ voteChangeProposal execConfig epochStateView sbe work prefix voteFiles wallet voteTxFp <- signTx execConfig cEra baseDir "signed-vote-tx" voteTxBodyFp - (SomeKeyPair (paymentKeyInfoPair wallet):[SomeKeyPair $ defaultDRepKeyPair n | (_, n) <- votes]) + (Some (paymentKeyInfoPair wallet):[Some $ defaultDRepKeyPair n | (_, n) <- votes]) submitTx execConfig cEra voteTxFp -- | Obtains the @desiredPoolNumberValue@ from the protocol parameters. diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs index c098342219d..0d97c8b5808 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs @@ -9,6 +9,7 @@ module Cardano.Testnet.Test.Gov.ProposeNewConstitution ) where import Cardano.Api as Api +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger (Coin (..), EpochInterval (..)) import qualified Cardano.Crypto.Hash as L @@ -199,7 +200,7 @@ hprop_ledger_events_propose_new_constitution = integrationWorkspace "propose-new ] signedProposalTx <- signTx execConfig cEra gov "signed-proposal" - (File txbodyFp) [SomeKeyPair $ paymentKeyInfoPair wallet1] + (File txbodyFp) [Some $ paymentKeyInfoPair wallet1] submitTx execConfig cEra signedProposalTx @@ -218,7 +219,7 @@ hprop_ledger_events_propose_new_constitution = integrationWorkspace "propose-new voteTxBodyFp <- createVotingTxBody execConfig epochStateView sbe work "vote-tx-body" voteFiles wallet0 - let signingKeys = SomeKeyPair <$> (paymentKeyInfoPair wallet0:(defaultDRepKeyPair . snd <$> allVotes)) + let signingKeys = Some <$> (paymentKeyInfoPair wallet0:(defaultDRepKeyPair . snd <$> allVotes)) voteTxFp <- signTx execConfig cEra gov "signed-vote-tx" voteTxBodyFp signingKeys submitTx execConfig cEra voteTxFp diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs index dcb239eafa9..60332862042 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs @@ -9,6 +9,7 @@ module Cardano.Testnet.Test.Gov.ProposeNewConstitutionSPO ) where import Cardano.Api +import Cardano.Api.Experimental (Some (..)) import Cardano.Api.Ledger import qualified Cardano.Ledger.Conway.Governance as L @@ -135,7 +136,7 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose , "--out-file", txBodyFp ] - txBodySigned <- signTx execConfig cEra work "proposal-signed-tx" (File txBodyFp) [SomeKeyPair $ paymentKeyInfoPair wallet0] + txBodySigned <- signTx execConfig cEra work "proposal-signed-tx" (File txBodyFp) [Some $ paymentKeyInfoPair wallet0] submitTx execConfig cEra txBodySigned @@ -160,8 +161,8 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose votesTxBody <- createVotingTxBody execConfig epochStateView sbe work "vote-tx-body" votes wallet0 votesSignedTx <- signTx execConfig cEra work "vote-signed-tx" - votesTxBody (SomeKeyPair (paymentKeyInfoPair wallet0) - :[SomeKeyPair $ defaultSpoColdKeyPair n | n <- [1..3]]) + votesTxBody (Some (paymentKeyInfoPair wallet0) + :[Some $ defaultSpoColdKeyPair n | n <- [1..3]]) -- Call should fail, because SPOs are unallowed to vote on the constitution failToSubmitTx execConfig cEra votesSignedTx "DisallowedVoters"