-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
934: Minor fixes r=dcoutts a=erikd 935: cli: Add new tests r=dcoutts a=erikd Co-authored-by: Erik de Castro Lopo <erikd@mega-nerd.com>
- Loading branch information
Showing
8 changed files
with
154 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh -u | ||
|
||
cwd=$(dirname "$0") | ||
|
||
# shellcheck source=/dev/null | ||
. "${cwd}/../core/common" | ||
|
||
# shellcheck disable=SC2154 | ||
banner "${testname}" | ||
|
||
OUTPUT_DIR="${TEST}" | ||
|
||
rm -rf "${OUTPUT_DIR}" | ||
mkdir "${OUTPUT_DIR}" | ||
|
||
error=0 | ||
|
||
${CARDANO_CLI} shelley node key-gen-stake-pool \ | ||
--verification-key-file "${OUTPUT_DIR}/key-gen-stake-pool.vkey" \ | ||
--signing-key-file "${OUTPUT_DIR}/key-gen-stake-pool.skey" | ||
|
||
assert_file_exists "${OUTPUT_DIR}/key-gen-stake-pool.vkey" | ||
assert_file_exists "${OUTPUT_DIR}/key-gen-stake-pool.skey" | ||
|
||
assert_string 'VerificationKeyStakePoolShelley' "${OUTPUT_DIR}/key-gen-stake-pool.vkey" | ||
assert_string 'SigningKeyShelley' "${OUTPUT_DIR}/key-gen-stake-pool.skey" | ||
|
||
report_result ${error} |
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,28 @@ | ||
#!/bin/sh -u | ||
|
||
cwd=$(dirname "$0") | ||
|
||
# shellcheck source=/dev/null | ||
. "${cwd}/../core/common" | ||
|
||
# shellcheck disable=SC2154 | ||
banner "${testname}" | ||
|
||
OUTPUT_DIR="${TEST}" | ||
|
||
rm -rf "${OUTPUT_DIR}" | ||
mkdir "${OUTPUT_DIR}" | ||
|
||
error=0 | ||
|
||
${CARDANO_CLI} shelley node key-gen-staking \ | ||
--verification-key-file "${OUTPUT_DIR}/key-gen-staking.vkey" \ | ||
--signing-key-file "${OUTPUT_DIR}/key-gen-staking.skey" | ||
|
||
assert_file_exists "${OUTPUT_DIR}/key-gen-staking.vkey" | ||
assert_file_exists "${OUTPUT_DIR}/key-gen-staking.skey" | ||
|
||
assert_string 'VerificationKeyStakingShelley' "${OUTPUT_DIR}/key-gen-staking.vkey" | ||
assert_string 'SigningKeyShelley' "${OUTPUT_DIR}/key-gen-staking.skey" | ||
|
||
report_result ${error} |
4 changes: 4 additions & 0 deletions
4
cardano-cli/test/cli/stake-address-deregistration-certificate/data/key-gen-staking.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,4 @@ | ||
type: VerificationKeyStakingShelley | ||
title: Free form text | ||
cbor-hex: | ||
18b958202e21d6d5d8d292a4037b1ae9554ec5d7d9ccf412583a2484b7d51ce9efc2a58f |
37 changes: 37 additions & 0 deletions
37
cardano-cli/test/cli/stake-address-deregistration-certificate/run
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,37 @@ | ||
#!/bin/sh -u | ||
|
||
cwd=$(dirname "$0") | ||
|
||
# shellcheck source=/dev/null | ||
. "${cwd}/../core/common" | ||
|
||
# shellcheck disable=SC2154 | ||
banner "${testname}" | ||
|
||
if test -d cardano-cli ; then | ||
cd cardano-cli || exit 1 | ||
fi | ||
|
||
OUTPUT_DIR="${TEST}" | ||
|
||
rm -rf "${OUTPUT_DIR}" | ||
mkdir "${OUTPUT_DIR}" | ||
|
||
DATA_DIR="test/cli/${testname}/data" | ||
if test -d cardano-cli ; then | ||
DATA_DIR="cardano-cli/${DATA_DIR}" | ||
fi | ||
|
||
error=0 | ||
|
||
${CARDANO_CLI} shelley stake-address deregistration-certificate \ | ||
--verification-key-file "${DATA_DIR}/key-gen-staking.vkey" \ | ||
--out-file "${OUTPUT_DIR}/deregistration.cert" | ||
fail_on_error $? | ||
|
||
assert_file_exists "${OUTPUT_DIR}/deregistration.cert" | ||
assert_string 'DelegationCertificateShelley' "${OUTPUT_DIR}/deregistration.cert" | ||
|
||
#----------------------------- | ||
|
||
report_result ${error} |
4 changes: 4 additions & 0 deletions
4
cardano-cli/test/cli/stake-address-registration-certificate/data/key-gen-staking.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,4 @@ | ||
type: VerificationKeyStakingShelley | ||
title: Free form text | ||
cbor-hex: | ||
18b958202e21d6d5d8d292a4037b1ae9554ec5d7d9ccf412583a2484b7d51ce9efc2a58f |
37 changes: 37 additions & 0 deletions
37
cardano-cli/test/cli/stake-address-registration-certificate/run
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,37 @@ | ||
#!/bin/sh -u | ||
|
||
cwd=$(dirname "$0") | ||
|
||
# shellcheck source=/dev/null | ||
. "${cwd}/../core/common" | ||
|
||
# shellcheck disable=SC2154 | ||
banner "${testname}" | ||
|
||
if test -d cardano-cli ; then | ||
cd cardano-cli || exit 1 | ||
fi | ||
|
||
OUTPUT_DIR="${TEST}" | ||
|
||
rm -rf "${OUTPUT_DIR}" | ||
mkdir "${OUTPUT_DIR}" | ||
|
||
DATA_DIR="test/cli/${testname}/data" | ||
if test -d cardano-cli ; then | ||
DATA_DIR="cardano-cli/${DATA_DIR}" | ||
fi | ||
|
||
error=0 | ||
|
||
${CARDANO_CLI} shelley stake-address registration-certificate \ | ||
--verification-key-file "${DATA_DIR}/key-gen-staking.vkey" \ | ||
--out-file "${OUTPUT_DIR}/registration.cert" | ||
fail_on_error $? | ||
|
||
assert_file_exists "${OUTPUT_DIR}/registration.cert" | ||
assert_string 'DelegationCertificateShelley' "${OUTPUT_DIR}/registration.cert" | ||
|
||
#----------------------------- | ||
|
||
report_result ${error} |