name tapscript by its name + OP_CHECKSIGADD tapscript opcode detection
This commit is contained in:
parent
096f2172c6
commit
53d68a3571
@ -326,21 +326,27 @@ class BitcoinApi implements AbstractBitcoinApi {
|
|||||||
b.push(data.toString('hex'));
|
b.push(data.toString('hex'));
|
||||||
i += data.length;
|
i += data.length;
|
||||||
} else {
|
} else {
|
||||||
const opcode = bitcoinjs.script.toASM([ op ]);
|
if (op === 0x00) {
|
||||||
if (opcode && op < 0xfd) {
|
b.push('OP_0');
|
||||||
if (op === 0x4f) {
|
} else if (op === 0x4f) {
|
||||||
b.push('OP_PUSHNUM_NEG1');
|
b.push('OP_PUSHNUM_NEG1');
|
||||||
} else if (/^OP_(\d+)$/.test(opcode) && op !== 0x00) {
|
} else if (op === 0xb1) {
|
||||||
b.push(opcode.replace(/^OP_(\d+)$/, 'OP_PUSHNUM_$1'));
|
b.push('OP_CLTV');
|
||||||
} else if (op === 0xb1) {
|
} else if (op === 0xb2) {
|
||||||
b.push('OP_CLTV');
|
b.push('OP_CSV');
|
||||||
} else if (op === 0xb2) {
|
} else if (op === 0xba) {
|
||||||
b.push('OP_CSV');
|
b.push('OP_CHECKSIGADD');
|
||||||
} else {
|
|
||||||
b.push(opcode);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
b.push('OP_RETURN_' + op);
|
const opcode = bitcoinjs.script.toASM([ op ]);
|
||||||
|
if (opcode && op < 0xfd) {
|
||||||
|
if (/^OP_(\d+)$/.test(opcode)) {
|
||||||
|
b.push(opcode.replace(/^OP_(\d+)$/, 'OP_PUSHNUM_$1'));
|
||||||
|
} else {
|
||||||
|
b.push(opcode);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
b.push('OP_RETURN_' + op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,10 @@
|
|||||||
<td style="text-align: left;" [innerHTML]="vin.inner_redeemscript_asm | asmStyler"></td>
|
<td style="text-align: left;" [innerHTML]="vin.inner_redeemscript_asm | asmStyler"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="vin.inner_witnessscript_asm">
|
<tr *ngIf="vin.inner_witnessscript_asm">
|
||||||
<td i18n="transactions-list.p2wsh-witness-script">P2WSH witness script</td>
|
<td *ngIf="vin.prevout && vin.prevout.scriptpubkey_type == 'v1_p2tr'; else p2wsh" i18n="transactions-list.p2tr-tapscript">P2TR tapscript</td>
|
||||||
|
<ng-template #p2wsh>
|
||||||
|
<td i18n="transactions-list.p2wsh-witness-script">P2WSH witness script</td>
|
||||||
|
</ng-template>
|
||||||
<td style="text-align: left;" [innerHTML]="vin.inner_witnessscript_asm | asmStyler"></td>
|
<td style="text-align: left;" [innerHTML]="vin.inner_witnessscript_asm | asmStyler"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -281,6 +281,7 @@ export class AsmStylerPipe implements PipeTransform {
|
|||||||
case 'CHECKSIGVERIFY':
|
case 'CHECKSIGVERIFY':
|
||||||
case 'CHECKMULTISIG':
|
case 'CHECKMULTISIG':
|
||||||
case 'CHECKMULTISIGVERIFY':
|
case 'CHECKMULTISIGVERIFY':
|
||||||
|
case 'CHECKSIGADD':
|
||||||
style = 'crypto';
|
style = 'crypto';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user