-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from input-output-hk/cl/always-no-confidence
Fix delegating to always-no-confidence
- Loading branch information
Showing
12 changed files
with
139 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/StakeAddress.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{- HLINT ignore "Use camelCase" -} | ||
|
||
module Test.Golden.Governance.StakeAddress where | ||
|
||
import Control.Monad (void) | ||
|
||
import Test.Cardano.CLI.Util (execCardanoCLI, noteInputFile, propertyOnce) | ||
|
||
import Hedgehog | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
import qualified Hedgehog.Extras.Test.Golden as H | ||
|
||
hprop_golden_conway_stakeaddress_delegate_no_confidence :: Property | ||
hprop_golden_conway_stakeaddress_delegate_no_confidence = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" | ||
delegFile <- H.noteTempFile tempDir "deleg" | ||
delegGold <- H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/noConfidenceDeleg.cert" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "stake-address", "vote-delegation-certificate" | ||
, "--stake-verification-key-file", vkeyFile | ||
, "--always-no-confidence" | ||
, "--out-file", delegFile | ||
] | ||
|
||
H.diffFileVsGoldenFile delegFile delegGold | ||
|
||
hprop_golden_conway_stakeaddress_delegate_always_abstain :: Property | ||
hprop_golden_conway_stakeaddress_delegate_always_abstain = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" | ||
delegFile <- H.noteTempFile tempDir "deleg" | ||
delegGold <- H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/alwaysAbstainDeleg.cert" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "stake-address", "vote-delegation-certificate" | ||
, "--stake-verification-key-file", vkeyFile | ||
, "--always-abstain" | ||
, "--out-file", delegFile | ||
] | ||
|
||
H.diffFileVsGoldenFile delegFile delegGold | ||
|
||
hprop_golden_conway_stakeaddress_delegate_pool_and_no_confidence :: Property | ||
hprop_golden_conway_stakeaddress_delegate_pool_and_no_confidence = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" | ||
vkeyPool <- noteInputFile "test/cardano-cli-golden/files/input/conway/poolCold.vkey" | ||
delegFile <- H.noteTempFile tempDir "deleg" | ||
delegGold <- H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndNoConfidenceDeleg.cert" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "stake-address", "stake-and-vote-delegation-certificate" | ||
, "--stake-verification-key-file", vkeyFile | ||
, "--cold-verification-key-file", vkeyPool | ||
, "--always-no-confidence" | ||
, "--out-file", delegFile | ||
] | ||
|
||
H.diffFileVsGoldenFile delegFile delegGold | ||
|
||
hprop_golden_conway_stakeaddress_delegate_pool_and_always_abstain :: Property | ||
hprop_golden_conway_stakeaddress_delegate_pool_and_always_abstain = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" | ||
vkeyPool <- noteInputFile "test/cardano-cli-golden/files/input/conway/poolCold.vkey" | ||
delegFile <- H.noteTempFile tempDir "deleg" | ||
delegGold <- H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndAlwaysAbstainDeleg.cert" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "stake-address", "stake-and-vote-delegation-certificate" | ||
, "--stake-verification-key-file", vkeyFile | ||
, "--cold-verification-key-file", vkeyPool | ||
, "--always-abstain" | ||
, "--out-file", delegFile | ||
] | ||
|
||
H.diffFileVsGoldenFile delegFile delegGold | ||
|
||
hprop_golden_conway_stakeaddress_delegate_pool_and_drep :: Property | ||
hprop_golden_conway_stakeaddress_delegate_pool_and_drep = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/stake.vkey" | ||
vkeyPool <- noteInputFile "test/cardano-cli-golden/files/input/conway/poolCold.vkey" | ||
vkeyDrep <- noteInputFile "test/cardano-cli-golden/files/golden/governance/drep/drep.vkey" | ||
delegFile <- H.noteTempFile tempDir "deleg" | ||
delegGold <- H.note "test/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndDrepVkeyDeleg.cert" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "stake-address", "stake-and-vote-delegation-certificate" | ||
, "--stake-verification-key-file", vkeyFile | ||
, "--cold-verification-key-file", vkeyPool | ||
, "--drep-verification-key-file", vkeyDrep | ||
, "--out-file", delegFile | ||
] | ||
|
||
H.diffFileVsGoldenFile delegFile delegGold |
5 changes: 5 additions & 0 deletions
5
...-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/alwaysAbstainDeleg.cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Vote Delegation Certificate", | ||
"cborHex": "83098200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab018102" | ||
} |
5 changes: 5 additions & 0 deletions
5
...o-cli/test/cardano-cli-golden/files/golden/governance/stakeaddress/noConfidenceDeleg.cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Vote Delegation Certificate", | ||
"cborHex": "83098200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab018103" | ||
} |
5 changes: 5 additions & 0 deletions
5
...st/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndAlwaysAbstainDeleg.cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Stake and Vote Delegation Certificate", | ||
"cborHex": "840a8200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab01581cc27cf021914a2b3bcb286d3d741979083422378c577fe757702b69888102" | ||
} |
5 changes: 5 additions & 0 deletions
5
...li/test/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndDrepVkeyDeleg.cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Stake and Vote Delegation Certificate", | ||
"cborHex": "840a8200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab01581cc27cf021914a2b3bcb286d3d741979083422378c577fe757702b69888200581ce68f9ee70599cb93d9f60678f9c6463c01938c27d9820c7bf93887a5" | ||
} |
5 changes: 5 additions & 0 deletions
5
...est/cardano-cli-golden/files/golden/governance/stakeaddress/poolAndNoConfidenceDeleg.cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Stake and Vote Delegation Certificate", | ||
"cborHex": "840a8200581cef1785cf18928f8353c90e76b7a8fc60855472d31a0ea1c1c774ab01581cc27cf021914a2b3bcb286d3d741979083422378c577fe757702b69888103" | ||
} |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/input/conway/poolCold.vkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "StakePoolVerificationKey_ed25519", | ||
"description": "Stake Pool Operator Verification Key", | ||
"cborHex": "58208b2c01cec2081e1f6464b051fd6327a8fc9ed8dabeb4f4db77ea3acad8c4d396" | ||
} |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/input/conway/stake.vkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "StakeVerificationKeyShelley_ed25519", | ||
"description": "Stake Verification Key", | ||
"cborHex": "58206562dcf0c258273a2d437d07cdf68492dc961b7277c4a5b50132b05898215778" | ||
} |
2 changes: 1 addition & 1 deletion
2
.../cardano-cli-golden/files/input/shelley/certificates/stake_address_delegation_certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"type": "CertificateShelley", | ||
"description": "Stake Address Delegation Certificate", | ||
"description": "Stake Delegation Certificate", | ||
"cborHex": "83028200581c6b69790498faca4908e4b44a1005d6dbec9a3d511fa62d4636355ff1581c4124a0c2ba8a7ba05824b3df23f706a1c8b3239446ab16709ae85aa1" | ||
} |