Skip to content

Commit

Permalink
Merge pull request #182 from isreallee82/feat/arbitrum_refactor
Browse files Browse the repository at this point in the history
Refactor arbitrum_one to arbitrum
  • Loading branch information
nikspz authored Aug 7, 2023
2 parents b89018d + 47b7990 commit 6adbffa
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/connectors/openocean/openocean.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export namespace OpenoceanConfig {
chainType: 'EVM',
availableNetworks: [
{ chain: 'avalanche', networks: ['avalanche'] },
{ chain: 'ethereum', networks: ['mainnet', 'arbitrum_one', 'optimism'] },
{ chain: 'ethereum', networks: ['mainnet', 'arbitrum', 'optimism'] },
{ chain: 'polygon', networks: ['mainnet'] },
{ chain: 'harmony', networks: ['mainnet'] },
{ chain: 'binance-smart-chain', networks: ['mainnet'] },
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/openocean/openocean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class Openocean implements Uniswapish {
public get chainName(): string {
if (this._chain === 'ethereum' && this._network === 'mainnet') {
return 'eth';
} else if (this._chain === 'ethereum' && this._network === 'arbitrum_one') {
} else if (this._chain === 'ethereum' && this._network === 'arbitrum') {
return 'arbitrum';
} else if (this._chain === 'ethereum' && this._network === 'optimism') {
return 'optimism';
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/sushiswap/sushiswap.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export namespace SushiswapConfig {
availableNetworks: [
{
chain: 'ethereum',
networks: ['mainnet', 'goerli', 'arbitrum_one'],
networks: ['mainnet', 'goerli', 'arbitrum'],
},
{ chain: 'avalanche', networks: ['avalanche', 'fuji'] },
{ chain: 'binance-smart-chain', networks: ['mainnet', 'testnet'] },
Expand Down
4 changes: 2 additions & 2 deletions src/templates/ethereum.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
networks:
arbitrum_one:
arbitrum:
chainID: 42161
nodeURL: https://rpc.ankr.com/arbitrum
tokenListType: FILE
tokenListSource: /home/gateway/conf/lists/arbitrum_one_coingecko_20230610.json
tokenListSource: /home/gateway/conf/lists/arbitrum_coingecko_20230610.json
nativeCurrencySymbol: ETH
gasPriceRefreshInterval: 60
arbitrum_rinkeby:
Expand Down
2 changes: 1 addition & 1 deletion src/templates/sushiswap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contractAddresses:
sushiswapRouterAddress: '0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F'
goerli:
sushiswapRouterAddress: '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506'
arbitrum_one:
arbitrum:
sushiswapRouterAddress: '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506'
avalanche:
avalanche:
Expand Down
2 changes: 1 addition & 1 deletion src/templates/uniswap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contractAddresses:
uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'
uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88'
uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e'
arbitrum_one:
arbitrum:
uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'
uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88'
uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e'
Expand Down
50 changes: 25 additions & 25 deletions test/connectors/openocean/arbitrum.openocean.routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ beforeAll(async () => {
app = express();
app.use(express.json());

ethereum = Ethereum.getInstance('arbitrum_one');
ethereum = Ethereum.getInstance('arbitrum');
patchEVMNonceManager(ethereum.nonceManager);
await ethereum.init();

openocean = Openocean.getInstance('ethereum', 'arbitrum_one');
openocean = Openocean.getInstance('ethereum', 'arbitrum');
await openocean.init();

app.use('/amm', AmmRoutes.router);
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand Down Expand Up @@ -234,7 +234,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand All @@ -288,7 +288,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand All @@ -310,7 +310,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand All @@ -335,7 +335,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand All @@ -360,7 +360,7 @@ describe('POST /amm/price', () => {
.post(`/amm/price`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'bDAI',
Expand Down Expand Up @@ -389,7 +389,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand All @@ -411,7 +411,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand All @@ -429,7 +429,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand Down Expand Up @@ -460,7 +460,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand All @@ -482,7 +482,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand All @@ -502,7 +502,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand Down Expand Up @@ -534,7 +534,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BITCOIN',
Expand Down Expand Up @@ -569,7 +569,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BITCOIN',
base: 'USDC',
Expand All @@ -590,7 +590,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand All @@ -610,7 +610,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand All @@ -630,7 +630,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'USDC',
base: 'BUSD',
Expand All @@ -650,7 +650,7 @@ describe('POST /amm/trade', () => {
.post(`/amm/trade`)
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
quote: 'BUSD',
base: 'USDC',
Expand All @@ -674,13 +674,13 @@ describe('POST /amm/estimateGas', () => {
.post('/amm/estimateGas')
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'openocean',
})
.set('Accept', 'application/json')
.expect(200)
.then((res: any) => {
expect(res.body.network).toEqual('arbitrum_one');
expect(res.body.network).toEqual('arbitrum');
expect(res.body.gasPrice).toEqual(100);
expect(res.body.gasCost).toEqual(
gasCostInEthString(100, openocean.gasLimitEstimate)
Expand All @@ -696,7 +696,7 @@ describe('POST /amm/estimateGas', () => {
.post('/amm/estimateGas')
.send({
chain: 'ethereum',
network: 'arbitrum_one',
network: 'arbitrum',
connector: 'pangolin',
})
.set('Accept', 'application/json')
Expand Down

0 comments on commit 6adbffa

Please sign in to comment.