Skip to content

Commit

Permalink
Merge branch 'main' into ch/transaction-view-json
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhammann authored Oct 9, 2023
2 parents 7a6c164 + 3cf1808 commit 5f50e6b
Show file tree
Hide file tree
Showing 211 changed files with 2,544 additions and 2,277 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ README.* @input-output-hk/d

*.nix @input-output-hk/core-tech-devx @input-output-hk/core-tech-release
flake.lock @input-output-hk/core-tech-devx @input-output-hk/core-tech-release
.github/workflows @input-output-hk/core-tech-devx @input-output-hk/core-tech-release @input-output-hk/core-tech
.github/workflows @input-output-hk/core-tech-devx @input-output-hk/core-tech-release
configuration/ @input-output-hk/core-tech-devx @input-output-hk/core-tech-release
2 changes: 1 addition & 1 deletion 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-09-27T09:51:59Z
, cardano-haskell-packages 2023-10-05T18:49:55Z

packages:
cardano-cli
Expand Down
79 changes: 79 additions & 0 deletions cardano-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,84 @@
# Changelog for cardano-cli

## 8.12.0.0

- Add support for committee hot key witnesses
(feature, compatible)
[PR 338](https://github.com/input-output-hk/cardano-cli/pull/338)

- Make it possible to use cc hot keys for `conway governance vote create`
(feature, compatible)
[PR 337](https://github.com/input-output-hk/cardano-cli/pull/337)

- Move files that are not golden files into `input` directory
(compatible, improvement)
[PR 327](https://github.com/input-output-hk/cardano-cli/pull/327)

- create-poll, answer-poll, verify-poll: move to 'babbage governance' block
(breaking, improvement)
[PR 322](https://github.com/input-output-hk/cardano-cli/pull/322)

## 8.11.0.0

- Fix missing redeemers in certificate delegation and deregistration
(bugfix)
[PR 306](https://github.com/input-output-hk/cardano-cli/pull/306)

- Upgrade to `cardano-api-8.25.0.1`
(compatible, maintenance)
[PR 329](https://github.com/input-output-hk/cardano-cli/pull/329)

- Update to cardano-api-8.24
(feature)
[PR 324](https://github.com/input-output-hk/cardano-cli/pull/324)

- Add Cold Committee Key text envelope
(bugfix)
[PR 323](https://github.com/input-output-hk/cardano-cli/pull/323)

- Update to `cardano-api-8.23.1.0`
(feature, compatible)
[PR 320](https://github.com/input-output-hk/cardano-cli/pull/320)

- Tidy up query command structure
(compatible, improvement)
[PR 318](https://github.com/input-output-hk/cardano-cli/pull/318)

- - Remove SPO registration bits from drep registration-certificate command
- Remove drep command from eras before Conway
- Remove `AnyRegistrationTarget`
- Remove `RegistrationTarget`
(breaking, improvement)
[PR 309](https://github.com/input-output-hk/cardano-cli/pull/309)

- Use `caseShelleyToBabbageOrConwayEraOnwards` from `cardano-api`
(compatible, improvement)
[PR 317](https://github.com/input-output-hk/cardano-cli/pull/317)

- Remove redundant conversions in JSON friendly instances
(improvement)
[PR 280](https://github.com/input-output-hk/cardano-cli/pull/280)

- Regularise era based command structure
(improvement)
[PR 279](https://github.com/input-output-hk/cardano-cli/pull/279)

- Simplify era handling
(improvement)
[PR 277](https://github.com/input-output-hk/cardano-cli/pull/277)

- A number of flags appeared in the parameters of new-committee multiple times, with the same long flag, making the parser break. This PR disambiguates the repeated occurences.
(breaking)
[PR 302](https://github.com/input-output-hk/cardano-cli/pull/302)

- Implementation of the create-info command
(feature)
[PR 292](https://github.com/input-output-hk/cardano-cli/pull/292)

- Update to the pre-commit script, so that it fails on hlint errors
(improvement)
[PR 296](https://github.com/input-output-hk/cardano-cli/pull/296)

## 8.10.0.0

- Rename `SomeWitness` to `SomeSigningWitness`. Rename constructors to avoid name conflicts. Move to `Key` module.
Expand Down
19 changes: 12 additions & 7 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.4

name: cardano-cli
version: 8.10.0.0
version: 8.12.0.0
synopsis: The Cardano command-line interface
description: The Cardano command-line interface.
copyright: 2020-2023 Input Output Global Inc (IOG).
Expand Down Expand Up @@ -75,6 +75,7 @@ library
Cardano.CLI.EraBased.Commands.Governance.Actions
Cardano.CLI.EraBased.Commands.Governance.Committee
Cardano.CLI.EraBased.Commands.Governance.DRep
Cardano.CLI.EraBased.Commands.Governance.Poll
Cardano.CLI.EraBased.Commands.Governance.Query
Cardano.CLI.EraBased.Commands.Governance.Vote
Cardano.CLI.EraBased.Commands.Key
Expand All @@ -91,6 +92,7 @@ library
Cardano.CLI.EraBased.Options.Governance.Actions
Cardano.CLI.EraBased.Options.Governance.Committee
Cardano.CLI.EraBased.Options.Governance.DRep
Cardano.CLI.EraBased.Options.Governance.Poll
Cardano.CLI.EraBased.Options.Governance.Query
Cardano.CLI.EraBased.Options.Governance.Vote
Cardano.CLI.EraBased.Options.Key
Expand All @@ -108,6 +110,7 @@ library
Cardano.CLI.EraBased.Run.Governance.Actions
Cardano.CLI.EraBased.Run.Governance.Committee
Cardano.CLI.EraBased.Run.Governance.DRep
Cardano.CLI.EraBased.Run.Governance.Poll
Cardano.CLI.EraBased.Run.Governance.Query
Cardano.CLI.EraBased.Run.Governance.Vote
Cardano.CLI.EraBased.Run.Key
Expand Down Expand Up @@ -200,7 +203,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.22
, cardano-api ^>= 8.25.2.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down Expand Up @@ -231,8 +234,8 @@ library
, microlens
, network
, optparse-applicative-fork
, ouroboros-consensus >= 0.9
, ouroboros-consensus-cardano >= 0.8
, ouroboros-consensus >= 0.12
, ouroboros-consensus-cardano >= 0.10
, ouroboros-consensus-protocol >= 0.5.0.4
, ouroboros-network-api
, ouroboros-network-protocols
Expand Down Expand Up @@ -271,7 +274,9 @@ library cardano-cli-test-lib
, bytestring
, cardano-api
, cardano-cli
, directory
, exceptions
, filepath
, hedgehog
, hedgehog-extras ^>= 0.4.7.0
, process
Expand Down Expand Up @@ -361,6 +366,9 @@ test-suite cardano-cli-golden
Test.Golden.Byron.UpdateProposal
Test.Golden.Byron.Vote
Test.Golden.Byron.Witness
Test.Golden.EraBased.Governance.AnswerPoll
Test.Golden.EraBased.Governance.CreatePoll
Test.Golden.EraBased.Governance.VerifyPoll
Test.Golden.ErrorsSpec
Test.Golden.Governance.Action
Test.Golden.Governance.Committee
Expand All @@ -376,9 +384,6 @@ test-suite cardano-cli-golden
Test.Golden.Shelley.Genesis.KeyGenGenesis
Test.Golden.Shelley.Genesis.KeyGenUtxo
Test.Golden.Shelley.Genesis.KeyHash
Test.Golden.Shelley.Governance.AnswerPoll
Test.Golden.Shelley.Governance.CreatePoll
Test.Golden.Shelley.Governance.VerifyPoll
Test.Golden.Shelley.Key.ConvertCardanoAddressKey
Test.Golden.Shelley.Metadata.StakePoolMetadata
Test.Golden.Shelley.MultiSig.Address
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/Byron/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ txSpendGenesisUTxOByronPBFT gc nId sk (ByronAddress bAddr) outs = do
, txFee = TxFeeImplicit ByronEraOnlyByron
, txValidityRange =
( TxValidityNoLowerBound
, TxValidityNoUpperBound ValidityNoUpperBoundInByronEra
, defaultTxValidityUpperBound
)
, txMetadata = TxMetadataNone
, txAuxScripts = TxAuxScriptsNone
Expand Down Expand Up @@ -209,7 +209,7 @@ txSpendUTxOByronPBFT nId sk txIns outs = do
, txFee = TxFeeImplicit ByronEraOnlyByron
, txValidityRange =
( TxValidityNoLowerBound
, TxValidityNoUpperBound ValidityNoUpperBoundInByronEra
, defaultTxValidityUpperBound
)
, txMetadata = TxMetadataNone
, txAuxScripts = TxAuxScriptsNone
Expand Down
30 changes: 7 additions & 23 deletions cardano-cli/src/Cardano/CLI/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module Cardano.CLI.Environment
, getEnvSocketPath
) where

import Cardano.Api (AnyCardanoEra (..), AnyShelleyBasedEra (..),
AnyShelleyToBabbageEra (..), CardanoEra (..), NetworkId (..), NetworkMagic (..),
ShelleyBasedEra (..), ShelleyToBabbageEra (..))
import Cardano.Api (AnyCardanoEra (..), CardanoEra (..), EraInEon (..), NetworkId (..),
NetworkMagic (..), ShelleyBasedEra (..), ShelleyToBabbageEra (..),
forEraInEonMaybe)

import Data.Word (Word32)
import qualified System.Environment as IO
Expand All @@ -38,31 +38,15 @@ getEnvCli = do
, envCliAnyCardanoEra = mCardanoEra
}

envCliAnyShelleyBasedEra :: EnvCli -> Maybe AnyShelleyBasedEra
envCliAnyShelleyBasedEra :: EnvCli -> Maybe (EraInEon ShelleyBasedEra)
envCliAnyShelleyBasedEra envCli = do
AnyCardanoEra era <- envCliAnyCardanoEra envCli
forEraInEonMaybe era EraInEon

case era of
ByronEra -> Nothing
ShelleyEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraShelley
AllegraEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraAllegra
MaryEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraMary
AlonzoEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraAlonzo
BabbageEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraBabbage
ConwayEra -> Just $ AnyShelleyBasedEra ShelleyBasedEraConway

envCliAnyShelleyToBabbageEra :: EnvCli -> Maybe AnyShelleyToBabbageEra
envCliAnyShelleyToBabbageEra :: EnvCli -> Maybe (EraInEon ShelleyToBabbageEra)
envCliAnyShelleyToBabbageEra envCli = do
AnyCardanoEra era <- envCliAnyCardanoEra envCli

case era of
ByronEra -> Nothing
ShelleyEra -> Just $ AnyShelleyToBabbageEra ShelleyToBabbageEraShelley
AllegraEra -> Just $ AnyShelleyToBabbageEra ShelleyToBabbageEraAllegra
MaryEra -> Just $ AnyShelleyToBabbageEra ShelleyToBabbageEraMary
AlonzoEra -> Just $ AnyShelleyToBabbageEra ShelleyToBabbageEraAlonzo
BabbageEra -> Just $ AnyShelleyToBabbageEra ShelleyToBabbageEraBabbage
ConwayEra -> Nothing
forEraInEonMaybe era EraInEon

-- | If the environment variable @CARDANO_NODE_NETWORK_ID@ is set, then return the network id therein.
-- Otherwise, return 'Nothing'.
Expand Down
5 changes: 5 additions & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Cardano.CLI.EraBased.Commands.Governance.Actions
import Cardano.CLI.EraBased.Commands.Governance.Committee
import Cardano.CLI.EraBased.Commands.Governance.DRep
import Cardano.CLI.EraBased.Commands.Governance.Query
import Cardano.CLI.EraBased.Commands.Governance.Poll
import Cardano.CLI.EraBased.Commands.Governance.Vote
import Cardano.CLI.Types.Common

Expand All @@ -36,6 +37,8 @@ data GovernanceCmds era
(GovernanceCommitteeCmds era)
| GovernanceDRepCmds
(GovernanceDRepCmds era)
| GovernancePollCmds
(GovernancePollCmds era)
| GovernanceVoteCmds
(GovernanceVoteCmds era)
| GovernanceQueryCmds
Expand All @@ -55,6 +58,8 @@ renderGovernanceCmds = \case
renderGovernanceCommitteeCmds cmds
GovernanceDRepCmds cmds ->
renderGovernanceDRepCmds cmds
GovernancePollCmds cmds ->
renderGovernancePollCmds cmds
GovernanceVoteCmds cmds ->
renderGovernanceVoteCmds cmds
GovernanceQueryCmds cmds ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Cardano.CLI.EraBased.Commands.Governance.DRep
) where

import Cardano.Api
import qualified Cardano.Api.Ledger as Ledger
import Cardano.Api.Shelley

import Cardano.CLI.Types.Common
import Cardano.CLI.Types.Key
Expand All @@ -27,6 +29,7 @@ data GovernanceDRepCmds era
(ConwayEraOnwards era)
(VerificationKeyOrHashOrFile DRepKey)
Lovelace
(Maybe (Ledger.Anchor (Ledger.EraCrypto (ShelleyLedgerEra era))))
(File () Out)

renderGovernanceDRepCmds :: ()
Expand Down
37 changes: 37 additions & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Poll.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE LambdaCase #-}

module Cardano.CLI.EraBased.Commands.Governance.Poll
( GovernancePollCmds(..) , renderGovernancePollCmds) where

import Cardano.Api
import Cardano.Api.Shelley

import Data.Text (Text)

data GovernancePollCmds era
= GovernanceCreatePoll -- ^ Create a SPO poll
(BabbageEraOnwards era) {- TODO smelc, use BabbageEraOnly here instead -}
Text -- ^ Prompt
[Text] -- ^ Choices
(Maybe Word) -- ^ Nonce
(File GovernancePoll Out)
| GovernanceAnswerPoll -- ^ Answer a SPO poll
(BabbageEraOnwards era) {- TODO smelc, use BabbageEraOnly here instead -}
(File GovernancePoll In) -- ^ Poll file
(Maybe Word) -- ^ Answer index
(Maybe (File () Out)) -- ^ Tx file
| GovernanceVerifyPoll -- ^ Verify answer to a given SPO poll
(BabbageEraOnwards era) {- TODO smelc, use BabbageEraOnly here instead -}
(File GovernancePoll In) -- Poll file
(File (Tx ()) In) -- Tx file
(Maybe (File () Out)) -- Tx file


renderGovernancePollCmds :: ()
=> GovernancePollCmds era
-> Text
renderGovernancePollCmds = \case
GovernanceCreatePoll {} -> "governance create-poll"
GovernanceAnswerPoll {} -> "governance answer-poll"
GovernanceVerifyPoll {} -> "governance verify-poll"
Loading

0 comments on commit 5f50e6b

Please sign in to comment.