From 3c205fbf71dda73b5981d2991226e0dd6bf027c5 Mon Sep 17 00:00:00 2001 From: tea2x Date: Tue, 20 Aug 2024 23:29:22 +0700 Subject: [PATCH] patch previous build --- dist/lumos-patcher.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dist/lumos-patcher.js b/dist/lumos-patcher.js index 2a8e8a7..659bd00 100644 --- a/dist/lumos-patcher.js +++ b/dist/lumos-patcher.js @@ -151,11 +151,20 @@ const unlock = (txSkeleton, fromAddress, daoWithdrawalCell) => __awaiter(void 0, }); } // add dao unlock header deps - txSkeleton = txSkeleton.update("headerDeps", (headerDeps) => { - return headerDeps.push(daoDepositCell.blockHash, daoWithdrawalCell.blockHash); - }); + let headerDeps = txSkeleton.get("headerDeps"); + if (!headerDeps.contains(daoDepositCell.blockHash)) { + txSkeleton = txSkeleton.update("headerDeps", (headerDeps) => { + return headerDeps.push(daoDepositCell.blockHash); + }); + } + if (!headerDeps.contains(daoWithdrawalCell.blockHash)) { + txSkeleton = txSkeleton.update("headerDeps", (headerDeps) => { + return headerDeps.push(daoWithdrawalCell.blockHash); + }); + } // add dao unlock witness - const depositHeaderDepIndex = txSkeleton.get("headerDeps").size - 2; + headerDeps = txSkeleton.get("headerDeps"); + const depositHeaderDepIndex = headerDeps.indexOf(daoDepositCell.blockHash); const defaultWitnessArgs = { inputType: codec_1.bytes.hexify(codec_1.number.Uint64LE.pack(depositHeaderDepIndex)), };