From 82655baf43d7d364a9b927c133af94153b35740a Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 16 May 2018 15:46:45 +0200 Subject: [PATCH] Adjust OperationDetail with updated Operation type --- src/components/OperationsList/index.js | 2 +- src/components/modals/OperationDetails.js | 27 +++---------------- .../accounts/scanAccountsOnDevice.js | 3 ++- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/components/OperationsList/index.js b/src/components/OperationsList/index.js index b8db8fbc..f81f5c78 100644 --- a/src/components/OperationsList/index.js +++ b/src/components/OperationsList/index.js @@ -126,7 +126,7 @@ export class OperationsList extends PureComponent { return ( { const { t, type, onClose, operation, account, marketColor, currencySettings } = props - const { id, amount, date } = operation - - // $FlowFixMe YEAH, I know those fields should not be present in operation - const { from, to } = operation + const { id, hash, amount, date, senders, recipients } = operation const { name, unit, currency } = account const confirmations = account.blockHeight - operation.blockHeight @@ -131,34 +128,18 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => { From - - {from.map((v, i) => ( - - {v} - - ))} - + {senders.map(v => {v} )} To - - {to.map((v, i) => ( - - {v} - - ))} - + {recipients.map(v => {v} )} Identifier - {id} + {hash} diff --git a/src/internals/accounts/scanAccountsOnDevice.js b/src/internals/accounts/scanAccountsOnDevice.js index bff2f677..1740e2e8 100644 --- a/src/internals/accounts/scanAccountsOnDevice.js +++ b/src/internals/accounts/scanAccountsOnDevice.js @@ -236,6 +236,7 @@ async function buildAccountRaw({ } function buildOperationRaw({ core, op, xpub }: { core: Object, op: NJSOperation, xpub: string }) { + const id = op.getUid() const bitcoinLikeOperation = op.asBitcoinLikeOperation() const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction() const hash = bitcoinLikeTransaction.getHash() @@ -246,7 +247,7 @@ function buildOperationRaw({ core, op, xpub }: { core: Object, op: NJSOperation, const amount = operationType === core.OPERATION_TYPES.SEND ? -absoluteAmount : absoluteAmount return { - id: hash, + id, hash, address: '', senders: op.getSenders(),