cashscript 0.10.2 → 0.11.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/debugging.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthenticationErrorCommon, binToHex, createCompiler, createVirtualMachineBCH2023, encodeAuthenticationInstruction, walletTemplateToCompilerConfiguration } from '@bitauth/libauth';
1
+ import { AuthenticationErrorCommon, binToHex, createCompiler, createVirtualMachineBch2025, encodeAuthenticationInstruction, walletTemplateToCompilerConfiguration } from '@bitauth/libauth';
2
2
  import { Op, PrimitiveType, bytecodeToAsm, decodeBool, decodeInt, decodeString } from '@cashscript/utils';
3
3
  import { findLastIndex, toRegExp } from './utils.js';
4
4
  import { FailedRequireError, FailedTransactionError, FailedTransactionEvaluationError } from './Errors.js';
@@ -39,7 +39,7 @@ export const debugTemplate = (template, artifact) => {
39
39
  // preceding OP_CHECKSIG opcode. The error message is registered in the next instruction, so we need to increment
40
40
  // the instruction pointer to get the correct error message from the require messages in the artifact.
41
41
  // Note that we do NOT use this adjusted IP when passing the failing IP into the FailedRequireError
42
- const isNullFail = lastExecutedDebugStep.error === AuthenticationErrorCommon.nonNullSignatureFailure;
42
+ const isNullFail = lastExecutedDebugStep.error.includes(AuthenticationErrorCommon.nonNullSignatureFailure);
43
43
  const requireStatementIp = failingIp + (isNullFail ? 1 : 0);
44
44
  const requireStatement = (artifact.debug?.requires ?? [])
45
45
  .find((statement) => statement.ip === requireStatementIp);
@@ -74,7 +74,7 @@ export const debugTemplate = (template, artifact) => {
74
74
  // internal util. instantiates the virtual machine and compiles the template into a program
75
75
  const createProgram = (template) => {
76
76
  const configuration = walletTemplateToCompilerConfiguration(template);
77
- const vm = createVirtualMachineBCH2023();
77
+ const vm = createVirtualMachineBch2025();
78
78
  const compiler = createCompiler(configuration);
79
79
  const scenarioGeneration = compiler.generateScenario({
80
80
  debug: true,
@@ -121,8 +121,9 @@ const failedFinalVerify = (evaluationResult) => {
121
121
  // If any of the following errors occurred, then the final verify failed - any other messages
122
122
  // indicate other kinds of failures
123
123
  return toRegExp([
124
- AuthenticationErrorCommon.requiresCleanStack,
125
- AuthenticationErrorCommon.nonEmptyControlStack,
124
+ // TODO: Ask Jason to put these back into an enum and replace with the enum value
125
+ 'The CashAssembly internal evaluation completed with an unexpected number of items on the stack (must be exactly 1).', // AuthenticationErrorCommon.requiresCleanStack,
126
+ 'The CashAssembly internal evaluation completed with a non-empty control stack.', // AuthenticationErrorCommon.nonEmptyControlStack,
126
127
  AuthenticationErrorCommon.unsuccessfulEvaluation,
127
128
  ]).test(evaluationResult);
128
129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cashscript",
3
- "version": "0.10.2",
3
+ "version": "0.11.0-next.0",
4
4
  "description": "Easily write and interact with Bitcoin Cash contracts",
5
5
  "keywords": [
6
6
  "bitcoin cash",
@@ -43,8 +43,8 @@
43
43
  "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest"
44
44
  },
45
45
  "dependencies": {
46
- "@bitauth/libauth": "^3.0.0",
47
- "@cashscript/utils": "^0.10.2",
46
+ "@bitauth/libauth": "^3.1.0-next.2",
47
+ "@cashscript/utils": "^0.11.0-next.0",
48
48
  "@mr-zwets/bchn-api-wrapper": "^1.0.1",
49
49
  "delay": "^5.0.0",
50
50
  "electrum-cash": "^2.0.10",
@@ -59,5 +59,5 @@
59
59
  "jest": "^29.4.1",
60
60
  "typescript": "^5.5.4"
61
61
  },
62
- "gitHead": "a7c4f652462ddfccd54fc929f06cb16022769df9"
62
+ "gitHead": "18df35aa3276e64fa64e92386106374d1d35b28d"
63
63
  }