Skip to content

Commit

Permalink
bump cardano-api srp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Aug 21, 2023
1 parent eed575f commit 763b3e5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 29 deletions.
15 changes: 2 additions & 13 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2023-08-08T19:56:09Z
, cardano-haskell-packages 2023-08-18T20:00:00Z
, cardano-haskell-packages 2023-08-21T16:55:07Z

packages:
cardano-cli
Expand Down Expand Up @@ -44,21 +44,10 @@ write-ghc-environment-files: always
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-consensus
tag: 2097e06a2ede5ba49ec54fed76763af18bc7fccf
--sha256: sha256-LPM4VXlyEmWjmEnxP8/S6JvBvZuKrehhQMz8uneI6eU=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-api
tag: 513de10344151360282633f1d1f254c5c3b820b8
tag: fef23f249bf59bf87257372abb5f4bc5c5d5efd9
--sha256: sha256-TIQ9eRJQMpkO8Wd87FmzzBexd8nBoptvlEwmaoWeANc=
subdir:
cardano-api
Expand Down
6 changes: 3 additions & 3 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.15
, cardano-api ^>= 8.14
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down Expand Up @@ -224,7 +224,7 @@ test-suite cardano-cli-test
, base16-bytestring
, bech32 >= 1.1.0
, bytestring
, cardano-api:{cardano-api, internal} ^>= 8.15
, cardano-api:{cardano-api, internal} ^>= 8.14
, cardano-api-gen ^>= 8.1.1.0
, cardano-cli
, cardano-cli:cardano-cli-test-lib
Expand Down Expand Up @@ -268,7 +268,7 @@ test-suite cardano-cli-golden
build-depends: aeson >= 1.5.6.0
, base16-bytestring
, bytestring
, cardano-api:{cardano-api, gen} ^>= 8.15
, cardano-api:{cardano-api, gen} ^>= 8.14
, cardano-binary
, cardano-cli
, cardano-cli:cardano-cli-test-lib
Expand Down
14 changes: 7 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Control.Monad.Except (ExceptT)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except.Extra
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as Map
import qualified Data.Text.Encoding as Text
import Data.Text.Encoding.Error

Expand Down Expand Up @@ -83,7 +84,6 @@ runGovernanceActionCreateNoConfidence
runGovernanceActionCreateNoConfidence cOn (EraBasedNoConfidence network deposit returnAddr propAnchor txid ind outFp) = do
returnKeyHash <- readStakeKeyHash returnAddr
let sbe = conwayEraOnwardsToShelleyBasedEra cOn
-- TODO: Left off here, fix type errors and update cardano-api with helper functions
proposal = createProposalProcedure
sbe
network
Expand Down Expand Up @@ -155,15 +155,15 @@ runGovernanceActionCreateNewCommittee cOn (EraBasedNewCommittee network deposit
govActIdentifier = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> prevActId
quorumRational = toRational q

_oldCommitteeKeyHashes <- mapM readStakeKeyHash old
_newCommitteeKeyHashes <- mapM (readStakeKeyHash . fst) new
oldCommitteeKeyHashes <- mapM readStakeKeyHash old
newCommitteeKeyHashes <- mapM (\(stakeKey, expEpoch) -> (,expEpoch) <$> readStakeKeyHash stakeKey) new

returnKeyHash <- readStakeKeyHash retAddr

let proposeNewCommittee = ProposeNewCommittee
govActIdentifier
(error "old committee key hashes" )
(error "new committee key hashes with expiration epochs")
oldCommitteeKeyHashes
(Map.fromList newCommitteeKeyHashes)
quorumRational
proposal = createProposalProcedure
sbe
Expand Down Expand Up @@ -220,7 +220,7 @@ runGovernanceActionTreasuryWithdrawal
-> ExceptT GovernanceActionsError IO ()
runGovernanceActionTreasuryWithdrawal cOn (EraBasedTreasuryWithdrawal network deposit returnAddr propAnchor treasuryWithdrawal outFp) = do
returnKeyHash <- readStakeKeyHash returnAddr
_withdrawals <- sequence [ (,ll) <$> stakeIdentifiertoCredential stakeIdentifier
withdrawals <- sequence [ (network,,ll) <$> stakeIdentifiertoCredential stakeIdentifier
| (stakeIdentifier,ll) <- treasuryWithdrawal
]
let sbe = conwayEraOnwardsToShelleyBasedEra cOn
Expand All @@ -229,7 +229,7 @@ runGovernanceActionTreasuryWithdrawal cOn (EraBasedTreasuryWithdrawal network de
network
deposit
returnKeyHash
(TreasuryWithdrawal (error "[(Network, StakeCredential, Lovelace)]"))
(TreasuryWithdrawal withdrawals)
(uncurry createAnchor (fmap Text.encodeUtf8 propAnchor))

firstExceptT GovernanceActionsCmdWriteFileError . newExceptT
Expand Down
8 changes: 4 additions & 4 deletions cardano-cli/src/Cardano/CLI/Json/Friendly.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module Cardano.CLI.Json.Friendly (friendlyTxBS, friendlyTxBodyBS) where
import Cardano.Api as Api
import Cardano.Api.Byron (KeyWitness (ByronKeyWitness))
import qualified Cardano.Api.Ledger as Ledger
import qualified Cardano.Ledger.Conway.TxCert as ConwayLedger
import Cardano.Api.Shelley (Address (ShelleyAddress), Hash (..),
KeyWitness (ShelleyBootstrapWitness, ShelleyKeyWitness), ShelleyLedgerEra,
StakeAddress (..), fromShelleyPaymentCredential, fromShelleyScriptHash,
fromShelleyStakeReference, toShelleyLovelace, toShelleyStakeCredential)

import qualified Cardano.Ledger.Conway.TxCert as ConwayLedger
import qualified Cardano.Ledger.Credential as Shelley
import qualified Cardano.Ledger.Shelley.API as Shelley

Expand Down Expand Up @@ -381,16 +381,16 @@ renderCertificate sbe = \case
, "certificate" .= conwayToObject w credential
]
Ledger.AuthCommitteeHotKeyTxCert coldCred hotCred
| Shelley.ScriptHashObj{} <- coldCred -> error "TODO Conway"
| Shelley.ScriptHashObj{} <- hotCred -> error "TODO Conway"
| Shelley.ScriptHashObj{} <- coldCred -> error "renderCertificate: TODO Conway era"
| Shelley.ScriptHashObj{} <- hotCred -> error "renderCertificate: TODO Conway era"
| Shelley.KeyHashObj (Shelley.KeyHash coldKey) <- coldCred
, Shelley.KeyHashObj (Shelley.KeyHash hotKey) <- hotCred ->
"Constitutional committee member hot key registration" .= object
[ "cold key hash" .= String (textShow coldKey)
, "hot key hash" .= String (textShow hotKey)
]
Ledger.ResignCommitteeColdTxCert cred -> case cred of
Shelley.ScriptHashObj{} -> error "TODO Conway"
Shelley.ScriptHashObj{} -> error "renderCertificate: TODO Conway era"
Shelley.KeyHashObj (Shelley.KeyHash coldKey) ->
"Constitutional committee cold key resignation" .= object
[ "cold key hash" .= String (textShow coldKey)
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Legacy/Commands/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pNetwork = asum $ mconcat
]
, Opt.flag' Ledger.Testnet $ mconcat
[ Opt.long "testnet-magic"
, Opt.help "Specify a testnet magic id."
, Opt.help "Use the testnet magic id."
]
]
]
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Types/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data NewConstitution
, ncEra :: AnyShelleyBasedEra
, ncDeposit :: Lovelace
, ncVotingStakeCredential :: VerificationKeyOrFile StakePoolKey
, ncPrevGovActIf :: Maybe (TxId, Word32)
, ncPrevGovActId :: Maybe (TxId, Word32)
, ncPropAnchor :: (Ledger.Url, Text)
, ncConstitution :: Constitution
, ncFilePath :: NewConstitutionFile Out
Expand Down

0 comments on commit 763b3e5

Please sign in to comment.