move notifications to separate file so processTransaction and createTransaction actions able to use it

This commit is contained in:
Mikhail Mikheev 2019-09-05 15:22:32 +04:00
parent 816b3c5ab5
commit 3660174530
4 changed files with 24 additions and 17 deletions

View File

@ -4,3 +4,4 @@ export * from './send'
export * from './safeBlockchainOperations'
export * from './safeTxSignerEIP712'
export * from './txHistory'
export * from './notifications'

View File

@ -0,0 +1,14 @@
// @flow
export type Notifications = {
BEFORE_EXECUTION_OR_CREATION: string,
AFTER_EXECUTION: string,
CREATED_MORE_CONFIRMATIONS_NEEDED: string,
ERROR: string,
}
export const DEFAULT_NOTIFICATIONS: Notifications = {
BEFORE_EXECUTION_OR_CREATION: 'Transaction in progress',
AFTER_EXECUTION: 'Transaction successfully executed',
CREATED_MORE_CONFIRMATIONS_NEEDED: 'Transaction in progress: More confirmations required to execute',
ERROR: 'Transaction failed',
}

View File

@ -36,7 +36,7 @@ const Transactions = ({
const hasTransactions = transactions.size > 0
return (
<React.Fragment>
<>
{hasTransactions ? (
<TxsTable
transactions={transactions}
@ -51,7 +51,7 @@ const Transactions = ({
) : (
<NoTransactions />
)}
</React.Fragment>
</>
)
}

View File

@ -5,21 +5,13 @@ import { userAccountSelector } from '~/logic/wallets/store/selectors'
import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions'
import { type GlobalState } from '~/store'
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
import { approveTransaction, executeTransaction, CALL } from '~/logic/safe/transactions'
export type Notifications = {
BEFORE_EXECUTION_OR_CREATION: string,
AFTER_EXECUTION: string,
CREATED_MORE_CONFIRMATIONS_NEEDED: string,
ERROR: string,
}
const DEFAULT_NOTIFICATIONS: Notifications = {
BEFORE_EXECUTION_OR_CREATION: 'Transaction in progress',
AFTER_EXECUTION: 'Transaction successfully executed',
CREATED_MORE_CONFIRMATIONS_NEEDED: 'Transaction in progress: More confirmations required to execute',
ERROR: 'Transaction failed',
}
import {
approveTransaction,
executeTransaction,
CALL,
type Notifications,
DEFAULT_NOTIFICATIONS,
} from '~/logic/safe/transactions'
const createTransaction = (
safeAddress: string,