Skip to content

Commit

Permalink
Add P2S and OP_EVAL support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Dec 13, 2024
1 parent 40c56a7 commit 4477d06
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion libauth
Submodule libauth updated 102 files
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 14 additions & 7 deletions src/cash-assembly/editor-tooling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ export type MonacoMarkerDataRequired = {
endColumn: number;
};

const isNotUndefined = <T>(value: T | undefined): value is T => {
return value !== undefined;
};
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(isNotUndefined);

/**
* @param samples a list of samples ordered by their ending position
Expand Down
2 changes: 1 addition & 1 deletion src/editor/script-editor/ScriptEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ export const ScriptEditor = (props: {
className="script-tag locking-type-tag"
title={lockingTypeDescriptions.standard}
>
bare
P2S
</span>
)}
{props.isPushed && scriptType === 'tested' && (
Expand Down
2 changes: 1 addition & 1 deletion src/header/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
4 changes: 2 additions & 2 deletions src/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4477d06

Please sign in to comment.