ckb-cell / rgbpp-sdk

Utilities for Bitcoin and RGB++ asset integration
ISC License
53 stars 16 forks source link

The CKB tx outputs will be removed #97

Closed duanyytop closed 4 months ago

duanyytop commented 5 months ago

https://github.com/ckb-cell/rgbpp-sdk/blob/develop/packages/ckb/src/rgbpp/ckb-builder.ts#L165

A bug in the above code will delete outputs except for RGBPP lock and BTC time lock. Since these two output cells are used in all scenarios, there is no problem for now, but there is indeed a problem here.

ShookLyngs commented 5 months ago

Do you think it should be fixed before the main release?

const outputs = ckbRawTx.outputs
  .map((output) => {
    if (!isRgbppLockOrBtcTimeLock(output.lock, isMainnet)) {
      return output;
    }
    return {
      ...output,
      lock: {
        ...output.lock,
        args: replaceLockArgsWithRealBtcTxId(output.lock.args, btcTxId),
      },
    };
  });
duanyytop commented 4 months ago