Skip to content
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

Governance / CIP-95 #1638

Merged
merged 52 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f25782d
wip: drep registration
errfrom Jul 21, 2024
a866e4c
Fix formatting
errfrom Jul 21, 2024
c939e03
Merge branch 'dshuiski/cardano-node-v9.0.0' into dshuiski/gov
errfrom Jul 21, 2024
26ebecf
Re-enable nix checks
errfrom Jul 21, 2024
002099c
Bump kupo to v2.9.0, Fix ctl runtime vm
errfrom Jul 22, 2024
6142de2
Fix ctl-e2e-test check, Re-generate spago-packages.nix
errfrom Jul 22, 2024
0547cf7
Provide DRep private key as part of KeyWallet init
errfrom Jul 24, 2024
d3033ff
Re-generate spago-packages.nix
errfrom Jul 24, 2024
6a663d7
Add `ownDrepPubKey` and `ownDrepPubKeyHash`
errfrom Jul 24, 2024
89d8dea
Revise `WalletSpec`: Remove constructors for individual wallets
errfrom Jul 24, 2024
582649d
Merge branch 'develop' into dshuiski/gov
errfrom Jul 24, 2024
bfbcb50
Bump transaction-builder, Fix remaining conflicts
errfrom Jul 24, 2024
2669b1b
Fix ctl-scaffold
errfrom Jul 24, 2024
786fb4c
Fix integration tests
errfrom Jul 25, 2024
aa7d67a
Fix unit tests
errfrom Jul 25, 2024
a9b5fcd
Add functions for retrieving own (un)registered pub stake keys
errfrom Jul 25, 2024
20ddd72
Update template
errfrom Jul 25, 2024
6fccc63
Merge branch 'dshuiski/conway' into dshuiski/gov
errfrom Jul 26, 2024
f0e8b42
Revise own(Un)RegisteredPubStakeKeys impl for KeyWallet, add warning
errfrom Jul 26, 2024
77e457f
Add RegisterDrep and DelegateVoteAbstain examples for KeyWallet
errfrom Jul 26, 2024
a2d0f3c
Re-generate spago-packages.nix
errfrom Jul 26, 2024
fe44090
Extend RegisterDrep example to cover UpdateDrepCert and UnregDrepCert
errfrom Jul 26, 2024
78059ad
Add Gov.SubmitProposal example
errfrom Jul 26, 2024
25948fc
Add Gov.SubmitProposal example for KeyWallet, Fix getRewardAddresses
errfrom Jul 26, 2024
b09c459
Extend Gov.SubmitProposal example to Gov.SubmitVoteSimple
errfrom Jul 29, 2024
92c81ac
Revise signData for KeyWallet, Support signing with DRep key
errfrom Jul 31, 2024
81b99ab
Update cardano-nix flake input
errfrom Jul 31, 2024
51619c8
Update Cip30Mock, Add simple tests for CIP-95 methods
errfrom Jul 31, 2024
1a51878
Update template
errfrom Jul 31, 2024
127cc20
Fix CTL runtime deps in shellFor
errfrom Aug 1, 2024
e4f5761
Merge branch 'develop' into dshuiski/gov
errfrom Aug 1, 2024
405346d
Update CHANGELOG.md
errfrom Aug 1, 2024
2935e97
Add Gov.ManageDrepScript example
errfrom Aug 1, 2024
5fdb406
Handle all supported certificates during balancing
errfrom Aug 1, 2024
a3621d8
Add Gov.SubmitVoteScript example, Update CHANGELOG.md
errfrom Aug 1, 2024
01708d6
Add KnownWallet helper
errfrom Aug 2, 2024
7c7b72a
Update template
errfrom Aug 2, 2024
cbf1fa8
Treat KeyWallet stake keys as unregistered
errfrom Aug 2, 2024
8b42cc0
Fix Cip30Mock
errfrom Aug 2, 2024
0746e3e
Merge branch 'develop' into dshuiski/gov
errfrom Aug 8, 2024
c43c3f1
Update CHANGELOG.md
errfrom Aug 8, 2024
19df4b6
Bump cardano-transaction-builder
errfrom Aug 8, 2024
0fdc13c
Fix SubmitProposal examples
errfrom Aug 8, 2024
c86bdce
Run cardano-testnet in Conway era, other changes below
errfrom Aug 9, 2024
d6bc7be
Merge branch 'develop' into dshuiski/gov
errfrom Aug 9, 2024
09b3359
Fix Examples.PlutusV2.ReferenceInputsAndScripts
errfrom Aug 9, 2024
5a745da
Switch to 'preview' network for ctl-runtime vm
errfrom Aug 9, 2024
6862164
Fix `addFakeSignatures`: avoid double counting
errfrom Aug 9, 2024
6b089f4
Remove unused imports
errfrom Aug 9, 2024
73f0782
Skip GetDatumsByHashes test case
errfrom Aug 9, 2024
cde5eac
Use versioned revisions in packages.dhall
klntsky Aug 14, 2024
fe6bbde
Release v9.2.0
klntsky Aug 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 72 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,120 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [[v9.1.0]](#v910)
- [[Unreleased]](#unreleased)
- [Added](#added)
- [Changed](#changed)
- [Removed](#removed)
- [Fixed](#fixed)
- [[v9.0.0]](#v900)
- [Deprecated](#deprecated)
- [[v9.1.0]](#v910)
- [Added](#added-1)
- [Removed](#removed-1)
- [Changed](#changed-1)
- [Removed](#removed-1)
- [Fixed](#fixed-1)
- [[v8.0.0]](#v800)
- [[v9.0.0]](#v900)
- [Deprecated](#deprecated)
- [Added](#added-2)
- [Removed](#removed-2)
- [Changed](#changed-2)
- [Fixed](#fixed-2)
- [Removed](#removed-2)
- [[v7.0.0]](#v700)
- [[v8.0.0]](#v800)
- [Added](#added-3)
- [Changed](#changed-3)
- [Fixed](#fixed-3)
- [Removed](#removed-3)
- [[v6.0.0]](#v600)
- [[v7.0.0]](#v700)
- [Added](#added-4)
- [Changed](#changed-4)
- [Fixed](#fixed-4)
- [Removed](#removed-4)
- [[v5.0.0]](#v500)
- [[v6.0.0]](#v600)
- [Added](#added-5)
- [Changed](#changed-5)
- [Removed](#removed-5)
- [Fixed](#fixed-5)
- [Runtime Dependencies](#runtime-dependencies)
- [[v4.0.2] - 2023-01-17](#v402---2023-01-17)
- [Fixed](#fixed-6)
- [[v4.0.1] - 2022-12-20](#v401---2022-12-20)
- [Removed](#removed-5)
- [[v5.0.0]](#v500)
- [Added](#added-6)
- [[v4.0.0] - 2022-12-15](#v400---2022-12-15)
- [Added](#added-7)
- [Changed](#changed-6)
- [Removed](#removed-6)
- [Fixed](#fixed-6)
- [Runtime Dependencies](#runtime-dependencies)
- [[v4.0.2] - 2023-01-17](#v402---2023-01-17)
- [Fixed](#fixed-7)
- [Runtime Dependencies](#runtime-dependencies-1)
- [[3.0.0] - 2022-11-21](#300---2022-11-21)
- [[v4.0.1] - 2022-12-20](#v401---2022-12-20)
- [Added](#added-7)
- [[v4.0.0] - 2022-12-15](#v400---2022-12-15)
- [Added](#added-8)
- [Changed](#changed-7)
- [Removed](#removed-7)
- [Fixed](#fixed-8)
- [Runtime Dependencies](#runtime-dependencies-2)
- [[2.0.0] - 2022-09-12](#200---2022-09-12)
- [Runtime Dependencies](#runtime-dependencies-1)
- [[3.0.0] - 2022-11-21](#300---2022-11-21)
- [Added](#added-9)
- [Changed](#changed-8)
- [Removed](#removed-8)
- [Fixed](#fixed-9)
- [[2.0.0-alpha] - 2022-07-05](#200-alpha---2022-07-05)
- [Runtime Dependencies](#runtime-dependencies-2)
- [[2.0.0] - 2022-09-12](#200---2022-09-12)
- [Added](#added-10)
- [Removed](#removed-9)
- [Changed](#changed-9)
- [Removed](#removed-9)
- [Fixed](#fixed-10)
- [[1.1.0] - 2022-06-30](#110---2022-06-30)
- [[2.0.0-alpha] - 2022-07-05](#200-alpha---2022-07-05)
- [Added](#added-11)
- [Removed](#removed-10)
- [Changed](#changed-10)
- [Fixed](#fixed-11)
- [[1.0.1] - 2022-06-17](#101---2022-06-17)
- [[1.1.0] - 2022-06-30](#110---2022-06-30)
- [Fixed](#fixed-12)
- [[1.0.1] - 2022-06-17](#101---2022-06-17)
- [Fixed](#fixed-13)
- [[1.0.0] - 2022-06-10](#100---2022-06-10)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## [Unreleased]

### Added

- CIP-95 methods for querying the connected wallet account's public DRep key and
its registered and unregistered public stake keys: `ownDrepPubKey`,
`ownDrepPubKeyHash`, `ownRegisteredPubStakeKeys`, `ownUnregisteredPubStakeKeys`.
These new functions can be imported from `Contract.Wallet`.
**WARNING**: KeyWallet does not distinguish between registered and unregistered
stake keys due to the limitations of the underlying query layer. This means that
all controlled stake keys are returned as part of `ownUnregisteredPubStakeKeys`,
and the response of `ownRegisteredPubStakeKeys` is always an empty array.
([#1638](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1638))

- New examples demonstrating various interactions with the Cardano governance
system: `Gov.DelegateVoteAbstain`, `Gov.ManageDrep`, `Gov.ManageDrepScript`,
`Gov.SubmitVote`, `Gov.SubmitVoteScript`.
([#1638](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1638))

### Changed

- `signData` for KeyWallet: Previously, the supplied address was discarded,
and the wallet's address was used as part of the COSE `Sig_structure`. Now,
the provided address is inspected, and the keys associated with that address
are used. Additionally, KeyWallet now supports signing with the DRep key as
specified in CIP-95. Keep in mind that if the wallet does not have the required
keys, an error will be thrown.
([#1638](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1638))

### Removed

- Constructors for individual wallets (like Nami or Eternl) from `WalletSpec`.
Use `ConnectToGenericCip30` with the right wallet identifier instead. To obtain
the identifier of a known wallet, refer to `KnownWallet` and `walletName` from
`Contract.Config`.
([#1638](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1638))

### Fixed

- `getRewardAddresses` for KeyWallet now returns actual reward addresses
without the payment part.
([#1638](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1638))

## [v9.1.0]

This version provides basic Conway support and replaces Plutip with `cardano-testnet`.
Expand Down
13 changes: 11 additions & 2 deletions examples/AdditionalUtxos.purs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ import Contract.BalanceTxConstraints
( BalancerConstraints
, mustUseAdditionalUtxos
)
import Contract.Config (ContractParams, testnetNamiConfig)
import Contract.Config
( ContractParams
, KnownWallet(Nami)
, WalletSpec(ConnectToGenericCip30)
, testnetConfig
, walletName
)
import Contract.Log (logInfo')
import Contract.Monad (Contract, launchAff_, runContract)
import Contract.PlutusData (Datum, PlutusData(Integer))
Expand All @@ -53,7 +59,10 @@ import Test.QuickCheck (arbitrary)
import Test.QuickCheck.Gen (randomSampleOne)

main :: Effect Unit
main = example testnetNamiConfig
main = example $ testnetConfig
{ walletSpec =
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
}

example :: ContractParams -> Effect Unit
example contractParams =
Expand Down
13 changes: 11 additions & 2 deletions examples/AlwaysMints.purs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ import Cardano.Types.Int as Int
import Cardano.Types.PlutusScript as PlutusScript
import Cardano.Types.RedeemerDatum as RedeemerDatum
import Cardano.Types.Transaction as Transaction
import Contract.Config (ContractParams, testnetNamiConfig)
import Contract.Config
( ContractParams
, KnownWallet(Nami)
, WalletSpec(ConnectToGenericCip30)
, testnetConfig
, walletName
)
import Contract.Log (logInfo')
import Contract.Monad (Contract, launchAff_, liftContractM, runContract)
import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptFromEnvelope)
Expand All @@ -30,7 +36,10 @@ import Ctl.Examples.Helpers (mkAssetName) as Helpers
import Data.Map as Map

main :: Effect Unit
main = example testnetNamiConfig
main = example $ testnetConfig
{ walletSpec =
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
}

contract :: Contract Unit
contract = do
Expand Down
13 changes: 11 additions & 2 deletions examples/AlwaysSucceeds.purs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ import Cardano.Types.RedeemerDatum as RedeemerDatum
import Cardano.Types.Transaction as Transaction
import Cardano.Types.TransactionUnspentOutput (toUtxoMap)
import Contract.Address (mkAddress)
import Contract.Config (ContractParams, testnetNamiConfig)
import Contract.Config
( ContractParams
, KnownWallet(Nami)
, WalletSpec(ConnectToGenericCip30)
, testnetConfig
, walletName
)
import Contract.Log (logInfo')
import Contract.Monad (Contract, launchAff_, runContract)
import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptFromEnvelope)
Expand All @@ -54,7 +60,10 @@ import Data.Map as Map
import Effect.Exception (error)

main :: Effect Unit
main = example testnetNamiConfig
main = example $ testnetConfig
{ walletSpec =
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
}

contract :: Contract Unit
contract = do
Expand Down
13 changes: 11 additions & 2 deletions examples/AwaitTxConfirmedWithTimeout.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ module Ctl.Examples.AwaitTxConfirmedWithTimeout
import Contract.Prelude

import Cardano.AsCbor (decodeCbor)
import Contract.Config (ContractParams, testnetNamiConfig)
import Contract.Config
( ContractParams
, KnownWallet(Nami)
, WalletSpec(ConnectToGenericCip30)
, testnetConfig
, walletName
)
import Contract.Log (logInfo')
import Contract.Monad (Contract, launchAff_, runContract, throwContractError)
import Contract.Prim.ByteArray (hexToByteArrayUnsafe)
Expand All @@ -20,7 +26,10 @@ import Control.Monad.Error.Class (try)
import Partial.Unsafe (unsafePartial)

main :: Effect Unit
main = example testnetNamiConfig
main = example $ testnetConfig
{ walletSpec =
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
}

example :: ContractParams -> Effect Unit
example cfg = launchAff_ do
Expand Down
Loading