Skip to content

Commit c914dff

Browse files
committed
fix: fix getDaoCells return
1 parent 5259b3f commit c914dff

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

  • packages/neuron-wallet/src/services

packages/neuron-wallet/src/services/cells.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,23 @@ export default class CellsService {
6262

6363
const cells = outputs.map(o => o.toInterface())
6464
for (const o of cells) {
65-
const output = await getConnection()
66-
.getRepository(OutputEntity)
67-
.createQueryBuilder('output')
68-
.leftJoinAndSelect('output.transaction', 'tx')
69-
.where(`(output.outPointTxHash, output.outPointIndex) IN (select outPointTxHash, outPointIndex from input where input.transactionHash = :transactionHash)`, {
70-
transactionHash: o.outPoint!.txHash,
71-
})
72-
.getOne()
73-
74-
if (output) {
75-
o.depositOutPoint = output.outPoint()
65+
if (o.daoData !== '0x0000000000000000') {
66+
const output = await getConnection()
67+
.getRepository(OutputEntity)
68+
.createQueryBuilder('output')
69+
.leftJoinAndSelect('output.transaction', 'tx')
70+
.where(`(output.outPointTxHash, output.outPointIndex) IN (select outPointTxHash, outPointIndex from input where input.transactionHash = :transactionHash)`, {
71+
transactionHash: o.outPoint!.txHash,
72+
})
73+
.getOne()
74+
75+
if (output) {
76+
o.depositOutPoint = output.outPoint()
77+
}
7678
}
7779
}
7880

79-
return outputs.map(o => o.toInterface())
81+
return cells
8082
}
8183

8284
public static getLiveCell = async (outPoint: OutPoint): Promise<Cell | undefined> => {

0 commit comments

Comments
 (0)