From 44dc188bb7d56686a44a4c82c19501d327ffec8a Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:29:00 +0200 Subject: [PATCH] test: add new verification step in `Mithril Client multi-platform test` --- .github/workflows/test-client.yml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index a2c03787556..f60da28ca3e 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -77,7 +77,9 @@ jobs: shell: bash run: | CTX_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])') + CSD_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])') echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT + echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT - name: Assessing aggregator capabilities (Windows) id: aggregator_capability_windows @@ -86,7 +88,9 @@ jobs: run: | aria2c -o aggregator_capabilities.json $AGGREGATOR_ENDPOINT CTX_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])' aggregator_capabilities.json) + CSD_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])' aggregator_capabilities.json) echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT + echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT - name: Checkout binary uses: dawidd6/action-download-artifact@v3 @@ -152,6 +156,28 @@ jobs: working-directory: ./bin run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-transaction certify $TRANSACTIONS_HASHES_TO_CERTIFY + - name: Cardano Stake Distribution / list and get last epoch and hash + if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true' + shell: bash + working-directory: ./bin + run: | + ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution list + CMD_OUTPUT=$(./mithril-client --unstable cardano-stake-distribution list --json) + echo "CARDANO_STAKE_DISTRIBUTION_EPOCH=$(echo "$CMD_OUTPUT" | jq -r '.[0].epoch')" >> $GITHUB_ENV + echo "CARDANO_STAKE_DISTRIBUTION_HASH=$(echo "$CMD_OUTPUT" | jq -r '.[0].hash')" >> $GITHUB_ENV + + - name: Cardano Stake Distribution / download & restore latest by epoch + if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true' + shell: bash + working-directory: ./bin + run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_EPOCH + + - name: Cardano Stake Distribution / download & restore latest by hash + if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true' + shell: bash + working-directory: ./bin + run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH + test-docker: strategy: fail-fast: false @@ -178,7 +204,9 @@ jobs: shell: bash run: | CTX_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])') + CSD_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])') echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT + echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT - name: Prepare Mithril client command id: command @@ -227,6 +255,25 @@ jobs: shell: bash run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-transaction certify $TRANSACTIONS_HASHES_TO_CERTIFY + - name: Cardano Stake Distribution / list and get last epoch and hash + if: steps.aggregator_capability.outputs.csd_enabled == 'true' + shell: bash + run: | + ${{ steps.command.outputs.mithril_client }} --unstable cardano-stake-distribution list + CMD_OUTPUT=$(${{ steps.command.outputs.mithril_client }} cardano-stake-distribution list --json) + echo "CARDANO_STAKE_DISTRIBUTION_EPOCH=$(echo "$CMD_OUTPUT" | jq -r '.[0].epoch')" >> $GITHUB_ENV + echo "CARDANO_STAKE_DISTRIBUTION_HASH=$(echo "$CMD_OUTPUT" | jq -r '.[0].hash')" >> $GITHUB_ENV + + - name: Cardano Stake Distribution / download & restore latest by epoch + if: steps.aggregator_capability.outputs.csd_enabled == 'true' + shell: bash + run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_EPOCH --download-dir /app + + - name: Cardano Stake Distribution / download & restore latest by hash + if: steps.aggregator_capability.outputs.csd_enabled == 'true' + shell: bash + run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH --download-dir /app + test-mithril-client-wasm: strategy: fail-fast: false