Skip to content

Commit

Permalink
fix(neuron-ui): sort outputs of a transaction by outPoint.index
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Sep 12, 2019
1 parent 4803492 commit c9aef30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 7 additions & 5 deletions packages/neuron-ui/src/components/Transaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,13 @@ const Transaction = () => {
Outputs
</Text>
<DetailsList
items={transaction.outputs.map((output, index) => ({
...output,
index,
capacity: `${shannonToCKBFormatter(output.capacity)} CKB`,
}))}
items={transaction.outputs
.map(output => ({
...output,
index: output.outPoint.index,
capacity: `${shannonToCKBFormatter(output.capacity)} CKB`,
}))
.sort((o1, o2) => +o1.index - +o2.index)}
columns={outputColumns}
checkboxVisibility={CheckboxVisibility.hidden}
compact
Expand Down
7 changes: 2 additions & 5 deletions packages/neuron-ui/src/types/App/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ declare namespace State {
}
lockHash: string
outPoint: {
blockHash: string | null
cell: {
index: string
txHash: string
}
index: string
txHash: string
}
}[]
witnesses: string[]
Expand Down

0 comments on commit c9aef30

Please sign in to comment.