From 16f54728dc76494190d642615bca53dd421a83d5 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 14:47:55 -0300 Subject: [PATCH 1/7] Test CI --- .github/workflows/release.yml | 52 ++++------------------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6831889a..b68d7ba1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Build/Release Desktop app on: push: branches: - - master + - fix/desktop-CI env: REACT_APP_BLOCKNATIVE_KEY: ${{ secrets.REACT_APP_BLOCKNATIVE_KEY }} @@ -44,48 +44,8 @@ jobs: uses: actions/setup-node@v1 with: node-version: 10.16 - - run: yarn install --network-concurrency 1 - - - name: Build/Release Desktop App - env: - # macOS notarization API key - APPLEID: ${{ secrets.APPLE_ID }} - APPLEIDPASS: ${{ secrets.APPLE_ID_PASS }} - uses: samuelmeuli/action-electron-builder@v1 - with: - #Build scipt - build_script_name: build-desktop - - # GitHub token, automatically provided to the action - # (No need to define this secret in the repo settings) - - github_token: ${{ secrets.github_token }} - - # macOS code signing certificate - mac_certs: ${{ secrets.MAC_CERTS }} - mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }} - - # If the commit is tagged with a version (e.g. "v1.0.0"), - # release the app after building - release: ${{ startsWith(github.ref, 'refs/tags/v') }} - - - name: 'Upload Artifacts OSX' - if: contains(github.ref, 'development') && startsWith(matrix.os, 'macos') - uses: actions/upload-artifact@v2 - with: - name: Desktop OSX - path: ./dist/Safe[ ]Multisig*.dmg - - - name: 'Upload Artifacts Linux' - if: contains(github.ref, 'development') && startsWith(matrix.os, 'ubuntu') - uses: actions/upload-artifact@v2 - with: - name: Desktop Linux - path: ./dist/Safe[ ]Multisig*.AppImage - - - name: 'Upload Artifacts Windows' - if: contains(github.ref, 'development') && startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v2 - with: - name: Desktop Windows - path: ./dist/Safe[ ]Multisig*.exe + - run: | + mkdir .yarncache + yarn install --frozen-lockfile --cache-folder ./.yarncache + rm -rf .yarncache + yarn cache clean From 704ea9b8d4f6ea6c7f58d5829b2fea4165349896 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 15:04:28 -0300 Subject: [PATCH 2/7] Fix windows remove command --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b68d7ba1..ff666c26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,5 +47,5 @@ jobs: - run: | mkdir .yarncache yarn install --frozen-lockfile --cache-folder ./.yarncache - rm -rf .yarncache + rm -r .yarncache yarn cache clean From c73651980cdb22d343f444129febc9debd9a2b90 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 15:17:49 -0300 Subject: [PATCH 3/7] Fix test --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff666c26..c3353a9f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,3 +49,14 @@ jobs: yarn install --frozen-lockfile --cache-folder ./.yarncache rm -r .yarncache yarn cache clean + - name: Remove and cache clean (Windows Only) + if: startsWith(matrix.os, 'windows') + shell: powershell + run: | + rm -r -Force .yarncache + yarn cache clean + - name: Remove and cache clean + if: "!startsWith(matrix.os, 'windows')" + run: | + rm -rf .yarncache + yarn cache clean From d7f412a928fbd46ad1748a07718e198170cc17b3 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 15:20:02 -0300 Subject: [PATCH 4/7] Fix --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3353a9f..4fcb0bb9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,14 +49,14 @@ jobs: yarn install --frozen-lockfile --cache-folder ./.yarncache rm -r .yarncache yarn cache clean - - name: Remove and cache clean (Windows Only) - if: startsWith(matrix.os, 'windows') - shell: powershell - run: | + - name: Remove and cache clean (Windows Only) + if: startsWith(matrix.os, 'windows') + shell: powershell + run: | rm -r -Force .yarncache yarn cache clean - - name: Remove and cache clean - if: "!startsWith(matrix.os, 'windows')" - run: | + - name: Remove and cache clean + if: "!startsWith(matrix.os, 'windows')" + run: | rm -rf .yarncache yarn cache clean From 8ba497a37574710c033d826e8e9c497392cfc421 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 15:27:19 -0300 Subject: [PATCH 5/7] Fix V2 --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fcb0bb9..46627f02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,13 +47,11 @@ jobs: - run: | mkdir .yarncache yarn install --frozen-lockfile --cache-folder ./.yarncache - rm -r .yarncache - yarn cache clean - name: Remove and cache clean (Windows Only) if: startsWith(matrix.os, 'windows') shell: powershell run: | - rm -r -Force .yarncache + rm -Recurse -Force .yarncache yarn cache clean - name: Remove and cache clean if: "!startsWith(matrix.os, 'windows')" From eda383a5ff8a8cf9ba4f1d9139d185abb5881346 Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Wed, 5 Aug 2020 15:39:34 -0300 Subject: [PATCH 6/7] Final CI updated --- .github/workflows/release.yml | 45 ++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46627f02..6a05970c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Build/Release Desktop app on: push: branches: - - fix/desktop-CI + - master env: REACT_APP_BLOCKNATIVE_KEY: ${{ secrets.REACT_APP_BLOCKNATIVE_KEY }} @@ -58,3 +58,46 @@ jobs: run: | rm -rf .yarncache yarn cache clean + - name: Build/Release Desktop App + env: + # macOS notarization API key + APPLEID: ${{ secrets.APPLE_ID }} + APPLEIDPASS: ${{ secrets.APPLE_ID_PASS }} + uses: samuelmeuli/action-electron-builder@v1 + with: + #Build scipt + build_script_name: build-desktop + + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + + github_token: ${{ secrets.github_token }} + + # macOS code signing certificate + mac_certs: ${{ secrets.MAC_CERTS }} + mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }} + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + release: ${{ startsWith(github.ref, 'refs/tags/v') }} + + - name: 'Upload Artifacts OSX' + if: contains(github.ref, 'development') && startsWith(matrix.os, 'macos') + uses: actions/upload-artifact@v2 + with: + name: Desktop OSX + path: ./dist/Safe[ ]Multisig*.dmg + + - name: 'Upload Artifacts Linux' + if: contains(github.ref, 'development') && startsWith(matrix.os, 'ubuntu') + uses: actions/upload-artifact@v2 + with: + name: Desktop Linux + path: ./dist/Safe[ ]Multisig*.AppImage + + - name: 'Upload Artifacts Windows' + if: contains(github.ref, 'development') && startsWith(matrix.os, 'windows') + uses: actions/upload-artifact@v2 + with: + name: Desktop Windows + path: ./dist/Safe[ ]Multisig*.exe From 91d3aa8592eb016458e056124d715f1b20062b7f Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Fri, 7 Aug 2020 16:49:29 +0200 Subject: [PATCH 7/7] Bug/safe crash when accessing from link (#1209) * use updateSafeAction for adding modules * Fix address parameter naming issue Add comment to ADD_SAFE_MODULE behaviour * fetchSafe batch everything to updateSafe * remove addSafeModules action Co-authored-by: Mikhail Mikheev --- .../safe/store/actions/addSafeModules.ts | 7 ------ src/routes/safe/store/actions/fetchSafe.ts | 23 ++++++------------- src/routes/safe/store/reducer/safe.ts | 5 ---- 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 src/routes/safe/store/actions/addSafeModules.ts diff --git a/src/routes/safe/store/actions/addSafeModules.ts b/src/routes/safe/store/actions/addSafeModules.ts deleted file mode 100644 index 6c36075c..00000000 --- a/src/routes/safe/store/actions/addSafeModules.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createAction } from 'redux-actions' - -export const ADD_SAFE_MODULES = 'ADD_SAFE_MODULES' - -const addSafeModules = createAction(ADD_SAFE_MODULES) - -export default addSafeModules diff --git a/src/routes/safe/store/actions/fetchSafe.ts b/src/routes/safe/store/actions/fetchSafe.ts index a41ce5bb..976528b6 100644 --- a/src/routes/safe/store/actions/fetchSafe.ts +++ b/src/routes/safe/store/actions/fetchSafe.ts @@ -15,7 +15,6 @@ import { makeOwner } from 'src/routes/safe/store/models/owner' import { checksumAddress } from 'src/utils/checksumAddress' import { ModulePair, SafeOwner } from 'src/routes/safe/store/models/safe' import { Dispatch } from 'redux' -import addSafeModules from './addSafeModules' import { SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts' const buildOwnersFrom = ( @@ -49,7 +48,7 @@ const buildModulesLinkedList = (modules: string[] | undefined, nextModule: strin return null } -export const buildSafe = async (safeAdd, safeName, latestMasterContractVersion?: any) => { +export const buildSafe = async (safeAdd: string, safeName: string, latestMasterContractVersion?: any) => { const safeAddress = checksumAddress(safeAdd) const safeParams = ['getThreshold', 'nonce', 'VERSION', 'getOwners'] @@ -105,24 +104,16 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch // Converts from [ { address, ownerName} ] to address array const localOwners = localSafe ? localSafe.owners.map((localOwner) => localOwner.address) : undefined - const localThreshold = localSafe ? localSafe.threshold : undefined - const localNonce = localSafe ? localSafe.nonce : undefined dispatch( - addSafeModules({ - safeAddress, - modulesAddresses: buildModulesLinkedList(modules?.array, modules?.next), + updateSafe({ + address: safeAddress, + modules: buildModulesLinkedList(modules?.array, modules?.next), + nonce: Number(remoteNonce), + threshold: Number(remoteThreshold), }), ) - if (localNonce !== Number(remoteNonce)) { - dispatch(updateSafe({ address: safeAddress, nonce: Number(remoteNonce) })) - } - - if (localThreshold !== Number(remoteThreshold)) { - dispatch(updateSafe({ address: safeAddress, threshold: Number(remoteThreshold) })) - } - // If the remote owners does not contain a local address, we remove that local owner if (localOwners) { localOwners.forEach((localAddress) => { @@ -149,7 +140,7 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch } // eslint-disable-next-line consistent-return -export default (safeAdd) => async (dispatch, getState) => { +export default (safeAdd: string) => async (dispatch, getState) => { try { const safeAddress = checksumAddress(safeAdd) const safeName = (await getSafeName(safeAddress)) || 'LOADED SAFE' diff --git a/src/routes/safe/store/reducer/safe.ts b/src/routes/safe/store/reducer/safe.ts index 8d71f7e3..10543706 100644 --- a/src/routes/safe/store/reducer/safe.ts +++ b/src/routes/safe/store/reducer/safe.ts @@ -15,7 +15,6 @@ import { makeOwner } from 'src/routes/safe/store/models/owner' import makeSafe from 'src/routes/safe/store/models/safe' import { checksumAddress } from 'src/utils/checksumAddress' import { SafeReducerMap } from './types/safe' -import { ADD_SAFE_MODULES } from 'src/routes/safe/store/actions/addSafeModules' export const SAFE_REDUCER_ID = 'safes' export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED' @@ -128,10 +127,6 @@ export default handleActions( return prevSafe.merge({ owners: updatedOwners }) }) }, - [ADD_SAFE_MODULES]: (state: SafeReducerMap, action) => { - const { modulesAddresses, safeAddress } = action.payload - return state.setIn(['safes', safeAddress, 'modules'], modulesAddresses) - }, [SET_DEFAULT_SAFE]: (state: SafeReducerMap, action) => state.set('defaultSafe', action.payload), [SET_LATEST_MASTER_CONTRACT_VERSION]: (state: SafeReducerMap, action) => state.set('latestMasterContractVersion', action.payload),