-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into jongsun/perf/trace/241009-account-watcher
- Loading branch information
Showing
68 changed files
with
930 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,59 @@ | ||
import { CHAIN_IDS } from './network'; | ||
|
||
export enum EtherDenomination { | ||
ETH = 'ETH', | ||
GWEI = 'GWEI', | ||
WEI = 'WEI', | ||
} | ||
|
||
const BSC_DEFAULT_BLOCK_EXPLORER_URL = 'https://bscscan.com/'; | ||
const BSC_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'BscScan'; | ||
const MAINNET_DEFAULT_BLOCK_EXPLORER_URL = 'https://etherscan.io/'; | ||
const MAINNET_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'Etherscan'; | ||
const GOERLI_DEFAULT_BLOCK_EXPLORER_URL = 'https://goerli.etherscan.io/'; | ||
const GOERLI_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'Goerli Etherscan'; | ||
const POLYGON_DEFAULT_BLOCK_EXPLORER_URL = 'https://polygonscan.com/'; | ||
const POLYGON_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'PolygonScan'; | ||
const AVALANCHE_DEFAULT_BLOCK_EXPLORER_URL = 'https://snowtrace.io/'; | ||
const AVALANCHE_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'Snowtrace'; | ||
const OPTIMISM_DEFAULT_BLOCK_EXPLORER_URL = 'https://optimistic.etherscan.io/'; | ||
const OPTIMISM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'Optimism Explorer'; | ||
const ARBITRUM_DEFAULT_BLOCK_EXPLORER_URL = 'https://arbiscan.io/'; | ||
const ARBITRUM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'ArbiScan'; | ||
const ZKSYNC_DEFAULT_BLOCK_EXPLORER_URL = 'https://explorer.zksync.io/'; | ||
const ZKSYNC_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'Zksync Explorer'; | ||
const LINEA_DEFAULT_BLOCK_EXPLORER_URL = 'https://lineascan.build/'; | ||
const LINEA_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'LineaScan'; | ||
const BASE_DEFAULT_BLOCK_EXPLORER_URL = 'https://basescan.org/'; | ||
const BASE_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'BaseScan'; | ||
|
||
type BlockExplorerUrlMap = { | ||
[key: string]: string; | ||
}; | ||
|
||
export const CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP: BlockExplorerUrlMap = { | ||
[CHAIN_IDS.BSC]: BSC_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.MAINNET]: MAINNET_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.POLYGON]: POLYGON_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.GOERLI]: GOERLI_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.AVALANCHE]: AVALANCHE_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.OPTIMISM]: OPTIMISM_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.ARBITRUM]: ARBITRUM_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.LINEA_MAINNET]: LINEA_DEFAULT_BLOCK_EXPLORER_URL, | ||
[CHAIN_IDS.BASE]: BASE_DEFAULT_BLOCK_EXPLORER_URL, | ||
} as const; | ||
|
||
export const CHAINID_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL_MAP: BlockExplorerUrlMap = | ||
{ | ||
[CHAIN_IDS.BSC]: BSC_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.MAINNET]: MAINNET_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.POLYGON]: POLYGON_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.GOERLI]: GOERLI_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.AVALANCHE]: AVALANCHE_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.OPTIMISM]: OPTIMISM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.ARBITRUM]: ARBITRUM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.LINEA_MAINNET]: LINEA_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
[CHAIN_IDS.BASE]: BASE_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Driver } from '../../../webdriver/driver'; | ||
|
||
class EditNetworkModal { | ||
private driver: Driver; | ||
|
||
private readonly editModalNetworkNameInput = | ||
'[data-testid="network-form-network-name"]'; | ||
|
||
private readonly editModalRpcDropDownButton = | ||
'[data-testid="test-add-rpc-drop-down"]'; | ||
|
||
private readonly editModalSaveButton = { | ||
text: 'Save', | ||
tag: 'button', | ||
}; | ||
|
||
constructor(driver: Driver) { | ||
this.driver = driver; | ||
} | ||
|
||
async check_pageIsLoaded(): Promise<void> { | ||
try { | ||
await this.driver.waitForMultipleSelectors([ | ||
this.editModalNetworkNameInput, | ||
this.editModalRpcDropDownButton, | ||
this.editModalSaveButton, | ||
]); | ||
} catch (e) { | ||
console.log( | ||
'Timeout while waiting for select network dialog to be loaded', | ||
e, | ||
); | ||
throw e; | ||
} | ||
console.log('Edit network dialog is loaded'); | ||
} | ||
|
||
/** | ||
* Selects an RPC from the dropdown in the edit network modal. | ||
* | ||
* @param rpcName - The name of the RPC to select. | ||
*/ | ||
async selectRPCInEditNetworkModal(rpcName: string): Promise<void> { | ||
console.log(`Select RPC ${rpcName} in edit network modal`); | ||
await this.driver.clickElement(this.editModalRpcDropDownButton); | ||
await this.driver.clickElement({ | ||
text: rpcName, | ||
tag: 'button', | ||
}); | ||
await this.driver.clickElementAndWaitToDisappear(this.editModalSaveButton); | ||
} | ||
} | ||
|
||
export default EditNetworkModal; |
Oops, something went wrong.