Skip to content

Commit 6e969c6

Browse files
authored
Merge pull request #6037 from IntersectMBO/mgalazyn/fix/add-correct-contents-for-proposal-anchor-constutituion
cardano-testnet | Add correct contents for proposal anchor and constitution
2 parents 9dbf0b1 + ac1c30f commit 6e969c6

File tree

10 files changed

+81
-13
lines changed

10 files changed

+81
-13
lines changed

cardano-testnet/src/Testnet/Process/Cli/DRep.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ makeActivityChangeProposal execConfig epochStateView ceo work
362362
baseDir <- H.createDirectoryIfMissing work
363363

364364
proposalAnchorFile <- H.note $ baseDir </> "sample-proposal-anchor"
365-
H.writeFile proposalAnchorFile "dummy anchor data"
365+
H.writeFile proposalAnchorFile $
366+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
367+
366368

367369
proposalAnchorDataHash <- execCli' execConfig
368370
[ "hash", "anchor-data", "--file-text", proposalAnchorFile

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ hprop_constitutional_committee_add_new = integrationWorkspace "constitutional-co
110110
proposalDataFp <- H.note $ gov </> "sample-proposal-data"
111111
updateCommitteeFp <- H.note $ gov </> "update-cc.action"
112112

113-
H.writeFile proposalAnchorFp "dummy anchor data"
113+
H.writeFile proposalAnchorFp $
114+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
114115
H.writeFile proposalDataFp "dummy proposal data"
115116

116117
proposalAnchorDataHash <- execCli' execConfig

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/InfoAction.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ hprop_ledger_events_info_action = integrationRetryWorkspace 2 "info-hash" $ \tem
8888
proposalAnchorFile <- H.note $ work </> gov </> "sample-proposal-anchor"
8989
infoActionFp <- H.note $ work </> gov </> "info.action"
9090

91-
H.writeFile proposalAnchorFile "dummy anchor data"
91+
-- pls configure your editors to trim trailing whitespace >.>
92+
H.writeFile proposalAnchorFile $
93+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
9294

9395
proposalAnchorDataHash <- execCli' execConfig
9496
[ "hash", "anchor-data", "--file-text", proposalAnchorFile

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat
145145
-- Create proposal to add a new member to the committee
146146

147147
proposalAnchorFile <- H.note $ work </> "sample-proposal-anchor"
148-
H.writeFile proposalAnchorFile "dummy anchor data"
148+
H.writeFile proposalAnchorFile $
149+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
149150

150151
proposalAnchorDataHash <- H.execCli' execConfig
151152
[ "hash", "anchor-data", "--file-text", proposalAnchorFile

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ makeDesiredPoolNumberChangeProposal execConfig epochStateView ceo work prefix
244244
}
245245

246246
proposalAnchorFile <- H.note $ baseDir </> "sample-proposal-anchor"
247-
H.writeFile proposalAnchorFile "dummy anchor data"
247+
H.writeFile proposalAnchorFile $
248+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
248249

249250
proposalAnchorDataHash <- H.execCli' execConfig
250251
[ "hash", "anchor-data", "--file-text", proposalAnchorFile

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import Testnet.Start.Types
4646
import Testnet.Types
4747

4848
import Hedgehog
49+
import qualified Hedgehog as H
4950
import qualified Hedgehog.Extras as H
5051

5152
-- | Execute me with:
@@ -102,13 +103,16 @@ hprop_ledger_events_propose_new_constitution = integrationWorkspace "propose-new
102103
-- Create Conway constitution
103104
gov <- H.createDirectoryIfMissing $ work </> "governance"
104105
proposalAnchorFile <- H.note $ gov </> "sample-proposal-anchor"
105-
consitutionFile <- H.note $ gov </> "sample-constitution"
106+
constitutionFile <- H.note $ gov </> "sample-constitution"
106107
constitutionActionFp <- H.note $ gov </> "constitution.action"
107108

108-
H.writeFile proposalAnchorFile "dummy anchor data"
109-
H.writeFile consitutionFile "dummy constitution data"
109+
H.writeFile proposalAnchorFile $
110+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
111+
H.copyFile
112+
"test/cardano-testnet-test/files/input/sample-constitution.txt"
113+
constitutionFile
110114
constitutionHash <- execCli' execConfig
111-
[ "hash", "anchor-data", "--file-text", consitutionFile
115+
[ "hash", "anchor-data", "--file-text", constitutionFile
112116
]
113117

114118
proposalAnchorDataHash <- execCli' execConfig
@@ -232,7 +236,7 @@ hprop_ledger_events_propose_new_constitution = integrationWorkspace "propose-new
232236
length votes === fromIntegral numVotes
233237

234238
-- We check that constitution was succcessfully ratified
235-
void . H.leftFailM . evalIO . runExceptT $
239+
void . H.leftFailM . H.evalIO . runExceptT $
236240
foldEpochState
237241
configurationFile
238242
socketPath

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose
9191
constitutionFile <- H.note $ work </> gov </> "sample-constitution"
9292
constitutionActionFp <- H.note $ work </> gov </> "constitution.action"
9393

94-
H.writeFile proposalAnchorFile "dummy anchor data"
95-
H.writeFile constitutionFile "dummy constitution data"
94+
H.writeFile proposalAnchorFile $
95+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
96+
97+
H.copyFile
98+
"test/cardano-testnet-test/files/input/sample-constitution.txt"
99+
constitutionFile
96100
constitutionHash <- execCli' execConfig
97101
[ "hash", "anchor-data", "--file-text", constitutionFile
98102
]

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryWithdrawal.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ hprop_ledger_events_treasury_withdrawal = integrationRetryWorkspace 2 "treasury
9191
proposalAnchorFile <- H.note $ work </> gov </> "sample-proposal-anchor"
9292
treasuryWithdrawalActionFp <- H.note $ work </> gov </> "treasury-withdrawal.action"
9393

94-
H.writeFile proposalAnchorFile "dummy anchor data"
94+
-- pls configure your editors to trim trailing whitespace >.>
95+
H.writeFile proposalAnchorFile $
96+
unlines [ "These are the reasons: " , "" , "1. First" , "2. Second " , "3. Third" ]
9597

9698
proposalAnchorDataHash <- execCli' execConfig
9799
[ "hash", "anchor-data", "--file-text", proposalAnchorFile
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Preamble
2+
3+
We, the zaniest inhabitants of the peculiar and bewildering land of Barataria, in honor of our illustrious Governor, Sancho Panza, renowned for his comically charming ordinances, do hereby present this Constitution to tickle your fancy and uphold the values of laughter, merriment, and the pursuit of hilarity for all our citizens.
4+
5+
Article I: The Right to Absurdity
6+
7+
Wine-Watering Rights: Every Baratarian shall have the inalienable right to water down their wine as they see fit, provided they can still manage a tipsy jig.
8+
9+
Fashion Freedom: Citizens are encouraged to dress inappropriately for the sheer joy of it, as long as it does not involve the use of sharp objects, poisonous animals, or explosives.
10+
11+
Article II: The Role of Government: Keeping It Lighthearted
12+
13+
Official Clown: There shall be an official court jester whose duty is to make the Governor laugh at least once a day. Failure to amuse may result in banishment to a neighboring kingdom.
14+
15+
Puns and Pranks: All government proceedings shall include at least one pun and one harmless prank per session to maintain the mirthful spirit of Barataria.
16+
17+
Article III: The Economic Circus
18+
19+
Foolish Redistribution: The government shall engage in a monthly "wealth lottery," redistributing riches by catapulting bags of gold into the air and letting them fall where they may.
20+
21+
Tax Deductions for Silly Hats: Citizens who wear absurd hats shall receive generous tax deductions, fostering creativity and fashion-forward thinking.
22+
23+
Article IV: Justice, Comedy, and the Absurd
24+
25+
Trial by Tickling: In the interest of justice and merriment, all trials shall include a "tickle test" to determine guilt or innocence. Giggles are considered a sign of innocence.
26+
27+
Innocent Until Proven Clueless: It shall be presumed that every Baratarian is innocent of any wrongdoing until they can convincingly demonstrate their utter cluelessness in court.
28+
29+
Article V: Education and Clown Colleges
30+
31+
Clown Colleges for All: Barataria shall establish Clown Colleges to ensure that every citizen has the opportunity to master the art of clowning and perform slapstick humor.
32+
33+
Silly Science: Research grants shall be awarded to projects that explore the science of whoopee cushions, banana peels, and rubber chickens.
34+
35+
Article VI: Defense and Pranks
36+
37+
Pillow Fort Defense: Barataria's defense strategy shall revolve around building impregnable pillow forts and inviting would-be invaders to epic pillow fights to resolve conflicts.
38+
39+
War Declarations through Whoopie Cushions: Before declaring war, Barataria shall send a diplomatic envoy to the offending nation armed only with whoopee cushions to express our discontent.
40+
41+
Article VII: Amendments and Clown-novations
42+
43+
Whimsical Amendments: Amendments to this Constitution shall be proposed in the form of a joke or a riddle, and they must receive a hearty laugh from at least three-quarters of the citizens to be adopted.
44+
Article VIII: Final Pratfalls
45+
46+
Ratification with a Pie in the Face: This Constitution shall be ratified in a grand ceremony involving a pie in the face of the official ratifier, ensuring a silly and sticky beginning for Barataria.
47+
48+
Effective Clowning Date: This Constitution shall come into effect immediately upon the eruption of the first uncontrollable fit of laughter.
49+
50+
In witness whereof, we, the undersigned jesters, pranksters, and merrymakers, do hereby establish and adopt this Constitution to make Barataria a haven of hilarity, where laughter reigns supreme, and seriousness is only allowed on April Fool's Day.

nix/haskell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ let
210210
"cardano-testnet/test/cardano-testnet-golden/files/golden/shelley_node_default_config.json"
211211
"cardano-testnet/test/cardano-testnet-golden/files/golden/shelley_node_default_config.json"
212212
"cardano-testnet/test/cardano-testnet-test/files/golden/tx.failed.response.json.golden"
213+
"cardano-testnet/test/cardano-testnet-test/files/input/sample-constitution.txt"
213214
"cardano-testnet/files/data/alonzo/genesis.alonzo.spec.json"
214215
"cardano-testnet/files/data/conway/genesis.conway.spec.json"
215216
];

0 commit comments

Comments
 (0)