From b641bdb4f0bdbbda1d905610029b8810408877dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C4=B1z=C4=B1r=20Sefa=20=C4=B0rken?= Date: Fri, 23 Aug 2024 18:22:43 +0300 Subject: [PATCH] chore(e2e): rename some env vars with TEST_* prefix --- .../workflows/continuous-integration-e2e.yaml | 32 +++---- packages/e2e/.env.example | 32 +++---- packages/e2e/README.md | 64 +++++++------- packages/e2e/src/environment.ts | 64 +++++++------- packages/e2e/src/factories.ts | 84 +++++++++++++------ packages/e2e/src/scripts/generate-dotenv.sh | 28 +++---- packages/e2e/src/util/util.ts | 4 +- .../wallet-init/wallet-init.test.ts | 36 +++++--- .../test/ogmios/ogmios-interactions.test.ts | 10 ++- .../e2e/test/providers/HandleProvider.test.ts | 6 +- .../PersonalWallet/plutusTest.test.ts | 12 ++- .../extension/background/services.ts | 4 +- .../background/supplyDistributionTracker.ts | 4 +- 13 files changed, 219 insertions(+), 161 deletions(-) diff --git a/.github/workflows/continuous-integration-e2e.yaml b/.github/workflows/continuous-integration-e2e.yaml index 30172407ad8..aa3d1790124 100644 --- a/.github/workflows/continuous-integration-e2e.yaml +++ b/.github/workflows/continuous-integration-e2e.yaml @@ -6,26 +6,26 @@ env: # ----------------------------------------------------------------------------------------- KEY_MANAGEMENT_PROVIDER: 'inMemory' KEY_MANAGEMENT_PARAMS: '{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}' - ASSET_PROVIDER: 'http' - ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4014/"}' - CHAIN_HISTORY_PROVIDER: 'http' - CHAIN_HISTORY_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_ASSET_PROVIDER: 'http' + TEST_CLIENT_ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4014/"}' + TEST_CLIENT_CHAIN_HISTORY_PROVIDER: 'http' + TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' DB_SYNC_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/cexplorer' - HANDLE_PROVIDER: 'http' - HANDLE_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4011/"}' + TEST_CLIENT_HANDLE_PROVIDER: 'http' + TEST_CLIENT_HANDLE_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4011/"}' STAKE_POOL_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool' STAKE_POOL_TEST_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool_test' - NETWORK_INFO_PROVIDER: 'ws' - NETWORK_INFO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_NETWORK_INFO_PROVIDER: 'ws' + TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' OGMIOS_URL: 'ws://localhost:1340/' - REWARDS_PROVIDER: 'http' - REWARDS_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' - TX_SUBMIT_PROVIDER: 'http' - TX_SUBMIT_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' - UTXO_PROVIDER: 'http' - UTXO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' - STAKE_POOL_PROVIDER: 'http' - STAKE_POOL_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_REWARDS_PROVIDER: 'http' + TEST_CLIENT_REWARDS_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_TX_SUBMIT_PROVIDER: 'http' + TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_UTXO_PROVIDER: 'http' + TEST_CLIENT_UTXO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' + TEST_CLIENT_STAKE_POOL_PROVIDER: 'http' + TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' WS_PROVIDER_URL: 'http://localhost:4100/ws' on: diff --git a/packages/e2e/.env.example b/packages/e2e/.env.example index 5504a0b0827..c3b37a3c787 100644 --- a/packages/e2e/.env.example +++ b/packages/e2e/.env.example @@ -10,22 +10,22 @@ KEY_MANAGEMENT_PARAMS='{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{ #KEY_MANAGEMENT_PARAMS='{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"salon zoo engage submit smile frost later decide wing sight chaos renew lizard rely canal coral scene hobby scare step bus leaf tobacco slice"}' # Providers setup - required by getWallet -ASSET_PROVIDER=http -ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4014/"}' -CHAIN_HISTORY_PROVIDER=http -CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' -HANDLE_PROVIDER=http -HANDLE_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4011/"}' -NETWORK_INFO_PROVIDER=ws -NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' -REWARDS_PROVIDER=http -REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' -TX_SUBMIT_PROVIDER=http -TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' -UTXO_PROVIDER=http -UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' -STAKE_POOL_PROVIDER=http -STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_ASSET_PROVIDER=http +TEST_CLIENT_ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4014/"}' +TEST_CLIENT_CHAIN_HISTORY_PROVIDER=http +TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_HANDLE_PROVIDER=http +TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4011/"}' +TEST_CLIENT_NETWORK_INFO_PROVIDER=ws +TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_REWARDS_PROVIDER=http +TEST_CLIENT_REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_TX_SUBMIT_PROVIDER=http +TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_UTXO_PROVIDER=http +TEST_CLIENT_UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' +TEST_CLIENT_STAKE_POOL_PROVIDER=http +TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/"}' WS_PROVIDER_URL='ws://localhost:4100/ws' # Required by test:ogmios, test:blockfrost diff --git a/packages/e2e/README.md b/packages/e2e/README.md index fd4f0bfd199..15052b5873f 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -131,22 +131,22 @@ LOGGER_MIN_SEVERITY=info # Providers setup KEY_MANAGEMENT_PROVIDER=inMemory KEY_MANAGEMENT_PARAMS='{"accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":""}' -ASSET_PROVIDER=http -ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -CHAIN_HISTORY_PROVIDER=http -CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -NETWORK_INFO_PROVIDER=http -NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -REWARDS_PROVIDER=http -REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -TX_SUBMIT_PROVIDER=http -TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -UTXO_PROVIDER=http -UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -STAKE_POOL_PROVIDER=stub -STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' -HANDLE_PROVIDER=kora-labs -HANDLE_PROVIDER_PARAMS='{"serverUrl":"http://localhost:4000","policyId":""}' +TEST_CLIENT_ASSET_PROVIDER=http +TEST_CLIENT_ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_CHAIN_HISTORY_PROVIDER=http +TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_NETWORK_INFO_PROVIDER=http +TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_REWARDS_PROVIDER=http +TEST_CLIENT_REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_TX_SUBMIT_PROVIDER=http +TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_UTXO_PROVIDER=http +TEST_CLIENT_UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_STAKE_POOL_PROVIDER=stub +TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000"}' +TEST_CLIENT_HANDLE_PROVIDER=kora-labs +TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{"serverUrl":"http://localhost:4000","policyId":""}' ``` > :information_source: Notice that `KEY_MANAGEMENT_PARAMS.mnemonic` property is empty, if you leave this empty on the **local network's** e2e tests a new set of random mnemonics will be generated for you, this is the recommended way of setting up e2e tests on this network. @@ -170,22 +170,22 @@ LOGGER_MIN_SEVERITY=debug # Providers setup KEY_MANAGEMENT_PROVIDER=inMemory KEY_MANAGEMENT_PARAMS='{"accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}' -ASSET_PROVIDER=http -ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/asset"}' -CHAIN_HISTORY_PROVIDER=http -CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/chain-history"}' -HANDLE_PROVIDER=kora-labs -HANDLE_PROVIDER_PARAMS='{"serverUrl":"http://localhost:4000","policyId":""}' -NETWORK_INFO_PROVIDER=http -NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/network-info"}' -REWARDS_PROVIDER=http -REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/rewards"}' -TX_SUBMIT_PROVIDER=http -TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/tx-submit"}' -UTXO_PROVIDER=http -UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/utxo"}' -STAKE_POOL_PROVIDER=http -STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/stake-pool"}' +TEST_CLIENT_ASSET_PROVIDER=http +TEST_CLIENT_ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/asset"}' +TEST_CLIENT_CHAIN_HISTORY_PROVIDER=http +TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/chain-history"}' +TEST_CLIENT_HANDLE_PROVIDER=kora-labs +TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{"serverUrl":"http://localhost:4000","policyId":""}' +TEST_CLIENT_NETWORK_INFO_PROVIDER=http +TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/network-info"}' +TEST_CLIENT_REWARDS_PROVIDER=http +TEST_CLIENT_REWARDS_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/rewards"}' +TEST_CLIENT_TX_SUBMIT_PROVIDER=http +TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/tx-submit"}' +TEST_CLIENT_UTXO_PROVIDER=http +TEST_CLIENT_UTXO_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/utxo"}' +TEST_CLIENT_STAKE_POOL_PROVIDER=http +TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/stake-pool"}' ``` diff --git a/packages/e2e/src/environment.ts b/packages/e2e/src/environment.ts index f8772c50dd8..701f586ce30 100644 --- a/packages/e2e/src/environment.ts +++ b/packages/e2e/src/environment.ts @@ -79,33 +79,33 @@ const providerParams = makeValidator((value) => { const validators = { ADDRESS_DISCOVERY: str({ default: 'HDSequentialDiscovery' }), ARRIVAL_PHASE_DURATION_IN_SECS: num(), - ASSET_PROVIDER: str(), - ASSET_PROVIDER_PARAMS: providerParams(), - CHAIN_HISTORY_PROVIDER: str(), - CHAIN_HISTORY_PROVIDER_PARAMS: providerParams(), DB_SYNC_CONNECTION_STRING: str({ default: undefined }), - HANDLE_PROVIDER: str(), - HANDLE_PROVIDER_PARAMS: providerParams(), KEY_MANAGEMENT_PARAMS: keyManagementParams(), KEY_MANAGEMENT_PROVIDER: str(), LOGGER_MIN_SEVERITY: str({ default: 'info' }), - NETWORK_INFO_PROVIDER: str(), - NETWORK_INFO_PROVIDER_PARAMS: providerParams(), NETWORK_SPEED: str({ choices: ['fast', 'slow'], default: 'fast' }), OGMIOS_URL: str(), - REWARDS_PROVIDER: str(), - REWARDS_PROVIDER_PARAMS: providerParams(), STAKE_POOL_CONNECTION_STRING: str(), - STAKE_POOL_PROVIDER: str(), - STAKE_POOL_PROVIDER_PARAMS: providerParams(), STAKE_POOL_TEST_CONNECTION_STRING: str(), START_LOCAL_HTTP_SERVER: bool(), + TEST_CLIENT_ASSET_PROVIDER: str(), + TEST_CLIENT_ASSET_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_CHAIN_HISTORY_PROVIDER: str(), + TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_HANDLE_PROVIDER: str(), + TEST_CLIENT_HANDLE_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_NETWORK_INFO_PROVIDER: str(), + TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_REWARDS_PROVIDER: str(), + TEST_CLIENT_REWARDS_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_STAKE_POOL_PROVIDER: str(), + TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_TX_SUBMIT_PROVIDER: str(), + TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS: providerParams(), + TEST_CLIENT_UTXO_PROVIDER: str(), + TEST_CLIENT_UTXO_PROVIDER_PARAMS: providerParams(), TRANSACTIONS_NUMBER: num(), TX_SUBMIT_HTTP_URL: str(), - TX_SUBMIT_PROVIDER: str(), - TX_SUBMIT_PROVIDER_PARAMS: providerParams(), - UTXO_PROVIDER: str(), - UTXO_PROVIDER_PARAMS: providerParams(), VIRTUAL_USERS_COUNT: num(), VIRTUAL_USERS_GENERATE_DURATION: num(), WALLET_SYNC_TIMEOUT_IN_MS: num({ default: undefined }), @@ -141,25 +141,25 @@ export const getEnv = ( /** Collection of all the configuration variables required by `getWallet` */ export const walletVariables = [ - 'ASSET_PROVIDER', - 'ASSET_PROVIDER_PARAMS', - 'CHAIN_HISTORY_PROVIDER', - 'CHAIN_HISTORY_PROVIDER_PARAMS', - 'HANDLE_PROVIDER', - 'HANDLE_PROVIDER_PARAMS', + 'TEST_CLIENT_ASSET_PROVIDER', + 'TEST_CLIENT_ASSET_PROVIDER_PARAMS', + 'TEST_CLIENT_CHAIN_HISTORY_PROVIDER', + 'TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS', + 'TEST_CLIENT_HANDLE_PROVIDER', + 'TEST_CLIENT_HANDLE_PROVIDER_PARAMS', 'KEY_MANAGEMENT_PARAMS', 'KEY_MANAGEMENT_PROVIDER', 'LOGGER_MIN_SEVERITY', - 'NETWORK_INFO_PROVIDER', - 'NETWORK_INFO_PROVIDER_PARAMS', - 'REWARDS_PROVIDER', - 'REWARDS_PROVIDER_PARAMS', - 'STAKE_POOL_PROVIDER', - 'STAKE_POOL_PROVIDER_PARAMS', - 'TX_SUBMIT_PROVIDER', - 'TX_SUBMIT_PROVIDER_PARAMS', - 'UTXO_PROVIDER', - 'UTXO_PROVIDER_PARAMS', + 'TEST_CLIENT_NETWORK_INFO_PROVIDER', + 'TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS', + 'TEST_CLIENT_REWARDS_PROVIDER', + 'TEST_CLIENT_REWARDS_PROVIDER_PARAMS', + 'TEST_CLIENT_STAKE_POOL_PROVIDER', + 'TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS', + 'TEST_CLIENT_TX_SUBMIT_PROVIDER', + 'TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS', + 'TEST_CLIENT_UTXO_PROVIDER', + 'TEST_CLIENT_UTXO_PROVIDER_PARAMS', 'WS_PROVIDER_URL', 'ADDRESS_DISCOVERY', 'NETWORK_SPEED' diff --git a/packages/e2e/src/factories.ts b/packages/e2e/src/factories.ts index 122f8807f99..70097a5d7de 100644 --- a/packages/e2e/src/factories.ts +++ b/packages/e2e/src/factories.ts @@ -351,37 +351,53 @@ export const getWallet = async (props: GetWalletProps) => { env.ADDRESS_DISCOVERY, { chainHistoryProvider: await chainHistoryProviderFactory.create( - env.CHAIN_HISTORY_PROVIDER, - env.CHAIN_HISTORY_PROVIDER_PARAMS, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS, logger ) }, logger ), - assetProvider: await assetProviderFactory.create(env.ASSET_PROVIDER, env.ASSET_PROVIDER_PARAMS, logger), + assetProvider: await assetProviderFactory.create( + env.TEST_CLIENT_ASSET_PROVIDER, + env.TEST_CLIENT_ASSET_PROVIDER_PARAMS, + logger + ), chainHistoryProvider: await chainHistoryProviderFactory.create( - env.CHAIN_HISTORY_PROVIDER, - env.CHAIN_HISTORY_PROVIDER_PARAMS, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS, + logger + ), + handleProvider: await handleProviderFactory.create( + env.TEST_CLIENT_HANDLE_PROVIDER, + env.TEST_CLIENT_HANDLE_PROVIDER_PARAMS, logger ), - handleProvider: await handleProviderFactory.create(env.HANDLE_PROVIDER, env.HANDLE_PROVIDER_PARAMS, logger), networkInfoProvider: await networkInfoProviderFactory.create( - env.NETWORK_INFO_PROVIDER, - env.NETWORK_INFO_PROVIDER_PARAMS, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, + logger + ), + rewardsProvider: await rewardsProviderFactory.create( + env.TEST_CLIENT_REWARDS_PROVIDER, + env.TEST_CLIENT_REWARDS_PROVIDER_PARAMS, logger ), - rewardsProvider: await rewardsProviderFactory.create(env.REWARDS_PROVIDER, env.REWARDS_PROVIDER_PARAMS, logger), stakePoolProvider: await stakePoolProviderFactory.create( - env.STAKE_POOL_PROVIDER, - env.STAKE_POOL_PROVIDER_PARAMS, + env.TEST_CLIENT_STAKE_POOL_PROVIDER, + env.TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS, logger ), txSubmitProvider: await txSubmitProviderFactory.create( - env.TX_SUBMIT_PROVIDER, - env.TX_SUBMIT_PROVIDER_PARAMS, + env.TEST_CLIENT_TX_SUBMIT_PROVIDER, + env.TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS, logger ), - utxoProvider: await utxoProviderFactory.create(env.UTXO_PROVIDER, env.UTXO_PROVIDER_PARAMS, logger) + utxoProvider: await utxoProviderFactory.create( + env.TEST_CLIENT_UTXO_PROVIDER, + env.TEST_CLIENT_UTXO_PROVIDER_PARAMS, + logger + ) }; const envKeyParams = customKeyParams ? customKeyParams : env.KEY_MANAGEMENT_PARAMS; const keyManagementParams = { ...envKeyParams, ...(idx === undefined ? {} : { accountIndex: idx }) }; @@ -430,30 +446,46 @@ export const getWallet = async (props: GetWalletProps) => { export const getSharedWallet = async (props: GetSharedWalletProps) => { const { env, logger, name, polling, stores, paymentScript, stakingScript, witnesser } = props; const providers = { - assetProvider: await assetProviderFactory.create(env.ASSET_PROVIDER, env.ASSET_PROVIDER_PARAMS, logger), + assetProvider: await assetProviderFactory.create( + env.TEST_CLIENT_ASSET_PROVIDER, + env.TEST_CLIENT_ASSET_PROVIDER_PARAMS, + logger + ), chainHistoryProvider: await chainHistoryProviderFactory.create( - env.CHAIN_HISTORY_PROVIDER, - env.CHAIN_HISTORY_PROVIDER_PARAMS, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS, + logger + ), + handleProvider: await handleProviderFactory.create( + env.TEST_CLIENT_HANDLE_PROVIDER, + env.TEST_CLIENT_HANDLE_PROVIDER_PARAMS, logger ), - handleProvider: await handleProviderFactory.create(env.HANDLE_PROVIDER, env.HANDLE_PROVIDER_PARAMS, logger), networkInfoProvider: await networkInfoProviderFactory.create( - env.NETWORK_INFO_PROVIDER, - env.NETWORK_INFO_PROVIDER_PARAMS, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, + logger + ), + rewardsProvider: await rewardsProviderFactory.create( + env.TEST_CLIENT_REWARDS_PROVIDER, + env.TEST_CLIENT_REWARDS_PROVIDER_PARAMS, logger ), - rewardsProvider: await rewardsProviderFactory.create(env.REWARDS_PROVIDER, env.REWARDS_PROVIDER_PARAMS, logger), stakePoolProvider: await stakePoolProviderFactory.create( - env.STAKE_POOL_PROVIDER, - env.STAKE_POOL_PROVIDER_PARAMS, + env.TEST_CLIENT_STAKE_POOL_PROVIDER, + env.TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS, logger ), txSubmitProvider: await txSubmitProviderFactory.create( - env.TX_SUBMIT_PROVIDER, - env.TX_SUBMIT_PROVIDER_PARAMS, + env.TEST_CLIENT_TX_SUBMIT_PROVIDER, + env.TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS, logger ), - utxoProvider: await utxoProviderFactory.create(env.UTXO_PROVIDER, env.UTXO_PROVIDER_PARAMS, logger) + utxoProvider: await utxoProviderFactory.create( + env.TEST_CLIENT_UTXO_PROVIDER, + env.TEST_CLIENT_UTXO_PROVIDER_PARAMS, + logger + ) }; const wallet = createSharedWallet( { name, polling }, diff --git a/packages/e2e/src/scripts/generate-dotenv.sh b/packages/e2e/src/scripts/generate-dotenv.sh index 0c6a1248647..9f6b6b8e6f5 100755 --- a/packages/e2e/src/scripts/generate-dotenv.sh +++ b/packages/e2e/src/scripts/generate-dotenv.sh @@ -15,20 +15,20 @@ LOGGER_MIN_SEVERITY=info KEY_MANAGEMENT_PROVIDER=inMemory # Providers setup - required by getWallet -ASSET_PROVIDER=http -ASSET_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' -HANDLE_PROVIDER=http -HANDLE_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4011/\"}' -NETWORK_INFO_PROVIDER=http -NETWORK_INFO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' -REWARDS_PROVIDER=http -REWARDS_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' -TX_SUBMIT_PROVIDER=http -TX_SUBMIT_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' -UTXO_PROVIDER=http -UTXO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' -STAKE_POOL_PROVIDER=http -STAKE_POOL_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_ASSET_PROVIDER=http +TEST_CLIENT_ASSET_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_HANDLE_PROVIDER=http +TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4011/\"}' +TEST_CLIENT_NETWORK_INFO_PROVIDER=http +TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_REWARDS_PROVIDER=http +TEST_CLIENT_REWARDS_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_TX_SUBMIT_PROVIDER=http +TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_UTXO_PROVIDER=http +TEST_CLIENT_UTXO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TEST_CLIENT_STAKE_POOL_PROVIDER=http +TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' " # Write the environment file content to the specified file diff --git a/packages/e2e/src/util/util.ts b/packages/e2e/src/util/util.ts index c5bfee720b8..28f20774fa8 100644 --- a/packages/e2e/src/util/util.ts +++ b/packages/e2e/src/util/util.ts @@ -171,8 +171,8 @@ export const waitForEpoch = (wallet: Pick, wa export const runningAgainstLocalNetwork = async () => { const networkInfoProvider = await networkInfoProviderFactory.create( - env.NETWORK_INFO_PROVIDER, - env.NETWORK_INFO_PROVIDER_PARAMS, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, logger ); const { epochLength, slotLength } = await networkInfoProvider.genesisParameters(); diff --git a/packages/e2e/test/load-test-custom/wallet-init/wallet-init.test.ts b/packages/e2e/test/load-test-custom/wallet-init/wallet-init.test.ts index 759e75c9101..f24c5541d1c 100644 --- a/packages/e2e/test/load-test-custom/wallet-init/wallet-init.test.ts +++ b/packages/e2e/test/load-test-custom/wallet-init/wallet-init.test.ts @@ -45,25 +45,41 @@ const measurementUtil = new MeasurementUtil(); // Utility methods to help setup the test. They could be part of another file const getProviders = async () => ({ - assetProvider: await assetProviderFactory.create(env.ASSET_PROVIDER, env.ASSET_PROVIDER_PARAMS, logger), + assetProvider: await assetProviderFactory.create( + env.TEST_CLIENT_ASSET_PROVIDER, + env.TEST_CLIENT_ASSET_PROVIDER_PARAMS, + logger + ), chainHistoryProvider: await chainHistoryProviderFactory.create( - env.CHAIN_HISTORY_PROVIDER, - env.CHAIN_HISTORY_PROVIDER_PARAMS, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER, + env.TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS, logger ), networkInfoProvider: await networkInfoProviderFactory.create( - env.NETWORK_INFO_PROVIDER, - env.NETWORK_INFO_PROVIDER_PARAMS, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, + logger + ), + rewardsProvider: await rewardsProviderFactory.create( + env.TEST_CLIENT_REWARDS_PROVIDER, + env.TEST_CLIENT_REWARDS_PROVIDER_PARAMS, logger ), - rewardsProvider: await rewardsProviderFactory.create(env.REWARDS_PROVIDER, env.REWARDS_PROVIDER_PARAMS, logger), stakePoolProvider: await stakePoolProviderFactory.create( - env.STAKE_POOL_PROVIDER, - env.STAKE_POOL_PROVIDER_PARAMS, + env.TEST_CLIENT_STAKE_POOL_PROVIDER, + env.TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS, logger ), - txSubmitProvider: await txSubmitProviderFactory.create(env.TX_SUBMIT_PROVIDER, env.TX_SUBMIT_PROVIDER_PARAMS, logger), - utxoProvider: await utxoProviderFactory.create(env.UTXO_PROVIDER, env.UTXO_PROVIDER_PARAMS, logger) + txSubmitProvider: await txSubmitProviderFactory.create( + env.TEST_CLIENT_TX_SUBMIT_PROVIDER, + env.TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS, + logger + ), + utxoProvider: await utxoProviderFactory.create( + env.TEST_CLIENT_UTXO_PROVIDER, + env.TEST_CLIENT_UTXO_PROVIDER_PARAMS, + logger + ) }); const getKeyAgent = async (accountIndex: number) => { diff --git a/packages/e2e/test/ogmios/ogmios-interactions.test.ts b/packages/e2e/test/ogmios/ogmios-interactions.test.ts index f1950a0af20..b1d82a114ff 100644 --- a/packages/e2e/test/ogmios/ogmios-interactions.test.ts +++ b/packages/e2e/test/ogmios/ogmios-interactions.test.ts @@ -167,17 +167,19 @@ describe('interactions with ogmios server', () => { }); it('connection close is correctly handled', async () => { - const providerEnv = getEnv(['NETWORK_INFO_PROVIDER', 'NETWORK_INFO_PROVIDER_PARAMS'], { + const providerEnv = getEnv(['TEST_CLIENT_NETWORK_INFO_PROVIDER', 'TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS'], { override: { - NETWORK_INFO_PROVIDER_PARAMS: JSON.stringify({ baseUrl: `http://localhost:${httpPort}/network-info` }) + TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS: JSON.stringify({ + baseUrl: `http://localhost:${httpPort}/network-info` + }) } }); // This performs an health check behind the scenes, so this is enough // to establish and use the WebSocket connection to the ogmios server const networkInfoProvider = await networkInfoProviderFactory.create( - providerEnv.NETWORK_INFO_PROVIDER, - providerEnv.NETWORK_INFO_PROVIDER_PARAMS, + providerEnv.TEST_CLIENT_NETWORK_INFO_PROVIDER, + providerEnv.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, logger ); diff --git a/packages/e2e/test/providers/HandleProvider.test.ts b/packages/e2e/test/providers/HandleProvider.test.ts index 1d1a0306d9d..4161db59c2d 100644 --- a/packages/e2e/test/providers/HandleProvider.test.ts +++ b/packages/e2e/test/providers/HandleProvider.test.ts @@ -13,7 +13,7 @@ describe('HandleProvider', () => { const policyId = fs.readFileSync(policyPath, 'utf8').toString().trim(); const handleName = 'hellohandle'; // handle minted in mint-handles.sh const handleName2 = 'testhandle'; - const config = { baseUrl: env.HANDLE_PROVIDER_PARAMS.baseUrl, logger }; + const config = { baseUrl: env.TEST_CLIENT_HANDLE_PROVIDER_PARAMS.baseUrl, logger }; const handleProvider = handleHttpProvider(config); const handle = await handleProvider.resolveHandles({ handles: [handleName, handleName2] }); expect(handle.length).toEqual(2); @@ -24,14 +24,14 @@ describe('HandleProvider', () => { }); it('resolves non existent handle with null', async () => { - const config = { baseUrl: env.HANDLE_PROVIDER_PARAMS.baseUrl, logger }; + const config = { baseUrl: env.TEST_CLIENT_HANDLE_PROVIDER_PARAMS.baseUrl, logger }; const handleProvider = handleHttpProvider(config); const handle = await handleProvider.resolveHandles({ handles: ['nonexistent'] }); expect(handle).toEqual([null]); }); it('allows request an empty list of handles', async () => { - const config = { baseUrl: env.HANDLE_PROVIDER_PARAMS.baseUrl, logger }; + const config = { baseUrl: env.TEST_CLIENT_HANDLE_PROVIDER_PARAMS.baseUrl, logger }; const handleProvider = handleHttpProvider(config); const handle = await handleProvider.resolveHandles({ handles: [] }); expect(handle.length).toEqual(0); diff --git a/packages/e2e/test/wallet_epoch_0/PersonalWallet/plutusTest.test.ts b/packages/e2e/test/wallet_epoch_0/PersonalWallet/plutusTest.test.ts index b7872d2542b..12093b1505d 100644 --- a/packages/e2e/test/wallet_epoch_0/PersonalWallet/plutusTest.test.ts +++ b/packages/e2e/test/wallet_epoch_0/PersonalWallet/plutusTest.test.ts @@ -193,7 +193,11 @@ describe.skip('PersonalWallet/plutus', () => { it('can spend balance from a plutus script', async () => { wallet = (await getWallet({ env, logger, name: 'Spending Wallet', polling: { interval: 50 } })).wallet; // UTXO provider can be use to fetch the UTXO set from the script address. - const utxoProvider = await utxoProviderFactory.create(env.UTXO_PROVIDER, env.UTXO_PROVIDER_PARAMS, logger); + const utxoProvider = await utxoProviderFactory.create( + env.TEST_CLIENT_UTXO_PROVIDER, + env.TEST_CLIENT_UTXO_PROVIDER_PARAMS, + logger + ); // Plutus script that always returns true. const alwaysSucceedsScript: Cardano.PlutusScript = { @@ -267,7 +271,11 @@ describe.skip('PersonalWallet/plutus', () => { it('can spend balance from a plutus script using a reference script', async () => { wallet = (await getWallet({ env, logger, name: 'Spending Wallet', polling: { interval: 50 } })).wallet; // UTXO provider can be use to fetch the UTXO set from the script address. - const utxoProvider = await utxoProviderFactory.create(env.UTXO_PROVIDER, env.UTXO_PROVIDER_PARAMS, logger); + const utxoProvider = await utxoProviderFactory.create( + env.TEST_CLIENT_UTXO_PROVIDER, + env.TEST_CLIENT_UTXO_PROVIDER_PARAMS, + logger + ); const midnightClaimScript: Cardano.PlutusScript = { __type: Cardano.ScriptType.Plutus, diff --git a/packages/e2e/test/web-extension/extension/background/services.ts b/packages/e2e/test/web-extension/extension/background/services.ts index 7dc3baf5f3f..687fdf1c6fa 100644 --- a/packages/e2e/test/web-extension/extension/background/services.ts +++ b/packages/e2e/test/web-extension/extension/background/services.ts @@ -16,8 +16,8 @@ const priceService: BackgroundServices = { clearAllowList: authenticator.clear.bind(authenticator), getPoolIds: async (count: number): Promise => { const stakePoolProvider = await stakePoolProviderFactory.create( - env.STAKE_POOL_PROVIDER, - env.STAKE_POOL_PROVIDER_PARAMS, + env.TEST_CLIENT_STAKE_POOL_PROVIDER, + env.TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS, logger ); diff --git a/packages/e2e/test/web-extension/extension/background/supplyDistributionTracker.ts b/packages/e2e/test/web-extension/extension/background/supplyDistributionTracker.ts index 252a996e16e..9eec298982b 100644 --- a/packages/e2e/test/web-extension/extension/background/supplyDistributionTracker.ts +++ b/packages/e2e/test/web-extension/extension/background/supplyDistributionTracker.ts @@ -12,8 +12,8 @@ export const supplyDistributionTrackerReady = (async () => { logger, networkInfoProvider: await networkInfoProviderFactory.create( - env.NETWORK_INFO_PROVIDER, - env.NETWORK_INFO_PROVIDER_PARAMS, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER, + env.TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS, logger ), stores: storage.createPouchDbSupplyDistributionStores(walletName, { logger })