Merge branch 'development' into issue-1144
This commit is contained in:
commit
425a38b2d9
|
@ -44,8 +44,20 @@ jobs:
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 10.16
|
node-version: 10.16
|
||||||
- run: yarn install --network-concurrency 1
|
- run: |
|
||||||
|
mkdir .yarncache
|
||||||
|
yarn install --frozen-lockfile --cache-folder ./.yarncache
|
||||||
|
- name: Remove and cache clean (Windows Only)
|
||||||
|
if: startsWith(matrix.os, 'windows')
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
rm -Recurse -Force .yarncache
|
||||||
|
yarn cache clean
|
||||||
|
- name: Remove and cache clean
|
||||||
|
if: "!startsWith(matrix.os, 'windows')"
|
||||||
|
run: |
|
||||||
|
rm -rf .yarncache
|
||||||
|
yarn cache clean
|
||||||
- name: Build/Release Desktop App
|
- name: Build/Release Desktop App
|
||||||
env:
|
env:
|
||||||
# macOS notarization API key
|
# macOS notarization API key
|
||||||
|
|
|
@ -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
|
|
|
@ -15,7 +15,6 @@ import { makeOwner } from 'src/routes/safe/store/models/owner'
|
||||||
import { checksumAddress } from 'src/utils/checksumAddress'
|
import { checksumAddress } from 'src/utils/checksumAddress'
|
||||||
import { ModulePair, SafeOwner } from 'src/routes/safe/store/models/safe'
|
import { ModulePair, SafeOwner } from 'src/routes/safe/store/models/safe'
|
||||||
import { Dispatch } from 'redux'
|
import { Dispatch } from 'redux'
|
||||||
import addSafeModules from './addSafeModules'
|
|
||||||
import { SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts'
|
import { SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts'
|
||||||
|
|
||||||
const buildOwnersFrom = (
|
const buildOwnersFrom = (
|
||||||
|
@ -49,7 +48,7 @@ const buildModulesLinkedList = (modules: string[] | undefined, nextModule: strin
|
||||||
return null
|
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 safeAddress = checksumAddress(safeAdd)
|
||||||
|
|
||||||
const safeParams = ['getThreshold', 'nonce', 'VERSION', 'getOwners']
|
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
|
// Converts from [ { address, ownerName} ] to address array
|
||||||
const localOwners = localSafe ? localSafe.owners.map((localOwner) => localOwner.address) : undefined
|
const localOwners = localSafe ? localSafe.owners.map((localOwner) => localOwner.address) : undefined
|
||||||
const localThreshold = localSafe ? localSafe.threshold : undefined
|
|
||||||
const localNonce = localSafe ? localSafe.nonce : undefined
|
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addSafeModules({
|
updateSafe({
|
||||||
safeAddress,
|
address: safeAddress,
|
||||||
modulesAddresses: buildModulesLinkedList(modules?.array, modules?.next),
|
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 the remote owners does not contain a local address, we remove that local owner
|
||||||
if (localOwners) {
|
if (localOwners) {
|
||||||
localOwners.forEach((localAddress) => {
|
localOwners.forEach((localAddress) => {
|
||||||
|
@ -149,7 +140,7 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line consistent-return
|
// eslint-disable-next-line consistent-return
|
||||||
export default (safeAdd) => async (dispatch, getState) => {
|
export default (safeAdd: string) => async (dispatch, getState) => {
|
||||||
try {
|
try {
|
||||||
const safeAddress = checksumAddress(safeAdd)
|
const safeAddress = checksumAddress(safeAdd)
|
||||||
const safeName = (await getSafeName(safeAddress)) || 'LOADED SAFE'
|
const safeName = (await getSafeName(safeAddress)) || 'LOADED SAFE'
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { makeOwner } from 'src/routes/safe/store/models/owner'
|
||||||
import makeSafe from 'src/routes/safe/store/models/safe'
|
import makeSafe from 'src/routes/safe/store/models/safe'
|
||||||
import { checksumAddress } from 'src/utils/checksumAddress'
|
import { checksumAddress } from 'src/utils/checksumAddress'
|
||||||
import { SafeReducerMap } from './types/safe'
|
import { SafeReducerMap } from './types/safe'
|
||||||
import { ADD_SAFE_MODULES } from 'src/routes/safe/store/actions/addSafeModules'
|
|
||||||
|
|
||||||
export const SAFE_REDUCER_ID = 'safes'
|
export const SAFE_REDUCER_ID = 'safes'
|
||||||
export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED'
|
export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED'
|
||||||
|
@ -128,10 +127,6 @@ export default handleActions(
|
||||||
return prevSafe.merge({ owners: updatedOwners })
|
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_DEFAULT_SAFE]: (state: SafeReducerMap, action) => state.set('defaultSafe', action.payload),
|
||||||
[SET_LATEST_MASTER_CONTRACT_VERSION]: (state: SafeReducerMap, action) =>
|
[SET_LATEST_MASTER_CONTRACT_VERSION]: (state: SafeReducerMap, action) =>
|
||||||
state.set('latestMasterContractVersion', action.payload),
|
state.set('latestMasterContractVersion', action.payload),
|
||||||
|
|
Loading…
Reference in New Issue