fetch transactions refactoring wip

This commit is contained in:
Mikhail Mikheev 2020-04-28 19:55:51 +04:00
parent df1500dd6e
commit 27ee734db0
2 changed files with 7 additions and 6 deletions

View File

@ -1,18 +1,19 @@
// @flow // @flow
import { List, Map, type RecordInstance } from 'immutable' import { List, Map } from 'immutable'
import { batch } from 'react-redux' import { batch } from 'react-redux'
import type { Dispatch as ReduxDispatch } from 'redux' import type { Dispatch as ReduxDispatch } from 'redux'
import { addIncomingTransactions } from './addIncomingTransactions' import { addIncomingTransactions } from '../addIncomingTransactions'
import { addTransactions } from './addTransactions' import { addTransactions } from '../addTransactions'
import { TxServiceModel } from './loadOutgoingTransactions'
import { type SafeTransactionsType, TxServiceModel, loadOutgoingTransactions } from './loadOutgoingTransactions'
import { addCancellationTransactions } from '~/routes/safe/store/actions/transactions/addCancellationTransactions' import { addCancellationTransactions } from '~/routes/safe/store/actions/transactions/addCancellationTransactions'
import { type IncomingTransaction } from '~/routes/safe/store/models/incomingTransaction' import { type IncomingTransaction } from '~/routes/safe/store/models/incomingTransaction'
import { type GlobalState } from '~/store' import { type GlobalState } from '~/store'
export default (safeAddress: string) => async (dispatch: ReduxDispatch<GlobalState>, getState: GetState) => { export default (safeAddress: string) => async (dispatch: ReduxDispatch<GlobalState>, getState: GetState) => {
const transactions: SafeTransactionsType | typeof undefined = await loadSafeTransactions(safeAddress, getState) const transactions: SafeTransactionsType | typeof undefined = await loadOutgoingTransactions(safeAddress, getState)
if (transactions) { if (transactions) {
const { cancel, outgoing } = transactions const { cancel, outgoing } = transactions

View File

@ -49,7 +49,7 @@ export type TxServiceModel = {
creationTx?: boolean, creationTx?: boolean,
} }
type SafeTransactionsType = { export type SafeTransactionsType = {
outgoing: Map<string, List<TransactionProps>>, outgoing: Map<string, List<TransactionProps>>,
cancel: Map<string, List<TransactionProps>>, cancel: Map<string, List<TransactionProps>>,
} }