Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into cf-deploy-safe
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/new-safe/create/steps/ReviewStep/index.tsx
#	src/features/counterfactual/hooks/useDeployGasLimit.ts
#	src/features/counterfactual/utils.ts
  • Loading branch information
usame-algan committed Feb 8, 2024
2 parents 13e8065 + 8737cb8 commit e9663e8
Show file tree
Hide file tree
Showing 25 changed files with 248 additions and 123 deletions.
11 changes: 11 additions & 0 deletions cypress/e2e/pages/assets.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const hiddenTokenSaveBtn = 'span[data-track="assets: Save hide dialog"]'
const hiddenTokenCancelBtn = 'span[data-track="assets: Cancel hide dialog"]'
const hiddenTokenDeselectAllBtn = 'span[data-track="assets: Deselect all hide dialog"]'
const hiddenTokenIcon = 'svg[data-testid="VisibilityOffOutlinedIcon"]'
const currencySelector = '[data-testid="currency-selector"]'
const currencyItem = '[data-testid="currency-item"]'

const hideTokenDefaultString = 'Hide tokens'
const assetNameSortBtnStr = 'Asset'
Expand Down Expand Up @@ -91,6 +93,15 @@ export const currentcyGnosisFormat = '< 0.00001 GNO'
export const currencyOx = /^0x$/
export const currentcyOxFormat = '1.003 ZRX'

function clickOnCurrencySelector() {
cy.get(currencySelector).click()
}

export function changeCurrency(currency) {
clickOnCurrencySelector()
cy.get(currencyItem).contains(currency).click()
}

export function clickOnSendBtn(index) {
cy.get('button')
.contains(sendBtnStr)
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/pages/navigation.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const sentinelStart = 'div[data-testid="sentinelStart"]'
const disconnectBtnStr = 'Disconnect'
const notConnectedStatus = 'Connect'

export function verifyTxBtnStatus(status) {
cy.get(newTxBtn).should(status)
}
export function clickOnSideNavigation(option) {
cy.get(option).should('exist').click()
}
Expand Down
41 changes: 24 additions & 17 deletions cypress/e2e/pages/sidebar.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const sideBarListItem = '[data-testid="sidebar-list-item"]'
const sideBarListItemWhatsNew = '[data-testid="list-item-whats-new"]'
const sideBarListItemNeedHelp = '[data-testid="list-item-need-help"]'
const sideSafeListItem = '[data-testid="safe-list-item"]'
const sidebarSafeHeader = '[data-testid="sidebar-safe-header"]'
const sidebarSafeHeader = '[data-testid="safe-header-info"]'
const sidebarSafeContainer = '[data-testid="sidebar-safe-container"]'
const safeItemOptionsBtn = '[data-testid="safe-options-btn"]'
const safeItemOptionsRenameBtn = '[data-testid="rename-btn"]'
Expand All @@ -26,6 +26,8 @@ const cancelBtn = '[data-testid="cancel-btn"]'
const deleteBtn = '[data-testid="delete-btn"]'
const readOnlyVisibility = '[data-testid="read-only-visibility"]'
const currencySection = '[data-testid="currency-section"]'
const missingSignatureInfo = '[data-testid="missing-signature-info"]'
const queuedTxInfo = '[data-testid="queued-tx-info"]'

export const addedSafesGnosis = ['0x17b3...98C8', '0x11A6...F1BB', '0xB8d7...642A']
export const addedSafesSepolia = ['0x6d0b...6dC1', '0x5912...fFdb', '0x0637...708e', '0xD157...DE9a']
Expand Down Expand Up @@ -120,27 +122,26 @@ export function verifySafesByNetwork(netwrok, safes) {
})
}

function getSafeItemByName(name) {
return cy.get(sidebarSafeContainer).find(sideSafeListItem).contains(name).parents('li')
}

export function verifySafeReadOnlyState(safe) {
cy.get(sidebarSafeContainer).within(() => {
cy.get(sideSafeListItem)
.contains(safe)
.parents('li')
.within(() => {
cy.get(readOnlyVisibility).should('exist')
})
})
getSafeItemByName(safe).find(readOnlyVisibility).should('exist')
}

export function verifyMissingSignature(safe) {
getSafeItemByName(safe).find(missingSignatureInfo).should('exist')
}

export function verifyQueuedTx(safe) {
return getSafeItemByName(safe).find(queuedTxInfo).should('exist')
}

function clickOnSafeItemOptionsBtn(name) {
cy.get(sidebarSafeContainer).within(() => {
cy.get(sideSafeListItem)
.contains(name)
.parents('li')
.within(() => {
cy.get(safeItemOptionsBtn).click()
})
})
getSafeItemByName(name).find(safeItemOptionsBtn).click()
}

export function renameSafeItem(oldName, newName) {
clickOnSafeItemOptionsBtn(oldName)
clickOnRenameBtn()
Expand Down Expand Up @@ -188,3 +189,9 @@ export function clickOnSaveBtn() {
function verifyModalRemoved() {
main.verifyElementsCount(modal.modalTitle, 0)
}

export function checkCurrencyInHeader(currency) {
cy.get(sidebarSafeHeader).within(() => {
cy.get(currencySection).contains(currency)
})
}
21 changes: 19 additions & 2 deletions cypress/e2e/regression/sidebar_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as sideBar from '../pages/sidebar.pages'
import * as ls from '../../support/localstorage_data.js'
import * as assets from '../pages/assets.pages.js'

const newSafeName = 'Added safe 3'
const oldSafeName = 'Added safe 2'
const oldSafeName = 'Added safe 900'
const staticSafe100 = 'Added safe 100'
const staticSafe200 = 'Added safe 200'

describe('Sidebar added sidebar tests', () => {
beforeEach(() => {
cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_13)
cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_13)
cy.wait(2000)
cy.clearLocalStorage()
main.acceptCookies()
Expand Down Expand Up @@ -45,4 +47,19 @@ describe('Sidebar added sidebar tests', () => {
sideBar.openSidebar()
sideBar.verifySafeReadOnlyState(staticSafe100)
})

it('Verify Fiat currency changes when edited in the assets tab', () => {
assets.changeCurrency(constants.currencies.cad)
sideBar.checkCurrencyInHeader(constants.currencies.cad)
})

it('Verify "wallet" tag counter if the safe has tx ready for execution', () => {
sideBar.openSidebar()
sideBar.verifyMissingSignature(staticSafe200)
})

it('Verify "Wallet" tag counter only shows for owners', () => {
sideBar.openSidebar()
sideBar.verifyQueuedTx(staticSafe200)
})
})
29 changes: 29 additions & 0 deletions cypress/e2e/regression/sidebar_nonowner.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as constants from '../../support/constants.js'
import * as main from '../pages/main.page.js'
import * as sideBar from '../pages/sidebar.pages.js'
import * as navigation from '../pages/navigation.page.js'
import * as ls from '../../support/localstorage_data.js'

const addedOwner = 'Added owner'
const addedNonowner = 'Added non-owner'

describe('Sidebar non-owner tests', () => {
beforeEach(() => {
cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_17_SIDEBAR_NONOWNER)
cy.wait(2000)
cy.clearLocalStorage()
main.acceptCookies()
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set3)
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes)
})

it('Verify New Transaction button enabled for users with Spending limits allowed', () => {
navigation.verifyTxBtnStatus(constants.enabledStates.enabled)
})

it('Verify tag counting queue tx show for owners and non-owners', () => {
sideBar.openSidebar()
sideBar.verifyQueuedTx(addedOwner).contains(2)
sideBar.verifyQueuedTx(addedNonowner).contains(2)
})
})
6 changes: 6 additions & 0 deletions cypress/support/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const SEPOLIA_TEST_SAFE_14 = 'sep:0xC23e061252BFc7967203D054136d8fA7c7df2
// SAFE 15 is a safe with native tokens but the automation user is not its owner
export const SEPOLIA_TEST_SAFE_15_TOKEN = 'sep:0xfC0A7ac73Fde7547ac0792Cca1D8A50CE0AFC4Df'
export const SEPOLIA_TEST_SAFE_16_CREATE_TX = 'sep:0xc2F3645bfd395516d1a18CA6ad9298299d328C01'
export const SEPOLIA_TEST_SAFE_17_SIDEBAR_NONOWNER = 'sep:0x10B45a24640E2170B6AA63ea3A289D723a0C9cba'
export const SEPOLIA_CONTRACT_SHORT = '0x11AB...34aF'
export const SEPOLIA_RECIPIENT_ADDR_SHORT = '0x4DD4...7bde'
export const GNO_TEST_SAFE = 'gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A'
Expand Down Expand Up @@ -134,6 +135,11 @@ export const tokenAbbreviation = {
link: 'LINK',
}

export const currencies = {
cad: 'CAD',
aud: 'AUD',
}

export const appNames = {
walletConnect: 'walletconnect',
customContract: 'compose custom contract',
Expand Down
49 changes: 48 additions & 1 deletion cypress/support/localstorage_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,14 @@ export const addressBookData = {
addedSafes: {
100: {
'0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8': 'Added safe 1',
'0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB': 'Added safe 2',
'0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB': 'Added safe 900',
'0xB8d760a90a5ed54D3c2b3EFC231277e99188642A': 'Added safe 100',
},
11155111: {
'0x0A0EEb6fBCc7c82259E548Fc4617175A357b3e71': 'Added safe 200',
'0xF21445699e91aC6F2EeeAF1a19510AC4197e59aB': 'Added owner',
'0x9E6DAfe829431e1892EcF8461FDAd02665170c31': 'Added non-owner',
},
},
}

Expand Down Expand Up @@ -507,6 +512,22 @@ export const addedSafes = {
threshold: 1,
ethBalance: '0',
},
'0x0A0EEb6fBCc7c82259E548Fc4617175A357b3e71': {
owners: [
{
value: '0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8',
name: null,
logoUri: null,
},
{
value: '0xC16Db0251654C0a72E91B190d81eAD367d2C6fED',
name: null,
logoUri: null,
},
],
threshold: 2,
ethBalance: '0',
},
},
100: {
'0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8': {
Expand All @@ -526,6 +547,32 @@ export const addedSafes = {
},
},
},
set3: {
11155111: {
'0xF21445699e91aC6F2EeeAF1a19510AC4197e59aB': {
owners: [
{
value: '0xC16Db0251654C0a72E91B190d81eAD367d2C6fED',
name: null,
logoUri: null,
},
],
threshold: 2,
ethBalance: '0',
},
'0x9E6DAfe829431e1892EcF8461FDAd02665170c31': {
owners: [
{
value: '0x96D4c6fFC338912322813a77655fCC926b9A5aC5',
name: null,
logoUri: null,
},
],
threshold: 2,
ethBalance: '0',
},
},
},
}

export const pinnedApps = {
Expand Down
8 changes: 4 additions & 4 deletions docs/release-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ After the PR is tested and approved by QA, it's merged into the `main` branch. `

Schematically:
```
<feature branches> –> dev -> release/X.Y.Z -> main
<feature branches> –> dev -> release -> main
```

We prepare at least one release every sprint. Sprints are two weeks long.

### Preparing a release branch
* Create a code-freeze branch named `release/X.Y.Z`
* Create a code-freeze branch named `release`
* If it's a regular release, this branch is typically based off of `dev`
* For hot fixes, it would be `main` + cherry-picked commits
* Bump the version in the `package.json`
* Bump the version in the `package.json` as a separate commit with the commit message equal to the exact version
* Create a PR with the list of changes

> 💡 To generate a quick changelog:
Expand All @@ -42,7 +42,7 @@ git reset --hard origin/main
```
* Pull from the release branch:
```
git pull origin release/3.15.0
git pull origin release
```
* Push:
```
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "safe-wallet-web",
"homepage": "https://github.com/safe-global/safe-wallet-web",
"license": "GPL-3.0",
"version": "1.28.0",
"version": "1.29.0",
"type": "module",
"scripts": {
"dev": "next dev",
Expand All @@ -27,7 +27,8 @@
"cypress:run": "cypress run",
"cypress:ci": "yarn cypress:run --config baseUrl=http://localhost:8080 --spec cypress/e2e/smoke/*.cy.js",
"serve": "npx -y serve out -p ${REVERSE_PROXY_UI_PORT:=8080}",
"static-serve": "yarn build && yarn serve"
"static-serve": "yarn build && yarn serve",
"update-wc": "yarn add @walletconnect/web3wallet@latest @walletconnect/utils@latest @walletconnect/types@latest"
},
"engines": {
"node": ">=16"
Expand All @@ -54,16 +55,16 @@
"@safe-global/safe-apps-sdk": "^9.0.0-next.1",
"@safe-global/safe-core-sdk": "^3.3.5",
"@safe-global/safe-core-sdk-utils": "^1.7.4",
"@safe-global/safe-ethers-lib": "^1.9.4",
"@safe-global/safe-deployments": "1.32.0",
"@safe-global/safe-ethers-lib": "^1.9.4",
"@safe-global/safe-gateway-typescript-sdk": "^3.14.0",
"@safe-global/safe-modules-deployments": "^1.2.0",
"@sentry/react": "^7.91.0",
"@spindl-xyz/attribution-lite": "^1.4.0",
"@tkey-mpc/common-types": "^8.2.2",
"@truffle/hdwallet-provider": "^2.1.4",
"@walletconnect/utils": "^2.11.0",
"@walletconnect/web3wallet": "^1.10.0",
"@walletconnect/utils": "^2.11.1",
"@walletconnect/web3wallet": "^1.10.1",
"@web3-onboard/coinbase": "^2.2.6",
"@web3-onboard/core": "^2.21.2",
"@web3-onboard/injected-wallets": "^2.10.7",
Expand Down Expand Up @@ -118,7 +119,7 @@
"@types/react-gtm-module": "^2.0.1",
"@types/semver": "^7.3.10",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@walletconnect/types": "^2.11.0",
"@walletconnect/types": "^2.11.1",
"cross-env": "^7.0.3",
"cypress": "^12.15.0",
"cypress-file-upload": "^5.0.8",
Expand Down
3 changes: 2 additions & 1 deletion src/components/balances/CurrencySelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const CurrencySelect = (): ReactElement => {
<InputLabel id="currency-label">Currency</InputLabel>

<Select
data-testid="currency-selector"
labelId="currency-label"
id="currency"
value={currency.toUpperCase()}
Expand All @@ -43,7 +44,7 @@ const CurrencySelect = (): ReactElement => {
onClose={() => handleTrack('Close')}
>
{fiatCurrencies.map((item) => (
<MenuItem key={item} value={item} sx={{ overflow: 'hidden' }}>
<MenuItem data-testid="currency-item" key={item} value={item} sx={{ overflow: 'hidden' }}>
{item.toUpperCase()}
</MenuItem>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/AddressInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const AddressInput = ({
className={inputCss.input}
autoComplete="off"
autoFocus={props.focused}
label={<>{error?.message || props.label}</>}
label={<>{error?.message || props.label || `Recipient address${isDomainLookupEnabled ? ' or ENS' : ''}`}</>}
error={!!error}
fullWidth
spellCheck={false}
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/AddCustomAppModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type CustomAppFormData = {
safeApp: SafeAppData
}

const HELP_LINK = 'https://docs.safe.global/safe-core-aa-sdk/safe-apps/get-started'
const HELP_LINK = 'https://docs.safe.global/apps-sdk-overview'
const APP_ALREADY_IN_THE_LIST_ERROR = 'This Safe App is already in the list'
const MANIFEST_ERROR = "The app doesn't support Safe App functionality"
const INVALID_URL_ERROR = 'The url is invalid'
Expand Down
Loading

0 comments on commit e9663e8

Please sign in to comment.