message: feat(utxo-lib): test getInputUpdate for unsigned tx
diff: @@ -59,18 +59,32 @@ function runTest(
  ));
  });
  - it('has getInputUpdate with expected value', function () {
  + function testGetInputUpdateForStage(stage: 'unsigned' | 'halfSigned') {
  + it(`has getInputUpdate with expected value, stage=${stage}`, function () {
  if (scriptType === 'p2shP2pk') {
  this.skip();
  }
  + const tx = stage === 'unsigned' ? unsigned : halfSigned;
  const vin = 0;
  + const nonWitnessUtxo = scriptType === 'p2sh' ? prevOutputs[vin].prevTx : undefined;
  const result = getInputUpdate(
  - halfSigned.clone() /* FIXME: make getInputUpdate non-destructive */,
  + tx.clone() /* FIXME: make getInputUpdate non-destructive */,
  vin,
  prevOutputs[0]
  );
  - const parsed = parseSignatureScript(halfSigned.ins[vin]);
  +
  + if (stage === 'unsigned') {
  + assert.deepStrictEqual(
  + normDefault(result),
  + normDefault({
  + nonWitnessUtxo,
  + })
  + );
  + return;
  + }
  +
  + const parsed = parseSignatureScript(tx.ins[vin]);
  assert(parsed.scriptType !== undefined);
  function getTaprootUpdate(parsed: ParsedSignatureScriptTaprootScriptPath, pubkey: Buffer, signature: Buffer) {
  @@ -101,7 +115,7 @@ function runTest(
  const { redeemScript, witnessScript } = createOutputScript2of3(walletKeys.publicKeys, scriptType);
  const parsedSignatures = parsed.signatures.filter((s) => !isPlaceholderSignature(s));
  const signedBy = walletKeys.publicKeys.filter((k) =>
  - verifySignatureWithPublicKey(halfSigned, vin, prevOutputs, k)
  + verifySignatureWithPublicKey(tx, vin, prevOutputs, k)
  );
  assert.strictEqual(parsedSignatures.length, 1);
  @@ -111,7 +125,7 @@ function runTest(
  assert.deepStrictEqual(
  normDefault(result),
  normDefault({
  - nonWitnessUtxo: scriptType === 'p2sh' ? prevOutputs[0].prevTx : undefined,
  + nonWitnessUtxo,
  partialSig:
  scriptType === 'p2tr'
  ? undefined
  @@ -130,6 +144,10 @@ function runTest(
  );
  }
  });
  + }
  +
  + testGetInputUpdateForStage('unsigned');
  + testGetInputUpdateForStage('halfSigned');
  it('has equal unsigned tx', function () {
  assert.strictEqual(
  