remove extending transaction model with ownerName in extendedTransactionsSelector

This commit is contained in:
Mikhail Mikheev 2020-04-23 18:22:30 +04:00
parent cff53e76c9
commit 2acef6993c
1 changed files with 1 additions and 13 deletions

View File

@ -122,23 +122,11 @@ const extendedTransactionsSelector: Selector<
safeTransactionsSelector,
safeCancellationTransactionsSelector,
safeIncomingTransactionsSelector,
getAddressBook,
(safe, userAddress, transactions, cancellationTransactions, incomingTransactions, addressBook) => {
(safe, userAddress, transactions, cancellationTransactions, incomingTransactions) => {
const cancellationTransactionsByNonce = cancellationTransactions.reduce((acc, tx) => acc.set(tx.nonce, tx), Map())
const extendedTransactions = transactions.map((tx: Transaction) => {
let extendedTx = tx
// add owner names to confirmations
const txConfirmations = tx.get('confirmations').map((confirmation) => {
const confirmationOwnerAdbkEntry = addressBook.find((adbkEntry) => adbkEntry.address === confirmation.owner)
return confirmation.set(
'ownerName',
(confirmationOwnerAdbkEntry && confirmationOwnerAdbkEntry.name) || 'UNKNOWN',
)
})
extendedTx = tx.set('confirmations', txConfirmations)
if (!tx.isExecuted) {
if (
(cancellationTransactionsByNonce.get(tx.nonce) &&