Skip to content

Commit

Permalink
Remove AMM Devnet network (#342)
Browse files Browse the repository at this point in the history
* Remove AMM from the network choices

* Remove obsolete code

* Fix cypress tests

---------

Co-authored-by: thibautbremand <thibaut.bremand@gmail.com>
  • Loading branch information
FlorianBouron and ThibautBremand authored Dec 20, 2023
1 parent 5c0fd8e commit 688376b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 53 deletions.
19 changes: 0 additions & 19 deletions packages/constants/src/network/network.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ export enum XRPLNetwork {
MAINNET = 'Mainnet',
TESTNET = 'Testnet',
DEVNET = 'Devnet',
AMM_DEVNET = 'AMM-Devnet',
CUSTOM = 'Custom'
}

export const Networks = {
[Chain.XRPL]: [
XRPLNetwork.MAINNET,
XRPLNetwork.TESTNET,
XRPLNetwork.DEVNET,
XRPLNetwork.AMM_DEVNET
]
};

export const MAINNET_CLIO_NODES = ['wss://s1.ripple.com', 'wss://s2.ripple.com'];
export const MAINNET_NODES = ['wss://xrplcluster.com', ...MAINNET_CLIO_NODES];
export const TESTNET_NODES = ['wss://s.altnet.rippletest.net:51233', 'wss://testnet.xrpl-labs.com'];
export const DEVNET_NODES = ['wss://s.devnet.rippletest.net:51233'];
export const AMM_DEVNET_NODES = ['wss://amm.devnet.rippletest.net:51233'];

export type Network = XRPLNetwork;

Expand All @@ -39,7 +28,6 @@ interface NetworkConfigXRPL {
[XRPLNetwork.MAINNET]: NetworkNode;
[XRPLNetwork.TESTNET]: NetworkNode;
[XRPLNetwork.DEVNET]: NetworkNode;
[XRPLNetwork.AMM_DEVNET]: NetworkNode;
[XRPLNetwork.CUSTOM]: NetworkNode;
}

Expand Down Expand Up @@ -71,13 +59,6 @@ export const NETWORK: ChainConfig = {
nodes: DEVNET_NODES,
description: 'A preview of upcoming features, where unstable changes are tested out.'
},
[XRPLNetwork.AMM_DEVNET]: {
chain: Chain.XRPL,
name: XRPLNetwork.AMM_DEVNET,
server: AMM_DEVNET_NODES[0],
nodes: AMM_DEVNET_NODES,
description: 'XLS-30d Automated Market Makers preview network.'
},
[XRPLNetwork.CUSTOM]: {
chain: Chain.XRPL,
name: XRPLNetwork.CUSTOM,
Expand Down
41 changes: 7 additions & 34 deletions packages/extension/cypress/e2e/networks.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,6 @@ describe('Switch networks', () => {
});
});

it('Switch from Devnet (localStorage) to AMMDevnet', () => {
// Devnet should be the network from localStorage
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.DEVNET, {
timeout: 1500
});

// Open the change network window
cy.get('div[data-testid="network-indicator"]').click();
cy.get('div[data-testid="network-indicator-dialog"]', { timeout: 1500 })
.find('header')
.should('have.text', 'Change Network');

// Select the AMMDevnet network
cy.contains('button', XRPLNetwork.AMM_DEVNET).click();

// Make sure that the network is switched to AMMDevnet
cy.get('div[data-testid="loading"]').should('be.visible');
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.AMM_DEVNET, {
timeout: 1500
});

// Save the current state of the localStorage
cy.window().then((win) => {
networkLocalStorage = win.localStorage.getItem('network');
});
});

it('Add a custom network', () => {
// Open the change network window
cy.get('div[data-testid="network-indicator"]').click();
Expand Down Expand Up @@ -195,12 +168,12 @@ describe('Switch networks', () => {
// Expect an error dialog when trying to delete the network we are currently connected to
cy.contains('button', 'OK', { timeout: 3000 }).should('be.visible').click();

// Connect back to the AMMDevnet network
cy.contains('button', XRPLNetwork.AMM_DEVNET).click();
// Connect back to the Devnet network
cy.contains('button', XRPLNetwork.DEVNET).click();

// Make sure that the network is switched to AMMDevnet
// Make sure that the network is switched to Devnet network
cy.get('div[data-testid="loading"]').should('be.visible');
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.AMM_DEVNET, {
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.DEVNET, {
timeout: 1500
});

Expand All @@ -223,9 +196,9 @@ describe('Switch networks', () => {
});
});

it('Switch from AMMDevnet (localStorage) to Mainnet', () => {
// AMMDevnet should be the network from localStorage
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.AMM_DEVNET, {
it('Switch from Devnet (localStorage) to Mainnet', () => {
// Custom network should be the network from localStorage
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.DEVNET, {
timeout: 1500
});

Expand Down

0 comments on commit 688376b

Please sign in to comment.