Skip to content

Commit

Permalink
Merge pull request #1546 from input-output-hk/chore/lw-11932-drep-pro…
Browse files Browse the repository at this point in the history
…vider-in-gha-test-deployed-envs

Chore/lw 11932 drep provider in gha test deployed envs
  • Loading branch information
mirceahasegan authored Dec 11, 2024
2 parents d550edb + 7621721 commit 3da1f4a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-deploy-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
CLUSTER: ${{ inputs.cluster }}
ENVIRONMENT: ${{ inputs.environment }}
MNEMONIC: ${{ secrets.MNEMONIC }}
BLOCKFROST_BACKEND_PREVIEW: ${{ secrets.BLOCKFROST_BACKEND_PREVIEW }}
BLOCKFROST_BACKEND_PREPROD: ${{ secrets.BLOCKFROST_BACKEND_PREPROD }}
NETWORK: ${{ inputs.network }}
run: |
./src/scripts/generate-dotenv.sh
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEST_CLIENT_ASSET_PROVIDER=http
TEST_CLIENT_ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4014/"}'
TEST_CLIENT_CHAIN_HISTORY_PROVIDER=ws
TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}'
TEST_CLIENT_DREP_PROVIDER='blockfrost'
TEST_CLIENT_DREP_PROVIDER=blockfrost
TEST_CLIENT_DREP_PROVIDER_PARAMS='{"baseUrl":"http://localhost:3015"}'
TEST_CLIENT_HANDLE_PROVIDER=http
TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4011/"}'
Expand Down
10 changes: 8 additions & 2 deletions packages/e2e/src/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ assetProviderFactory.register(BLOCKFROST_PROVIDER, async (params: any, logger):
return new Promise<AssetProvider>(async (resolve) => {
resolve(
new BlockfrostAssetProvider(
new BlockfrostClient({ baseUrl: params.baseUrl }, { rateLimiter: { schedule: (task) => task() } }),
new BlockfrostClient(
{ apiVersion: params.apiVersion, baseUrl: params.baseUrl, projectId: params.projectId },
{ rateLimiter: { schedule: (task) => task() } }
),
logger
)
);
Expand Down Expand Up @@ -190,7 +193,10 @@ drepProviderFactory.register(BLOCKFROST_PROVIDER, async (params: any, logger): P
return new Promise<DRepProvider>(async (resolve) => {
resolve(
new BlockfrostDRepProvider(
new BlockfrostClient({ baseUrl: params.baseUrl }, { rateLimiter: { schedule: (task) => task() } }),
new BlockfrostClient(
{ apiVersion: params.apiVersion, baseUrl: params.baseUrl, projectId: params.projectId },
{ rateLimiter: { schedule: (task) => task() } }
),
logger
)
);
Expand Down
12 changes: 6 additions & 6 deletions packages/e2e/src/scripts/generate-dotenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ esac
case $NETWORK in
preprod)
networkMagic=1
bfUrl="https://cardano-preprod.blockfrost.io"
bfProjectId="${BLOCKFROST_BACKEND_PREPROD}"
;;
preview)
networkMagic=2
;;
sanchonet)
networkMagic=4
bfUrl="https://cardano-preview.blockfrost.io"
bfProjectId="${BLOCKFROST_BACKEND_PREVIEW}"
;;
*)
echo "${NETWORK}: Unknown network"
Expand All @@ -40,9 +41,8 @@ TEST_CLIENT_ASSET_PROVIDER=http
TEST_CLIENT_ASSET_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
TEST_CLIENT_CHAIN_HISTORY_PROVIDER=ws
TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
TEST_CLIENT_DREP_PROVIDER: 'blockfrost'
# TODO: use blockfrost URL
TEST_CLIENT_DREP_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:3015"}'
TEST_CLIENT_DREP_PROVIDER=blockfrost
TEST_CLIENT_DREP_PROVIDER_PARAMS='{\"baseUrl\":\"${bfUrl}\",\"projectId\":\"${bfProjectId}\",\"apiVersion\":\"v0\"}'
TEST_CLIENT_HANDLE_PROVIDER=http
TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
TEST_CLIENT_NETWORK_INFO_PROVIDER=ws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ describe('PersonalWallet/drepRetirement', () => {
);

expect(drepDelegatees).toEqual([
{ delegateRepresentative: expect.objectContaining({ active: false, id: drepId1 }) },
{ delegateRepresentative: expect.objectContaining({ active: true, amount: 0n, hasScript: false, id: drepId2 }) }
{ delegateRepresentative: expect.objectContaining({ active: false, hasScript: false, id: drepId1 }) },
{ delegateRepresentative: expect.objectContaining({ active: true, hasScript: false, id: drepId2 }) }
]);
});

Expand Down Expand Up @@ -290,7 +290,7 @@ describe('PersonalWallet/drepRetirement', () => {

expect(drepDelegatees).toEqual([
{ delegateRepresentative: { __typename: 'AlwaysAbstain' } },
{ delegateRepresentative: expect.objectContaining({ active: false, amount: 0n, hasScript: false, id: drepId2 }) }
{ delegateRepresentative: expect.objectContaining({ active: false, hasScript: false, id: drepId2 }) }
]);
});
});

0 comments on commit 3da1f4a

Please sign in to comment.