fetch transactions refactoring wip
This commit is contained in:
parent
df1500dd6e
commit
27ee734db0
|
@ -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
|
||||||
|
|
|
@ -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>>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue