Skip to content

Commit

Permalink
fix: if the target utxo is bound to any unsupported-type cells, mark …
Browse files Browse the repository at this point in the history
…the utxo as invalid
  • Loading branch information
ShookLyngs committed Aug 12, 2024
1 parent c7f37a3 commit cd64417
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rgbpp/src/rgbpp/xudt/btc-transfer-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
encodeCellId,
isScriptEqual,
getXudtTypeScript,
isUDTTypeSupported,
buildRgbppLockArgs,
unpackRgbppLockArgs,
genBtcTransferCkbVirtualTx,
Expand Down Expand Up @@ -96,7 +97,10 @@ export async function buildRgbppTransferAllTxs(params: RgbppTransferAllTxsParams
cellsMap.set(utxoId, cells);
}
const utxo = utxoMap.get(utxoId);
if (!utxo || !cells || cells.length > maxRgbppCellsPerCkbTx) {
const hasUnsupportedTypeCell = cells.some((cell) => {
return cell.cellOutput.type && !isUDTTypeSupported(cell.cellOutput.type, isMainnet);
});
if (!utxo || !cells || cells.length > maxRgbppCellsPerCkbTx || hasUnsupportedTypeCell) {
invalidUtxoIds.add(utxoId);
return;
}
Expand Down

0 comments on commit cd64417

Please sign in to comment.