Skip to content

Commit

Permalink
Implement createByronUpdateProposalVote
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Jan 23, 2023
1 parent e74f9f6 commit 22350fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
26 changes: 10 additions & 16 deletions cardano-testnet/src/Testnet/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,11 @@ cardanoTestnet testnetOptions H.Conf {..} = do
1

forM_ bftNodesN $ \n -> do
execCli_
[ "byron", "governance", "create-proposal-vote"
, "--proposal-filepath", tempAbsPath </> "update-proposal"
, "--testnet-magic", show @Int testnetMagic
, "--signing-key", tempAbsPath </> "byron/delegate-keys.00" <> show @Int (n - 1) <> ".key"
, "--vote-yes"
, "--output-filepath", tempAbsPath </> "update-vote.00" <> show @Int (n - 1)
]
createByronUpdateProposalVote
testnetMagic
(tempAbsPath </> "update-proposal")
(tempAbsPath </> "byron/delegate-keys.00" <> show @Int (n - 1) <> ".key")
(tempAbsPath </> "update-vote.00" <> show @Int (n - 1))

createByronUpdateProposal
testnetMagic
Expand All @@ -371,14 +368,11 @@ cardanoTestnet testnetOptions H.Conf {..} = do
2

forM_ bftNodesN $ \n ->
execCli_
[ "byron", "governance", "create-proposal-vote"
, "--proposal-filepath", tempAbsPath </> "update-proposal-1"
, "--testnet-magic", show @Int testnetMagic
, "--signing-key", tempAbsPath </> "byron/delegate-keys.00" <> show @Int (n - 1) <> ".key"
, "--vote-yes"
, "--output-filepath", tempAbsPath </> "update-vote-1.00" <> show @Int (n - 1)
]
createByronUpdateProposalVote
testnetMagic
(tempAbsPath </> "update-proposal-1")
(tempAbsPath </> "byron/delegate-keys.00" <> show @Int (n - 1) <> ".key")
(tempAbsPath </> "update-vote-1.00" <> show @Int (n - 1))

-- Generated genesis keys and genesis files
H.noteEachM_ . H.listDirectory $ tempAbsPath </> "byron"
Expand Down
14 changes: 14 additions & 0 deletions cardano-testnet/src/Testnet/Commands/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module Testnet.Commands.Governance
( createByronUpdateProposal
, createByronUpdateProposalVote
) where

import Prelude
Expand Down Expand Up @@ -31,3 +32,16 @@ createByronUpdateProposal testnetMagic signingKeyFp updateProposalFp ptclMajorVe
, "--system-tag", "linux"
, "--installer-hash", "0"
]

createByronUpdateProposalVote
:: (MonadTest m, MonadCatch m, MonadIO m)
=> Int -> String -> String -> String -> m ()
createByronUpdateProposalVote testnetMagic updateProposalFp signingKey outputFp =
execCli_
[ "byron", "governance", "create-proposal-vote"
, "--proposal-filepath", updateProposalFp
, "--testnet-magic", show testnetMagic
, "--signing-key", signingKey
, "--vote-yes"
, "--output-filepath", outputFp
]

0 comments on commit 22350fb

Please sign in to comment.