Skip to content

Commit

Permalink
Implement tests for updated stake address registration and
Browse files Browse the repository at this point in the history
deregistration commands
  • Loading branch information
Jimbo4350 committed Jun 22, 2021
1 parent d71b858 commit bb88222
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ golden_shelleyStakeAddressDeregistrationCertificate :: Property
golden_shelleyStakeAddressDeregistrationCertificate = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
verificationKeyFile <- noteInputFile "test/data/golden/shelley/keys/stake_keys/verification_key"
deregistrationCertFile <- noteTempFile tempDir "deregistrationCertFile"
scriptDeregistrationCertFile <- noteTempFile tempDir "scripDeregistrationCertFile"
exampleScript <- noteInputFile "../scripts/plutus/scripts/typed-guessing-game-redeemer-42-datum-42.plutus"

void $ execCardanoCLI
[ "stake-address","deregistration-certificate"
Expand All @@ -26,4 +28,13 @@ golden_shelleyStakeAddressDeregistrationCertificate = propertyOnce . H.moduleWor

H.assertFileOccurences 1 "Stake Address Deregistration Certificate" deregistrationCertFile

void $ execCardanoCLI
[ "stake-address","deregistration-certificate"
, "--stake-script-file", exampleScript
, "--out-file", scriptDeregistrationCertFile
]

H.assertFileOccurences 1 "Stake Address Deregistration Certificate" scriptDeregistrationCertFile


H.assertEndsWithSingleNewline deregistrationCertFile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ golden_shelleyStakeAddressRegistrationCertificate :: Property
golden_shelleyStakeAddressRegistrationCertificate = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
keyGenStakingVerificationKeyFile <- noteInputFile "test/data/golden/shelley/keys/stake_keys/verification_key"
registrationCertFile <- noteTempFile tempDir "registration.cert"
scriptRegistrationCertFile <- noteTempFile tempDir "script-registration.cert"
exampleScript <- noteInputFile "../scripts/plutus/scripts/typed-guessing-game-redeemer-42-datum-42.plutus"

void $ execCardanoCLI
[ "stake-address","registration-certificate"
Expand All @@ -26,4 +28,13 @@ golden_shelleyStakeAddressRegistrationCertificate = propertyOnce . H.moduleWorks

H.assertFileOccurences 1 "Stake Address Registration Certificate" registrationCertFile

void $ execCardanoCLI
[ "stake-address","registration-certificate"
, "--stake-script-file", exampleScript
, "--out-file", scriptRegistrationCertFile
]

H.assertFileOccurences 1 "Stake Address Registration Certificate" scriptRegistrationCertFile


H.assertEndsWithSingleNewline registrationCertFile

0 comments on commit bb88222

Please sign in to comment.