diff --git a/dist/scripts/index.js b/dist/scripts/index.js index e118191..8518511 100644 --- a/dist/scripts/index.js +++ b/dist/scripts/index.js @@ -2,7 +2,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.BitcoinScript = void 0; const p2pkh_1 = require("./p2pkh"); -const p2wpkh_1 = require("./p2wpkh"); class BitcoinScript { constructor(transaction) { this.transaction = transaction; @@ -20,14 +19,14 @@ class BitcoinScript { const p2pkh = new p2pkh_1.P2PKH(this.transaction); isValidInput = p2pkh.execute(scriptPubKey, scriptSig, i); break; - case "v0_p2wpkh": - scriptPubKey = input.prevout.scriptpubkey_asm; - publicKeyHash = scriptPubKey.split(" ")[2]; - scriptPubKey = `OP_DUP OP_HASH160 ${publicKeyHash} OP_EQUALVERIFY OP_CHECKSIG`; - witness = input.witness; - const p2wpkh = new p2wpkh_1.P2WPKH(this.transaction); - isValidInput = p2wpkh.execute(scriptPubKey, witness, i); - break; + // case "v0_p2wpkh": + // scriptPubKey = input.prevout.scriptpubkey_asm; + // publicKeyHash = scriptPubKey.split(" ")[2]; + // scriptPubKey = `OP_DUP OP_HASH160 ${publicKeyHash} OP_EQUALVERIFY OP_CHECKSIG`; + // witness = input.witness; + // const p2wpkh = new P2WPKH(this.transaction); + // isValidInput = p2wpkh.execute(scriptPubKey, witness, i); + // break; default: break; } diff --git a/dist/validate.js b/dist/validate.js index 2eabf63..331e190 100644 --- a/dist/validate.js +++ b/dist/validate.js @@ -33,9 +33,9 @@ class Validator { } } console.log(`Find ${this.ValidTXCount} are valid and ${this.InValidTXCount} invalid`); - for (let i = 0; i < 3450; i++) { - validTransactions.pop(); - } + // for (let i = 0; i < 3450; i++) { + // validTransactions.pop(); + // } return validTransactions; } start(transaction) { diff --git a/src/scripts/index.ts b/src/scripts/index.ts index 4cd471c..9cfc71b 100644 --- a/src/scripts/index.ts +++ b/src/scripts/index.ts @@ -18,14 +18,14 @@ export class BitcoinScript { const p2pkh = new P2PKH(this.transaction); isValidInput = p2pkh.execute(scriptPubKey, scriptSig, i); break; - case "v0_p2wpkh": - scriptPubKey = input.prevout.scriptpubkey_asm; - publicKeyHash = scriptPubKey.split(" ")[2]; - scriptPubKey = `OP_DUP OP_HASH160 ${publicKeyHash} OP_EQUALVERIFY OP_CHECKSIG`; - witness = input.witness; - const p2wpkh = new P2WPKH(this.transaction); - isValidInput = p2wpkh.execute(scriptPubKey, witness, i); - break; + // case "v0_p2wpkh": + // scriptPubKey = input.prevout.scriptpubkey_asm; + // publicKeyHash = scriptPubKey.split(" ")[2]; + // scriptPubKey = `OP_DUP OP_HASH160 ${publicKeyHash} OP_EQUALVERIFY OP_CHECKSIG`; + // witness = input.witness; + // const p2wpkh = new P2WPKH(this.transaction); + // isValidInput = p2wpkh.execute(scriptPubKey, witness, i); + // break; default: break; } diff --git a/src/validate.ts b/src/validate.ts index 3ae8776..cbca109 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -31,9 +31,9 @@ export class Validator { console.log( `Find ${this.ValidTXCount} are valid and ${this.InValidTXCount} invalid` ); - for (let i = 0; i < 3450; i++) { - validTransactions.pop(); - } + // for (let i = 0; i < 3450; i++) { + // validTransactions.pop(); + // } return validTransactions; }