Skip to content

Commit c9aef30

Browse files
committed
fix(neuron-ui): sort outputs of a transaction by outPoint.index
1 parent 4803492 commit c9aef30

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

packages/neuron-ui/src/components/Transaction/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ const Transaction = () => {
189189
Outputs
190190
</Text>
191191
<DetailsList
192-
items={transaction.outputs.map((output, index) => ({
193-
...output,
194-
index,
195-
capacity: `${shannonToCKBFormatter(output.capacity)} CKB`,
196-
}))}
192+
items={transaction.outputs
193+
.map(output => ({
194+
...output,
195+
index: output.outPoint.index,
196+
capacity: `${shannonToCKBFormatter(output.capacity)} CKB`,
197+
}))
198+
.sort((o1, o2) => +o1.index - +o2.index)}
197199
columns={outputColumns}
198200
checkboxVisibility={CheckboxVisibility.hidden}
199201
compact

packages/neuron-ui/src/types/App/index.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ declare namespace State {
3333
}
3434
lockHash: string
3535
outPoint: {
36-
blockHash: string | null
37-
cell: {
38-
index: string
39-
txHash: string
40-
}
36+
index: string
37+
txHash: string
4138
}
4239
}[]
4340
witnesses: string[]

0 commit comments

Comments
 (0)