Format code
This commit is contained in:
parent
8d8d45dd44
commit
f8c9539e68
|
@ -62,8 +62,7 @@ export const approveTransaction = async (
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.on('error', (error) => {
|
.on('error', (error) => {
|
||||||
/* eslint-disable */
|
console.error('Tx error:', error)
|
||||||
console.log('Tx error:', error)
|
|
||||||
})
|
})
|
||||||
.then(async (receipt) => {
|
.then(async (receipt) => {
|
||||||
closeSnackbar(pendingExecutionKey)
|
closeSnackbar(pendingExecutionKey)
|
||||||
|
@ -84,13 +83,13 @@ export const approveTransaction = async (
|
||||||
|
|
||||||
return transactionHash
|
return transactionHash
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
closeSnackbar(beforeExecutionKey)
|
||||||
closeSnackbar(pendingExecutionKey)
|
closeSnackbar(pendingExecutionKey)
|
||||||
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
|
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
const executeData = safeInstance.contract.methods.approveHash(txHash).encodeABI()
|
const executeData = safeInstance.contract.methods.approveHash(txHash).encodeABI()
|
||||||
const errMsg = await getErrorMessage(safeInstance.address, 0, executeData, sender)
|
const errMsg = await getErrorMessage(safeInstance.address, 0, executeData, sender)
|
||||||
console.log(`Error executing the TX: ${errMsg}`)
|
console.error(`Error executing the TX: ${errMsg}`)
|
||||||
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
@ -138,7 +137,7 @@ export const executeTransaction = async (
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.on('error', (error) => {
|
.on('error', (error) => {
|
||||||
console.log('Tx error:', error)
|
console.error('Tx error:', error)
|
||||||
})
|
})
|
||||||
.then(async (receipt) => {
|
.then(async (receipt) => {
|
||||||
closeSnackbar(pendingExecutionKey)
|
closeSnackbar(pendingExecutionKey)
|
||||||
|
@ -160,14 +159,14 @@ export const executeTransaction = async (
|
||||||
return transactionHash
|
return transactionHash
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
closeSnackbar(beforeExecutionKey)
|
closeSnackbar(beforeExecutionKey)
|
||||||
|
closeSnackbar(pendingExecutionKey)
|
||||||
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
|
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
const executeDataUsedSignatures = safeInstance.contract.methods
|
const executeDataUsedSignatures = safeInstance.contract.methods
|
||||||
.execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
|
.execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
|
||||||
.encodeABI()
|
.encodeABI()
|
||||||
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, sender)
|
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, sender)
|
||||||
console.log(`Error executing the TX: ${errMsg}`)
|
console.error(`Error executing the TX: ${errMsg}`)
|
||||||
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,11 +46,9 @@ const handleProviderNotification = (enqueueSnackbar: Function, closeSnackbar: Fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (
|
export default (provider: ProviderProps, enqueueSnackbar: Function, closeSnackbar: Function) => (
|
||||||
provider: ProviderProps,
|
dispatch: ReduxDispatch<*>,
|
||||||
enqueueSnackbar: Function,
|
) => {
|
||||||
closeSnackbar: Function,
|
|
||||||
) => (dispatch: ReduxDispatch<*>) => {
|
|
||||||
handleProviderNotification(enqueueSnackbar, closeSnackbar, provider)
|
handleProviderNotification(enqueueSnackbar, closeSnackbar, provider)
|
||||||
processProviderResponse(dispatch, provider)
|
processProviderResponse(dispatch, provider)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,7 @@ export const addSafe = createAction<string, Function, ActionReturn>(ADD_SAFE, (s
|
||||||
safe,
|
safe,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const saveSafe = (safe: Safe) => (
|
const saveSafe = (safe: Safe) => (dispatch: ReduxDispatch<GlobalState>, getState: GetState<GlobalState>) => {
|
||||||
dispatch: ReduxDispatch<GlobalState>,
|
|
||||||
getState: GetState<GlobalState>,
|
|
||||||
) => {
|
|
||||||
const state = getState()
|
const state = getState()
|
||||||
const safeList = safesListSelector(state)
|
const safeList = safesListSelector(state)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
|
||||||
import { addTransactions } from './addTransactions'
|
import { addTransactions } from './addTransactions'
|
||||||
import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens'
|
import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens'
|
||||||
import { isTokenTransfer } from '~/logic/tokens/utils/tokenHelpers'
|
import { isTokenTransfer } from '~/logic/tokens/utils/tokenHelpers'
|
||||||
import { TX_TYPE_EXECUTION } from '~/logic/safe/transactions/send'
|
import { TX_TYPE_EXECUTION } from '~/logic/safe/transactions'
|
||||||
import { decodeParamsFromSafeMethod } from '~/logic/contracts/methodIds'
|
import { decodeParamsFromSafeMethod } from '~/logic/contracts/methodIds'
|
||||||
|
|
||||||
let web3
|
let web3
|
||||||
|
|
|
@ -37,9 +37,6 @@ const reducers: Reducer<GlobalState> = combineReducers({
|
||||||
[TRANSACTIONS_REDUCER_ID]: transactions,
|
[TRANSACTIONS_REDUCER_ID]: transactions,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const store: Store<GlobalState> = createStore(
|
export const store: Store<GlobalState> = createStore(reducers, finalCreateStore)
|
||||||
reducers,
|
|
||||||
finalCreateStore,
|
|
||||||
)
|
|
||||||
|
|
||||||
export const aNewStore = (localState?: Object): Store<GlobalState> => createStore(reducers, localState, finalCreateStore)
|
export const aNewStore = (localState?: Object): Store<GlobalState> => createStore(reducers, localState, finalCreateStore)
|
||||||
|
|
Loading…
Reference in New Issue