Format code

This commit is contained in:
Germán Martínez 2019-09-24 11:38:59 +02:00
parent 8d8d45dd44
commit f8c9539e68
5 changed files with 12 additions and 21 deletions

View File

@ -62,8 +62,7 @@ export const approveTransaction = async (
)
})
.on('error', (error) => {
/* eslint-disable */
console.log('Tx error:', error)
console.error('Tx error:', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
@ -84,13 +83,13 @@ export const approveTransaction = async (
return transactionHash
} catch (error) {
closeSnackbar(beforeExecutionKey)
closeSnackbar(pendingExecutionKey)
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
/* eslint-disable */
const executeData = safeInstance.contract.methods.approveHash(txHash).encodeABI()
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
}
@ -138,7 +137,7 @@ export const executeTransaction = async (
)
})
.on('error', (error) => {
console.log('Tx error:', error)
console.error('Tx error:', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
@ -160,14 +159,14 @@ export const executeTransaction = async (
return transactionHash
} catch (error) {
closeSnackbar(beforeExecutionKey)
closeSnackbar(pendingExecutionKey)
enqueueSnackbar(notiQueue.afterExecutionError.description, notiQueue.afterExecutionError.options)
/* eslint-disable */
const executeDataUsedSignatures = safeInstance.contract.methods
.execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
.encodeABI()
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
}

View File

@ -46,11 +46,9 @@ const handleProviderNotification = (enqueueSnackbar: Function, closeSnackbar: Fu
}
}
export default (
provider: ProviderProps,
enqueueSnackbar: Function,
closeSnackbar: Function,
) => (dispatch: ReduxDispatch<*>) => {
export default (provider: ProviderProps, enqueueSnackbar: Function, closeSnackbar: Function) => (
dispatch: ReduxDispatch<*>,
) => {
handleProviderNotification(enqueueSnackbar, closeSnackbar, provider)
processProviderResponse(dispatch, provider)
}

View File

@ -24,10 +24,7 @@ export const addSafe = createAction<string, Function, ActionReturn>(ADD_SAFE, (s
safe,
}))
const saveSafe = (safe: Safe) => (
dispatch: ReduxDispatch<GlobalState>,
getState: GetState<GlobalState>,
) => {
const saveSafe = (safe: Safe) => (dispatch: ReduxDispatch<GlobalState>, getState: GetState<GlobalState>) => {
const state = getState()
const safeList = safesListSelector(state)

View File

@ -14,7 +14,7 @@ import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
import { addTransactions } from './addTransactions'
import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens'
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'
let web3

View File

@ -37,9 +37,6 @@ const reducers: Reducer<GlobalState> = combineReducers({
[TRANSACTIONS_REDUCER_ID]: transactions,
})
export const store: Store<GlobalState> = createStore(
reducers,
finalCreateStore,
)
export const store: Store<GlobalState> = createStore(reducers, finalCreateStore)
export const aNewStore = (localState?: Object): Store<GlobalState> => createStore(reducers, localState, finalCreateStore)