Skip to content

Commit

Permalink
Fix for breaking gateway changes & e2e tests:
Browse files Browse the repository at this point in the history
- fix for the footer links check e2e
- cypress spec pattern update
- updated rpc in chain config to ankr
- updated the binance name in selector modal for fixing spec
- added ids to select element in spec
- fix for opening network switcher modal , wallet connect modal
  • Loading branch information
sk-enya committed Sep 27, 2023
1 parent 247c6ee commit c171c98
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
6 changes: 1 addition & 5 deletions packages/boba/gateway/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export default defineConfig({
},
baseUrl: 'http://localhost:3000',
supportFile: 'cypress/support/e2e.ts',
specPattern: [
'cypress/e2e/**/page.spec.cy.ts',
'cypress/e2e/**/bridge.spec.cy.ts',
'cypress/e2e/**/history.spec.cy.ts',
],
specPattern: ['cypress/e2e/**/*.spec.cy.ts'],
},
env: {
target_hash: process.env.CYPRESS_TEST_HASH,
Expand Down
8 changes: 2 additions & 6 deletions packages/boba/gateway/cypress/e2e/pages/base/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ export default class Page extends Base {
'https://docs.boba.network/faq',
'/devtools',
'/bobascope',
'https://etherscan.io/',
'https://bobascan.com/',
'https://boba.network',
'https://boba.network/terms-of-use/',
])
Expand All @@ -171,8 +169,6 @@ export default class Page extends Base {
'FAQs',
'Dev Tools',
'Bobascope',
'Blockexplorer',
'Boba Blockexplorer',
'Boba Network Website',
'Terms of Use',
])
Expand All @@ -194,7 +190,7 @@ export default class Page extends Base {

cy.get(
`button[label="Connect to the ${networkAbbreviation} ${
isTestnet ? 'Testnet' : 'Mainnet'
isTestnet ? 'Testnet' : ''
} network"]`,
{ timeout: 90000 }
)
Expand All @@ -204,7 +200,7 @@ export default class Page extends Base {

switchThroughMainnetNetworks() {
// switch to BNB
this.header.switchNetwork('Binance')
this.header.switchNetwork('BNB')
this.handleNetworkSwitchModals('BNB', false)
this.allowNetworkSwitch()
this.checkNetworkSwitchSuccessful('BNB')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const PlaceholderConnect = ({
const location = useLocation()
const dispatch = useDispatch<any>()

const handdleConnect = () => {
const handleConnect = () => {
dispatch(layer === LAYER.L2 ? setConnectBOBA(true) : setConnect(true))
}

Expand All @@ -54,7 +54,7 @@ export const PlaceholderConnect = ({
{!accountEnabled && (
<>
<DefaultLabel />
<Button small label="Connect Wallet" onClick={handdleConnect} />
<Button small label="Connect Wallet" onClick={handleConnect} />
</>
)}
</PlaceholderContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SocialLinks = (props: Props) => {
<DisclaimerText>©2023 Enya Labs</DisclaimerText>
<DisclaimerText>v{WALLET_VERSION}</DisclaimerText>
</DisclaimerContainer>
<StyledSocialLinks>
<StyledSocialLinks id="socialLinks">
<SocialLinkItem
href="https://docs.boba.network"
target="_blank"
Expand Down
12 changes: 10 additions & 2 deletions packages/boba/gateway/src/hooks/useWalletConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const useWalletConnect = () => {
dispatch(openModal('noMetaMaskModal'))
return false
} else if (initialized === 'wrongnetwork') {
dispatch(openModal('wrongNetworkModal'))
return false
} else if (initialized === false) {
dispatch(setEnableAccount(false))
Expand Down Expand Up @@ -148,10 +149,17 @@ export const useWalletConnect = () => {
}, [connectBOBARequest, doConnectToLayer])

useEffect(() => {
if (connectRequest && !networkService.walletService.provider) {
const connectToNetwork = async () => {
if (await networkService.walletService.connectWallet('metamask')) {
triggerInit()
} else {
dispatch(setConnect(false))
}
}
if (connectRequest) {
// bypass walletSelectorModal
if (DISABLE_WALLETCONNECT) {
triggerInit()
connectToNetwork()
} else {
dispatch(openModal('walletSelectorModal'))
}
Expand Down
1 change: 1 addition & 0 deletions packages/boba/gateway/src/hooks/useWalletSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const useWalletSwitch = () => {
dispatch(setActiveNetwork())
dispatch(setBaseState(false))
dispatch(setEnableAccount(false))
dispatch(openModal('switchNetworkModal'))
}
}
}, [activeNetwork, activeNetworkType, network, networkType, dispatch])
Expand Down
2 changes: 1 addition & 1 deletion packages/boba/gateway/src/util/chainConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const BobaChains = {
},
},
5: {
url: 'https://goerli.gateway.tenderly.co',
url: 'https://rpc.ankr.com/eth_goerli', //'https://goerli.gateway.tenderly.co',
testnet: true,
name: 'Goerli Testnet',
teleportationAddress: '0x84b22166366a6f7E0cD0c3ce9998f2913Bf17A13',
Expand Down
3 changes: 2 additions & 1 deletion packages/boba/gateway/src/util/network/config/ethereum.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export const ethereumConfig = {
chainId: 5,
chainIdHex: '0x5',
rpcUrl: [
`https://goerli.gateway.tenderly.co`,
`https://rpc.ankr.com/eth_goerli`,
`https://ethereum-goerli.publicnode.com`,
`https://goerli.gateway.tenderly.co`,
],
transaction: `https://goerli.etherscan.io/tx/`,
blockExplorerUrl: `https://goerli.etherscan.io/`,
Expand Down
4 changes: 2 additions & 2 deletions packages/boba/gateway/src/util/network/network.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const NetworkList: { Mainnet: INetwork[]; Testnet: INetwork[] } = {
label: 'BNB <> Boba',
key: 'bnb',
name: {
l1: 'Binance Smart Chain',
l1: 'BNB Smart Chain',
l2: 'Boba BNB',
},
chainId: { [Layer.L1]: '56', [Layer.L2]: '56288' },
Expand Down Expand Up @@ -175,7 +175,7 @@ export const NetworkList: { Mainnet: INetwork[]; Testnet: INetwork[] } = {
label: 'BNB (Testnet) <> Boba',
key: 'bnb',
name: {
l1: 'BNB Testnet',
l1: 'BNB Smart Chain Testnet',
l2: 'Boba BNB Testnet',
},
chainId: { [Layer.L1]: '97', [Layer.L2]: '9728' },
Expand Down

0 comments on commit c171c98

Please sign in to comment.