From da5fb615968c8d7cea7e95f322e249b2482d89a7 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Thu, 12 Dec 2024 15:23:58 -0500 Subject: [PATCH] Add P2S and OP_EVAL support --- libauth | 2 +- package.json | 2 +- src/cash-assembly/editor-tooling.ts | 18 +++++++++++------- src/editor/script-editor/ScriptEditor.tsx | 2 +- src/header/HeaderBar.tsx | 2 +- src/state/types.ts | 4 ++-- yarn.lock | 2 +- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/libauth b/libauth index 681f962..febc970 160000 --- a/libauth +++ b/libauth @@ -1 +1 @@ -Subproject commit 681f962d597dad4e22d203209eefe9826c6bc2ba +Subproject commit febc970a2a3b02c605abedb2842dd072149ef769 diff --git a/package.json b/package.json index 48f9ab9..9e04b6b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "@bitauth/libauth": "3.1.0-next.2", + "@bitauth/libauth": "3.1.0-next.3", "@blueprintjs/core": "^5.8.2", "@blueprintjs/icons": "^5.7.0", "@blueprintjs/select": "^5.0.23", diff --git a/src/cash-assembly/editor-tooling.ts b/src/cash-assembly/editor-tooling.ts index 793ca76..ffc1480 100644 --- a/src/cash-assembly/editor-tooling.ts +++ b/src/cash-assembly/editor-tooling.ts @@ -28,13 +28,17 @@ export type MonacoMarkerDataRequired = { const getExecutionSpacers = ( controlStack: IDESupportedProgramState['controlStack'], ) => - controlStack.map((item) => - typeof item === 'number' - ? EvaluationViewerSpacer.loop - : item - ? EvaluationViewerSpacer.executedConditional - : EvaluationViewerSpacer.skippedConditional, - ); + controlStack + .map((item) => + typeof item === 'object' + ? undefined + : typeof item === 'number' + ? EvaluationViewerSpacer.loop + : item + ? EvaluationViewerSpacer.executedConditional + : EvaluationViewerSpacer.skippedConditional, + ) + .filter((item) => item !== undefined); /** * @param samples a list of samples ordered by their ending position diff --git a/src/editor/script-editor/ScriptEditor.tsx b/src/editor/script-editor/ScriptEditor.tsx index 0e5c628..2edb19e 100644 --- a/src/editor/script-editor/ScriptEditor.tsx +++ b/src/editor/script-editor/ScriptEditor.tsx @@ -824,7 +824,7 @@ export const ScriptEditor = (props: { className="script-tag locking-type-tag" title={lockingTypeDescriptions.standard} > - bare + P2S )} {props.isPushed && scriptType === 'tested' && ( diff --git a/src/header/HeaderBar.tsx b/src/header/HeaderBar.tsx index a1fa108..4a83b68 100644 --- a/src/header/HeaderBar.tsx +++ b/src/header/HeaderBar.tsx @@ -48,7 +48,7 @@ const ideModes: IDESupportedModes[] = [ const vms: IDESupportedVirtualMachine[] = [ { id: 'BCH_2023_05', name: 'BCH 2023 VM', disabled: false }, { id: 'BCH_2025_05', name: 'BCH 2025 VM', disabled: false }, - { id: 'BCH_2026_05', name: 'BCH 2026 VM', disabled: true }, + { id: 'BCH_2026_05', name: 'BCH 2026 VM', disabled: false }, { id: 'BCH_SPEC', name: 'BCH SPEC VM', disabled: false }, { id: 'BTC_2017_08', name: 'BTC 2017 VM', disabled: true }, { id: 'BSV_2020_02', name: 'BSV 2020 VM', disabled: true }, diff --git a/src/state/types.ts b/src/state/types.ts index 2232ce6..51a4daa 100644 --- a/src/state/types.ts +++ b/src/state/types.ts @@ -142,7 +142,7 @@ export type LockingType = WalletTemplateScriptLocking['lockingType']; export const lockingTypes: { label: string; value: LockingType }[] = [ { label: 'P2SH20', value: 'p2sh20' }, { label: 'P2SH32', value: 'p2sh32' }, - { label: 'Bare (non-P2SH)', value: 'standard' }, + { label: 'P2S', value: 'standard' }, ]; export const lockingTypeDescriptions: { @@ -153,7 +153,7 @@ export const lockingTypeDescriptions: { p2sh32: 'This is a P2SH32 script. The P2SH32-wrapping bytecode is automatically included during compilation.', standard: - 'This is a bare (non-P2SH) script: it is compiled directly into the transaction output without P2SH-wrapping bytecode.', + 'This is a P2S script: it is compiled directly into the transaction output without P2SH-wrapping bytecode.', }; export type BaseScriptType = diff --git a/yarn.lock b/yarn.lock index 038beee..f13f346 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3407,7 +3407,7 @@ __metadata: version: 0.0.0-use.local resolution: "bitauth-ide@workspace:." dependencies: - "@bitauth/libauth": "npm:3.1.0-next.2" + "@bitauth/libauth": "npm:3.1.0-next.3" "@blueprintjs/core": "npm:^5.8.2" "@blueprintjs/icons": "npm:^5.7.0" "@blueprintjs/select": "npm:^5.0.23"