diff --git a/docs/swagger/definitions.yml b/docs/swagger/definitions.yml index 410cb794f9..dba6ab339f 100644 --- a/docs/swagger/definitions.yml +++ b/docs/swagger/definitions.yml @@ -35,7 +35,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' NonceResponse: type: 'object' @@ -70,7 +70,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' AllowancesResponse: type: 'object' @@ -122,7 +122,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' BalancesResponse: type: 'object' @@ -185,7 +185,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' ApproveResponse: type: 'object' @@ -239,7 +239,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' PollResponse: type: 'object' @@ -324,7 +324,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' PriceResponse: type: 'object' @@ -414,7 +414,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswap' @@ -492,7 +492,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' CancelResponse: type: 'object' @@ -687,7 +687,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswap' @@ -763,7 +763,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswapLP' @@ -783,7 +783,7 @@ definitions: properties: network: type: 'string' - example: 'kovan' + example: 'goerli' timestamp: type: 'integer' example: 1636368085740 @@ -829,7 +829,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswapLP' @@ -848,7 +848,7 @@ definitions: properties: network: type: 'string' - example: 'kovan' + example: 'goerli' timestamp: type: 'integer' example: 1636368085740 @@ -891,7 +891,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswapLP' @@ -910,7 +910,7 @@ definitions: properties: network: type: 'string' - example: 'kovan' + example: 'goerli' timestamp: type: 'integer' example: 1636368085740 @@ -945,7 +945,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswapLP' @@ -968,7 +968,7 @@ definitions: properties: network: type: 'string' - example: 'kovan' + example: 'goerli' timestamp: type: 'integer' example: 1636368085740 @@ -1032,7 +1032,7 @@ definitions: example: 'ethereum' network: type: 'string' - example: 'kovan' + example: 'goerli' connector: type: 'string' example: 'uniswapLP' @@ -1050,7 +1050,7 @@ definitions: properties: network: type: 'string' - example: 'kovan' + example: 'goerli' timestamp: type: 'integer' example: 1636368085740 diff --git a/docs/swagger/network-routes.yml b/docs/swagger/network-routes.yml index 71196c060e..28db40e918 100644 --- a/docs/swagger/network-routes.yml +++ b/docs/swagger/network-routes.yml @@ -72,7 +72,7 @@ paths: name: 'network' required: true type: 'string' - example: 'kovan' + example: 'goerli' - in: 'query' name: 'tokenSymbols' required: false diff --git a/manual-tests/curl.sh b/manual-tests/curl.sh index d1a0fe6ac0..d054764b6c 100644 --- a/manual-tests/curl.sh +++ b/manual-tests/curl.sh @@ -21,7 +21,7 @@ curl -s -X POST -k --key $GATEWAY_KEY --cert $GATEWAY_CERT -H "Content-Type: app curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT https://localhost:15888/network/status | jq -curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/status?chain=ethereum&network=kovan" | jq +curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/status?chain=ethereum&network=goerli" | jq curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/status?chain=avalanche&network=avalanche" | jq @@ -33,7 +33,7 @@ curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT https://localhost:1588 curl -s -X POST -k --key $GATEWAY_KEY --cert $GATEWAY_CERT -H "Content-Type: application/json" -d "$(envsubst < ./requests/network_poll.json)" https://localhost:15888/network/poll | jq -curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/tokens?chain=ethereum&network=kovan" | jq +curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/tokens?chain=ethereum&network=goerli" | jq curl -s -X GET -k --key $GATEWAY_KEY --cert $GATEWAY_CERT "https://localhost:15888/network/tokens?chain=polygon&network=mumbai" | jq diff --git a/manual-tests/requests/add_ethereum_key.json b/manual-tests/requests/add_ethereum_key.json index fbc671b410..e855127759 100644 --- a/manual-tests/requests/add_ethereum_key.json +++ b/manual-tests/requests/add_ethereum_key.json @@ -1,5 +1,5 @@ { "privateKey": "$ETH_PRIVATE_KEY", "chain": "ethereum", - "network": "kovan" + "network": "goerli" } diff --git a/manual-tests/requests/eth_allowances.json b/manual-tests/requests/eth_allowances.json index 24c6414eda..e6a2118c53 100644 --- a/manual-tests/requests/eth_allowances.json +++ b/manual-tests/requests/eth_allowances.json @@ -1,6 +1,6 @@ { "chain": "ethereum", - "network": "kovan", + "network": "goerli", "address": "$ETH_ADDRESS", "spender": "uniswap", "tokenSymbols": ["DAI", "WETH"] diff --git a/manual-tests/requests/eth_approve.json b/manual-tests/requests/eth_approve.json index f1a207d903..674ede6811 100644 --- a/manual-tests/requests/eth_approve.json +++ b/manual-tests/requests/eth_approve.json @@ -1,6 +1,6 @@ { "chain": "ethereum", - "network": "kovan", + "network": "goerli", "address": "$ETH_ADDRESS", "spender": "uniswap", "token": "DAI" diff --git a/manual-tests/requests/eth_nonce.json b/manual-tests/requests/eth_nonce.json index 4aa1f71ee1..a50dd6c245 100644 --- a/manual-tests/requests/eth_nonce.json +++ b/manual-tests/requests/eth_nonce.json @@ -1,5 +1,5 @@ { "chain": "ethereum", - "network": "kovan", + "network": "goerli", "address": "$ETH_ADDRESS" } diff --git a/manual-tests/requests/eth_uniswap_add_liquidity.json b/manual-tests/requests/eth_uniswap_add_liquidity.json index 7f4f2ee5d9..5030092176 100644 --- a/manual-tests/requests/eth_uniswap_add_liquidity.json +++ b/manual-tests/requests/eth_uniswap_add_liquidity.json @@ -8,6 +8,6 @@ "lowerPrice": "1", "upperPrice": "5", "chain": "ethereum", - "network": "kovan", + "network": "goerli", "connector": "uniswapLP" } diff --git a/manual-tests/requests/eth_uniswap_pool_price.json b/manual-tests/requests/eth_uniswap_pool_price.json index d9e48164bf..4f47587962 100644 --- a/manual-tests/requests/eth_uniswap_pool_price.json +++ b/manual-tests/requests/eth_uniswap_pool_price.json @@ -5,6 +5,6 @@ "period": 120, "interval": 60, "chain": "ethereum", - "network": "kovan", + "network": "goerli", "connector": "uniswapLP" } diff --git a/manual-tests/requests/eth_uniswap_position.json b/manual-tests/requests/eth_uniswap_position.json index 6b901df2b4..8bbb431d47 100644 --- a/manual-tests/requests/eth_uniswap_position.json +++ b/manual-tests/requests/eth_uniswap_position.json @@ -2,6 +2,6 @@ "address": "$ETH_ADDRESS", "tokenId": 2732, "chain": "ethereum", - "network": "kovan", + "network": "goerli", "connector": "uniswapLP" } diff --git a/manual-tests/requests/eth_uniswap_trade.json b/manual-tests/requests/eth_uniswap_trade.json index 64d4f2c71a..1ca18c8f21 100644 --- a/manual-tests/requests/eth_uniswap_trade.json +++ b/manual-tests/requests/eth_uniswap_trade.json @@ -5,6 +5,6 @@ "amount": "1", "side": "BUY", "chain": "ethereum", - "network": "kovan", + "network": "goerli", "connector": "uniswap" } diff --git a/manual-tests/requests/network_poll.json b/manual-tests/requests/network_poll.json index 60c375d7f8..8980b1f0a3 100644 --- a/manual-tests/requests/network_poll.json +++ b/manual-tests/requests/network_poll.json @@ -1,5 +1,5 @@ { "chain": "ethereum", - "network": "kovan", + "network": "goerli", "txHash": "0xadaef9c4540192e45c991ffe6f12cc86be9c07b80b43487e5778d95c964405c7" } diff --git a/manual-tests/requests/price_uniswap.json b/manual-tests/requests/price_uniswap.json index 483167a37a..3d0b5ebb4e 100644 --- a/manual-tests/requests/price_uniswap.json +++ b/manual-tests/requests/price_uniswap.json @@ -1,7 +1,7 @@ { "connector": "uniswap", "chain": "ethereum", - "network": "kovan", + "network": "goerli", "quote": "WETH", "base": "DAI", "amount": "1", diff --git a/manual-tests/requests/status_request.json b/manual-tests/requests/status_request.json index f423e35f90..ce9418ef63 100644 --- a/manual-tests/requests/status_request.json +++ b/manual-tests/requests/status_request.json @@ -1,4 +1,4 @@ { "chain": "ethereum", - "network": "kovan" + "network": "goerli" } diff --git a/src/connectors/uniswap/uniswap.lp.helper.ts b/src/connectors/uniswap/uniswap.lp.helper.ts index 6167e72467..a5728384a4 100644 --- a/src/connectors/uniswap/uniswap.lp.helper.ts +++ b/src/connectors/uniswap/uniswap.lp.helper.ts @@ -435,7 +435,9 @@ export class UniswapLPHelper { const token1 = this.getTokenByAddress(positionData.token1); const fee = positionData.fee; if (!token0 || !token1) { - throw new Error(`One of the tokens in this position isn't recognized.`); + throw new Error( + `One of the tokens in this position isn't recognized. $token0: ${token0}, $token1: ${token1}` + ); } const poolAddress = uniV3.Pool.getAddress(token0, token1, fee); const poolData = await this.getPoolState(poolAddress, fee); diff --git a/src/services/config-manager-v2.ts b/src/services/config-manager-v2.ts index 7b6a012fe2..106b66b27d 100644 --- a/src/services/config-manager-v2.ts +++ b/src/services/config-manager-v2.ts @@ -90,8 +90,8 @@ export class ConfigurationNamespace { * * Note that configuration paths may have multiple levels. What it implies * is those configurations are stored in nested dictionaries - aka. a tree. - * e.g. if the config path is "ethereum.networks.kovan.networkID", then, - * what it means you're accessing ["networks"]["kovan"]["networkID"] under + * e.g. if the config path is "ethereum.networks.goerli.networkID", then, + * what it means you're accessing ["networks"]["goerli"]["networkID"] under * the "ethereum" namespace. */ readonly #namespaceId: string; @@ -243,10 +243,10 @@ export class ConfigManagerV2 { * initiation, the get() and set() functions will map configuration keys and * values to the appropriate namespaces. * - * e.g. get('ethereum.networks.kovan.networkID') will be mapped to - * ethereumNamespace.get('networks.kovan.networkID') - * e.g. set('ethereum.networks.kovan.networkID', 42) will be mapped to - * ethereumNamespace.set('networks.kovan.networkID', 42) + * e.g. get('ethereum.networks.goerli.networkID') will be mapped to + * ethereumNamespace.get('networks.goerli.networkID') + * e.g. set('ethereum.networks.goerli.networkID', 42) will be mapped to + * ethereumNamespace.set('networks.goerli.networkID', 42) * * File paths in the root configuration file may be defined as absolute paths * or relative paths. Any relative paths would be rebased to the root diff --git a/test/chains/ethereum/ethereum.controllers.test.ts b/test/chains/ethereum/ethereum.controllers.test.ts index 1d61cbe445..f5980b0d59 100644 --- a/test/chains/ethereum/ethereum.controllers.test.ts +++ b/test/chains/ethereum/ethereum.controllers.test.ts @@ -23,7 +23,7 @@ import { patchEVMNonceManager } from '../../evm.nonce.mock'; let eth: Ethereum; beforeAll(async () => { - eth = Ethereum.getInstance('kovan'); + eth = Ethereum.getInstance('goerli'); patchEVMNonceManager(eth.nonceManager); @@ -55,7 +55,7 @@ describe('nonce', () => { patch(eth.nonceManager, 'getNonce', () => 2); const n = await nonce(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, }); expect(n).toEqual({ nonce: 2 }); @@ -70,7 +70,7 @@ describe('nonce', () => { patch(eth.nonceManager, 'getNextNonce', () => 3); const n = await nextNonce(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, }); expect(n).toEqual({ nonce: 3 }); @@ -120,7 +120,7 @@ describe('allowances', () => { const result = await allowances(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, spender: uniswap, tokenSymbols: ['WETH'], @@ -161,7 +161,7 @@ describe('approve', () => { const result = await approve(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, spender: uniswap, token: 'WETH', @@ -182,7 +182,7 @@ describe('approve', () => { await expect( approve(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, spender: uniswap, token: 'WETH', @@ -214,7 +214,7 @@ describe('approve', () => { await expect( approve(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, spender: uniswap, token: 'WETH', @@ -239,7 +239,7 @@ describe('balances', () => { await expect( balances(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: zeroAddress, tokenSymbols: ['WETH', 'DAI'], }) @@ -263,7 +263,7 @@ describe('cancel', () => { await expect( cancel(eth, { chain: 'ethereum', - network: 'kovan', + network: 'goerli', nonce: 123, address: zeroAddress, }) diff --git a/test/chains/ethereum/ethereum.routes.test.ts b/test/chains/ethereum/ethereum.routes.test.ts index a30342a4df..ea83e59d07 100644 --- a/test/chains/ethereum/ethereum.routes.test.ts +++ b/test/chains/ethereum/ethereum.routes.test.ts @@ -20,7 +20,7 @@ import * as transactionOutOfGasReceipt from './fixtures/transaction-out-of-gas-r let eth: Ethereum; beforeAll(async () => { - eth = Ethereum.getInstance('kovan'); + eth = Ethereum.getInstance('goerli'); patchEVMNonceManager(eth.nonceManager); await eth.init(); }); @@ -136,7 +136,7 @@ describe('POST /evm/allowances', () => { .post(`/evm/allowances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: theSpender, tokenSymbols: ['WETH', 'DAI'], @@ -154,7 +154,7 @@ describe('POST /evm/allowances', () => { .post(`/evm/allowances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: '0xSpender', tokenSymbols: ['WETH', 'DAI'], @@ -177,7 +177,7 @@ describe('POST /network/balances', () => { .post(`/network/balances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', tokenSymbols: ['WETH', 'DAI'], }) @@ -201,7 +201,7 @@ describe('POST /network/balances', () => { .post(`/network/balances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', tokenSymbols: ['ETH'], }) @@ -225,7 +225,7 @@ describe('POST /network/balances', () => { .post(`/network/balances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', tokenSymbols: ['XXX', 'YYY'], }) @@ -239,7 +239,7 @@ describe('POST /network/balances', () => { .post(`/network/balances`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: 'da857cbda0ba96757fed842617a4', }) .expect(404); @@ -255,7 +255,7 @@ describe('POST /evm/nonce', () => { .post(`/evm/nonce`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', }) .set('Accept', 'application/json') @@ -269,7 +269,7 @@ describe('POST /evm/nonce', () => { .post(`/evm/nonce`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: 'da857cbda0ba96757fed842617a4', }) .expect(404); @@ -285,7 +285,7 @@ describe('POST /evm/nextNonce', () => { .post(`/evm/nextNonce`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', }) .set('Accept', 'application/json') @@ -299,7 +299,7 @@ describe('POST /evm/nextNonce', () => { .post(`/evm/nextNonce`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: 'da857cbda0ba96757fed842617a4', }) .expect(404); @@ -320,7 +320,7 @@ describe('POST /evm/approve', () => { .post(`/evm/approve`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: 'uniswap', token: 'WETH', @@ -340,7 +340,7 @@ describe('POST /evm/approve', () => { .post(`/evm/approve`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: 'uniswap', token: 'WETH', @@ -364,7 +364,7 @@ describe('POST /evm/approve', () => { .post(`/evm/approve`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: 'uniswap', token: 'WETH', @@ -382,7 +382,7 @@ describe('POST /evm/approve', () => { .post(`/evm/approve`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: 'uniswap', token: 123, @@ -407,7 +407,7 @@ describe('POST /evm/cancel', () => { .post(`/evm/cancel`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', nonce: 23, }) @@ -426,7 +426,7 @@ describe('POST /evm/cancel', () => { .post(`/evm/cancel`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '', nonce: '23', }) @@ -444,7 +444,7 @@ describe('POST /network/poll', () => { const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -474,7 +474,7 @@ describe('POST /network/poll', () => { patch(eth, 'getTransactionReceipt', () => transactionOutOfGasReceipt); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -490,7 +490,7 @@ describe('POST /network/poll', () => { patch(eth, 'getTransactionReceipt', () => null); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -505,7 +505,7 @@ describe('POST /network/poll', () => { patch(eth, 'getTransactionReceipt', () => null); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -520,7 +520,7 @@ describe('POST /network/poll', () => { patch(eth, 'getTransactionReceipt', () => transactionSuccesfulReceipt); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x6d068067a5e5a0f08c6395b31938893d1cdad81f54a54456221ecd8c1941294d', // noqa: mock }); @@ -545,7 +545,7 @@ describe('POST /network/poll', () => { }); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -562,7 +562,7 @@ describe('POST /network/poll', () => { }); const res = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: '0x2faeb1aa55f96c1db55f643a8cf19b0f76bf091d0b7d1b068d2e829414576362', // noqa: mock }); @@ -580,7 +580,7 @@ describe('overwrite existing transaction', () => { const requestParam = { chain: 'ethereum', - network: 'kovan', + network: 'goerli', address: '0xFaA12FD102FE8623C9299c72B03E45107F2772B5', spender: 'uniswap', token: 'WETH', @@ -612,7 +612,7 @@ describe('overwrite existing transaction', () => { patch(eth, 'getTransactionReceipt', () => null); const res_1 = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: tx_1.body.approval.hash, }); expect(res_1.statusCode).toEqual(200); @@ -624,7 +624,7 @@ describe('overwrite existing transaction', () => { patch(eth, 'getTransactionReceipt', () => transactionSuccesfulReceipt); const res_2 = await request(gatewayApp).post('/network/poll').send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', txHash: tx_2.body.approval.hash, }); expect(res_2.statusCode).toEqual(200); diff --git a/test/chains/ethereum/uniswap/uniswap.lp.routes.test.ts b/test/chains/ethereum/uniswap/uniswap.lp.routes.test.ts index 7b6d930c95..08007a48cb 100644 --- a/test/chains/ethereum/uniswap/uniswap.lp.routes.test.ts +++ b/test/chains/ethereum/uniswap/uniswap.lp.routes.test.ts @@ -14,11 +14,11 @@ let uniswap: UniswapLP; beforeAll(async () => { app = express(); app.use(express.json()); - ethereum = Ethereum.getInstance('kovan'); + ethereum = Ethereum.getInstance('goerli'); patchEVMNonceManager(ethereum.nonceManager); await ethereum.init(); - uniswap = UniswapLP.getInstance('ethereum', 'kovan'); + uniswap = UniswapLP.getInstance('ethereum', 'goerli'); await uniswap.init(); app.use('/amm/liquidity', AmmLiquidityRoutes.router); }); @@ -171,7 +171,7 @@ describe('POST /liquidity/add', () => { lowerPrice: '1', upperPrice: '5', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -196,7 +196,7 @@ describe('POST /liquidity/add', () => { lowerPrice: '1', upperPrice: '5', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -222,7 +222,7 @@ describe('POST /liquidity/add', () => { lowerPrice: '1', upperPrice: '5', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -251,7 +251,7 @@ describe('POST /liquidity/add', () => { lowerPrice: '1', upperPrice: '5', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -278,7 +278,7 @@ describe('POST /liquidity/remove', () => { address: address, tokenId: 2732, chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -298,7 +298,7 @@ describe('POST /liquidity/remove', () => { address: address, tokenId: 'Invalid', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -322,7 +322,7 @@ describe('POST /liquidity/collect_fees', () => { address: address, tokenId: 2732, chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -342,7 +342,7 @@ describe('POST /liquidity/collect_fees', () => { address: address, tokenId: 'Invalid', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -363,7 +363,7 @@ describe('POST /liquidity/position', () => { .send({ tokenId: 2732, chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -381,7 +381,7 @@ describe('POST /liquidity/position', () => { .send({ tokenId: 'Invalid', chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -410,7 +410,7 @@ describe('POST /liquidity/price', () => { period: 120, interval: 60, chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') @@ -433,7 +433,7 @@ describe('POST /liquidity/price', () => { period: 120, interval: 60, chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswapLP', }) .set('Accept', 'application/json') diff --git a/test/chains/ethereum/uniswap/uniswap.lp.test.ts b/test/chains/ethereum/uniswap/uniswap.lp.test.ts index 08448a3a6c..56f4647514 100644 --- a/test/chains/ethereum/uniswap/uniswap.lp.test.ts +++ b/test/chains/ethereum/uniswap/uniswap.lp.test.ts @@ -11,24 +11,24 @@ let uniswapLP: UniswapLP; let wallet: Wallet; const WETH = new Token( - 42, - '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + 5, + '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH' ); const DAI = new Token( - 42, - '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa', + 5, + '0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60', 18, 'DAI' ); const USDC = new Token( - 42, - '0x2F375e94FC336Cdec2Dc0cCB5277FE59CBf1cAe5', - 18, - 'DAI' + 5, + '0xD87Ba7A50B2E7E660f678A895E4B72E7CB4CCd9C', + 6, + 'USDC' ); const TX = { @@ -39,7 +39,7 @@ const TX = { maxFeePerGas: { toString: () => '106000000000' }, gasPrice: { toString: () => null }, gasLimit: { toString: () => '100000' }, - to: '0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa', + to: '0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60', value: { toString: () => '0' }, data: '0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', // noqa: mock accessList: [], @@ -68,7 +68,7 @@ const DAI_USDC_POOL = new uniV3.Pool( ); beforeAll(async () => { - ethereum = Ethereum.getInstance('kovan'); + ethereum = Ethereum.getInstance('goerli'); patchEVMNonceManager(ethereum.nonceManager); await ethereum.init(); @@ -76,7 +76,7 @@ beforeAll(async () => { '0000000000000000000000000000000000000000000000000000000000000002', // noqa: mock ethereum.provider ); - uniswapLP = UniswapLP.getInstance('ethereum', 'kovan'); + uniswapLP = UniswapLP.getInstance('ethereum', 'goerli'); await uniswapLP.init(); }); diff --git a/test/chains/ethereum/uniswap/uniswap.routes.test.ts b/test/chains/ethereum/uniswap/uniswap.routes.test.ts index e16539c040..8e4da39d0e 100644 --- a/test/chains/ethereum/uniswap/uniswap.routes.test.ts +++ b/test/chains/ethereum/uniswap/uniswap.routes.test.ts @@ -15,11 +15,11 @@ beforeAll(async () => { app = express(); app.use(express.json()); - ethereum = Ethereum.getInstance('kovan'); + ethereum = Ethereum.getInstance('goerli'); patchEVMNonceManager(ethereum.nonceManager); await ethereum.init(); - uniswap = Uniswap.getInstance('ethereum', 'kovan'); + uniswap = Uniswap.getInstance('ethereum', 'goerli'); await uniswap.init(); app.use('/amm', AmmRoutes.router); @@ -60,14 +60,14 @@ const patchStoredTokenList = () => { chainId: 42, name: 'WETH', symbol: 'WETH', - address: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + address: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', decimals: 18, }, { chainId: 42, name: 'DAI', symbol: 'DAI', - address: '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa', + address: '0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60', decimals: 18, }, ]; @@ -81,7 +81,7 @@ const patchGetTokenBySymbol = () => { chainId: 42, name: 'WETH', symbol: 'WETH', - address: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + address: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', decimals: 18, }; } else { @@ -89,7 +89,7 @@ const patchGetTokenBySymbol = () => { chainId: 42, name: 'DAI', symbol: 'DAI', - address: '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa', + address: '0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60', decimals: 18, }; } @@ -102,7 +102,7 @@ const patchGetTokenByAddress = () => { chainId: 42, name: 'WETH', symbol: 'WETH', - address: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + address: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', decimals: 18, }; }); @@ -172,7 +172,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -202,7 +202,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -227,7 +227,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DOGE', base: 'WETH', @@ -249,7 +249,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'SHIBA', @@ -271,7 +271,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'SHIBA', @@ -293,7 +293,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'SHIBA', @@ -318,7 +318,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DOGE', base: 'WETH', @@ -343,7 +343,7 @@ describe('POST /amm/price', () => { .post(`/amm/price`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DOGE', base: 'WETH', @@ -373,7 +373,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -395,7 +395,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -413,7 +413,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -445,7 +445,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -467,7 +467,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -488,7 +488,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -508,7 +508,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -528,7 +528,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -548,7 +548,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -568,7 +568,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -593,7 +593,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -622,7 +622,7 @@ describe('POST /amm/trade', () => { .post(`/amm/trade`) .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', quote: 'DAI', base: 'WETH', @@ -647,13 +647,13 @@ describe('POST /amm/estimateGas', () => { .post('/amm/estimateGas') .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'uniswap', }) .set('Accept', 'application/json') .expect(200) .then((res: any) => { - expect(res.body.network).toEqual('kovan'); + expect(res.body.network).toEqual('goerli'); expect(res.body.gasPrice).toEqual(100); expect(res.body.gasCost).toEqual( gasCostInEthString(100, uniswap.gasLimitEstimate) @@ -669,7 +669,7 @@ describe('POST /amm/estimateGas', () => { .post('/amm/estimateGas') .send({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', connector: 'pangolin', }) .set('Accept', 'application/json') diff --git a/test/chains/ethereum/uniswap/uniswap.test.ts b/test/chains/ethereum/uniswap/uniswap.test.ts index d34f3fae22..26fc85800e 100644 --- a/test/chains/ethereum/uniswap/uniswap.test.ts +++ b/test/chains/ethereum/uniswap/uniswap.test.ts @@ -27,11 +27,11 @@ const DAI = new Token( ); beforeAll(async () => { - ethereum = Ethereum.getInstance('kovan'); + ethereum = Ethereum.getInstance('goerli'); patchEVMNonceManager(ethereum.nonceManager); await ethereum.init(); - uniswap = Uniswap.getInstance('ethereum', 'kovan'); + uniswap = Uniswap.getInstance('ethereum', 'goerli'); await uniswap.init(); }); diff --git a/test/network/network.routes.test.ts b/test/network/network.routes.test.ts index c406942e8a..943fddfca2 100644 --- a/test/network/network.routes.test.ts +++ b/test/network/network.routes.test.ts @@ -15,7 +15,7 @@ let polygon: Polygon; let cronos: Cronos; beforeAll(async () => { - eth = Ethereum.getInstance('kovan'); + eth = Ethereum.getInstance('goerli'); patchEVMNonceManager(eth.nonceManager); await eth.init(); @@ -86,7 +86,7 @@ describe('GET /network/status', () => { it('should return 200 when asking for ethereum network status', async () => { patch(eth, 'chain', () => { - return 'kovan'; + return 'goerli'; }); patch(eth, 'rpcUrl', 'http://...'); patch(eth, 'chainId', 34); @@ -98,11 +98,11 @@ describe('GET /network/status', () => { .get(`/network/status`) .query({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', }) .expect('Content-Type', /json/) .expect(200) - .expect((res) => expect(res.body.chain).toBe('kovan')) + .expect((res) => expect(res.body.chain).toBe('goerli')) .expect((res) => expect(res.body.chainId).toBeDefined()) .expect((res) => expect(res.body.rpcUrl).toBeDefined()) .expect((res) => expect(res.body.currentBlockNumber).toBeDefined()); @@ -243,23 +243,23 @@ describe('GET /network/config', () => { }); describe('GET /network/tokens', () => { - it('should return 200 when retrieving ethereum-kovan tokens, tokenSymbols parameter not provided', async () => { + it('should return 200 when retrieving ethereum-goerli tokens, tokenSymbols parameter not provided', async () => { await request(gatewayApp) .get(`/network/tokens`) .query({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', }) .expect('Content-Type', /json/) .expect(200); }); - it('should return 200 when retrieving ethereum-kovan tokens, s parameter provided', async () => { + it('should return 200 when retrieving ethereum-goerli tokens, s parameter provided', async () => { await request(gatewayApp) .get(`/network/tokens`) .query({ chain: 'ethereum', - network: 'kovan', + network: 'goerli', tokenSymbols: ['COIN3', 'COIN1'], }) .expect('Content-Type', /json/) @@ -340,7 +340,7 @@ describe('GET /network/tokens', () => { .get(`/network/tokens`) .query({ chain: 'unknown', - network: 'kovan', + network: 'goerli', }) .expect(500); }); diff --git a/test/services/config-manager-v2.test.ts b/test/services/config-manager-v2.test.ts index 51d56034e2..3ccb145a88 100644 --- a/test/services/config-manager-v2.test.ts +++ b/test/services/config-manager-v2.test.ts @@ -76,9 +76,9 @@ describe('Configuration manager v2 tests', () => { it('reading from config file', (done) => { expect(configManager.get('server.certificatePath')).toEqual('gateway.crt'); - expect(configManager.get('ethereum.networks.kovan.chainID')).toEqual(42); + expect(configManager.get('ethereum.networks.goerli.chainID')).toEqual(42); expect( - configManager.get('ethereum.networks.kovan.nativeCurrencySymbol') + configManager.get('ethereum.networks.goerli.nativeCurrencySymbol') ).toEqual('ETH'); expect( configManager.get('defira.contractAddresses.testnet.initCodeHash') @@ -89,7 +89,7 @@ describe('Configuration manager v2 tests', () => { }); it('reading a non-existent config entry', (done) => { - expect(configManager.get('ethereum.kovan.chainID')).toBeUndefined(); + expect(configManager.get('ethereum.goerli.chainID')).toBeUndefined(); expect(configManager.get('server.keyPath.keyPath')).toBeUndefined(); done(); }); @@ -107,7 +107,7 @@ describe('Configuration manager v2 tests', () => { it('writing a valid configuration', (done) => { const newKeyPath: string = 'new-gateway.crt'; configManager.set('server.certificatePath', newKeyPath); - configManager.set('ethereum.networks.kovan.chainID', 970); + configManager.set('ethereum.networks.goerli.chainID', 970); configManager.set('ethereum.networks.mainnet', { chainID: 61, nodeURL: 'http://localhost:8561', @@ -124,7 +124,7 @@ describe('Configuration manager v2 tests', () => { expect(verifyConfigManager.get('server.certificatePath')).toEqual( newKeyPath ); - expect(verifyConfigManager.get('ethereum.networks.kovan.chainID')).toEqual( + expect(verifyConfigManager.get('ethereum.networks.goerli.chainID')).toEqual( 970 ); expect( @@ -217,7 +217,7 @@ describe('Configuration manager v2 tests', () => { it('Get all configuration', (done) => { const allConfigs = configManager.allConfigurations; expect(allConfigs.server.certificatePath).toEqual('gateway.crt'); - expect(allConfigs.ethereum.networks.kovan.chainID).toEqual(42); + expect(allConfigs.ethereum.networks.goerli.chainID).toEqual(42); done(); }); diff --git a/test/services/data/config-manager-v2/test1/ethereum.yml b/test/services/data/config-manager-v2/test1/ethereum.yml index 64af0deeb5..f45ebae808 100644 --- a/test/services/data/config-manager-v2/test1/ethereum.yml +++ b/test/services/data/config-manager-v2/test1/ethereum.yml @@ -5,9 +5,9 @@ networks: tokenListType: URL tokenListSource: https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokens.1inch.eth.link nativeCurrencySymbol: ETH - kovan: + goerli: chainID: 42 - nodeURL: https://kovan.infura.io/v3/ + nodeURL: https://goerli.infura.io/v3/ tokenListType: FILE tokenListSource: src/chains/ethereum/erc20_tokens_kovan.json nativeCurrencySymbol: ETH diff --git a/test/services/evm.nonce.test.ts b/test/services/evm.nonce.test.ts index b80a735712..1e293cf19e 100644 --- a/test/services/evm.nonce.test.ts +++ b/test/services/evm.nonce.test.ts @@ -107,7 +107,7 @@ describe('Test EVMNonceManager', () => { }); await evmNonceManager.init( - new providers.StaticJsonRpcProvider('https://kovan.infura.io/v3/') + new providers.StaticJsonRpcProvider('https://goerli.infura.io/v3/') ); const nonce = await evmNonceManager.getNonce(address1); diff --git a/test/services/wallet/wallet.controllers.test.ts b/test/services/wallet/wallet.controllers.test.ts index 63faf11fb4..d5f48dfcc5 100644 --- a/test/services/wallet/wallet.controllers.test.ts +++ b/test/services/wallet/wallet.controllers.test.ts @@ -34,7 +34,7 @@ beforeAll(async () => { patch(ConfigManagerCertPassphrase, 'readPassphrase', () => 'a'); avalanche = Avalanche.getInstance('fuji'); - eth = Ethereum.getInstance('kovan'); + eth = Ethereum.getInstance('goerli'); harmony = Harmony.getInstance('testnet'); bsc = BinanceSmartChain.getInstance('testnet'); cronos = Cronos.getInstance('testnet'); @@ -115,7 +115,7 @@ describe('addWallet and getWallets', () => { await addWallet({ privateKey: onePrivateKey, chain: 'ethereum', - network: 'kovan', + network: 'goerli', }); const wallets = await getWallets(); @@ -312,7 +312,7 @@ describe('addWallet and removeWallets', () => { await addWallet({ privateKey: onePrivateKey, chain: 'ethereum', - network: 'kovan', + network: 'goerli', }); await removeWallet({ chain: 'ethereum', address: oneAddress }); diff --git a/test/services/wallet/wallet.routes.test.ts b/test/services/wallet/wallet.routes.test.ts index e7256881d3..e3dd6f1baf 100644 --- a/test/services/wallet/wallet.routes.test.ts +++ b/test/services/wallet/wallet.routes.test.ts @@ -14,7 +14,7 @@ beforeAll(async () => { patch(ConfigManagerCertPassphrase, 'readPassphrase', () => 'a'); avalanche = Avalanche.getInstance('fuji'); - eth = Ethereum.getInstance('kovan'); + eth = Ethereum.getInstance('goerli'); harmony = Harmony.getInstance('testnet'); }); @@ -74,7 +74,7 @@ describe('POST /wallet/add', () => { .send({ privateKey: twoPrivateKey, chain: 'ethereum', - network: 'kovan', + network: 'goerli', }) .expect('Content-Type', /json/) .expect(200); @@ -180,7 +180,7 @@ describe('DELETE /wallet/remove', () => { .send({ privateKey: twoPrivateKey, chain: 'ethereum', - network: 'kovan', + network: 'goerli', }) .expect('Content-Type', /json/) @@ -252,7 +252,7 @@ describe('GET /wallet', () => { .send({ privateKey: twoPrivateKey, chain: 'ethereum', - network: 'kovan', + network: 'goerli', }) .expect('Content-Type', /json/) .expect(200);