Skip to content

Commit 0107cd8

Browse files
committed
Update default VM target to BCH_2026
1 parent 7aeea22 commit 0107cd8

File tree

7 files changed

+28
-19
lines changed

7 files changed

+28
-19
lines changed

packages/cashscript/src/libauth-template/LibauthTemplate.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ import {
2828
Output,
2929
StandardUnlockableUtxo,
3030
Utxo,
31-
VmTarget,
3231
} from '../interfaces.js';
3332
import SignatureTemplate from '../SignatureTemplate.js';
3433
import { addressToLockScript, extendedStringify, zip } from '../utils.js';
3534
import { TransactionBuilder } from '../TransactionBuilder.js';
3635
import { deflate } from 'pako';
3736
import MockNetworkProvider from '../network/MockNetworkProvider.js';
38-
import { addHexPrefixExceptEmpty, formatBytecodeForDebugging, formatParametersForDebugging, getLockScriptName, getSignatureAndPubkeyFromP2PKHInput, getUnlockScriptName, lockingBytecodeIsSetToSlot, serialiseTokenDetails } from './utils.js';
37+
import { addHexPrefixExceptEmpty, DEFAULT_VM_TARGET, formatBytecodeForDebugging, formatParametersForDebugging, getLockScriptName, getSignatureAndPubkeyFromP2PKHInput, getUnlockScriptName, lockingBytecodeIsSetToSlot, serialiseTokenDetails } from './utils.js';
3938

4039
// TODO: Add / improve descriptions throughout the template generation
4140

@@ -50,7 +49,7 @@ export const getLibauthTemplate = (
5049

5150
const vmTarget = transactionBuilder.provider instanceof MockNetworkProvider
5251
? transactionBuilder.provider.vmTarget
53-
: VmTarget.BCH_2025_05;
52+
: DEFAULT_VM_TARGET;
5453

5554
const template: WalletTemplate = {
5655
$schema: 'https://ide.bitauth.com/authentication-template-v0.schema.json',

packages/cashscript/src/libauth-template/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { AbiFunction, AbiInput, Artifact, bytecodeToScript, formatBitAuthScript } from '@cashscript/utils';
2-
import { HashType, LibauthTokenDetails, SignatureAlgorithm, TokenDetails } from '../interfaces.js';
2+
import { HashType, LibauthTokenDetails, SignatureAlgorithm, TokenDetails, VmTarget } from '../interfaces.js';
33
import { hexToBin, binToHex, isHex, decodeCashAddress, type WalletTemplateScenarioBytecode, Input, assertSuccess, decodeAuthenticationInstructions, AuthenticationInstructionPush } from '@bitauth/libauth';
44
import { EncodedFunctionArgument } from '../Argument.js';
55
import { zip } from '../utils.js';
66
import SignatureTemplate from '../SignatureTemplate.js';
77
import { Contract } from '../Contract.js';
88

9+
export const DEFAULT_VM_TARGET = VmTarget.BCH_2026_05;
10+
911
export const getLockScriptName = (contract: Contract): string => {
1012
const result = decodeCashAddress(contract.address);
1113
if (typeof result === 'string') throw new Error(result);

packages/cashscript/src/network/MockNetworkProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { sha256 } from '@cashscript/utils';
33
import { Utxo, Network, VmTarget } from '../interfaces.js';
44
import NetworkProvider from './NetworkProvider.js';
55
import { addressToLockScript, libauthTokenDetailsToCashScriptTokenDetails } from '../utils.js';
6+
import { DEFAULT_VM_TARGET } from '../libauth-template/utils.js';
67

78
export interface MockNetworkProviderOptions {
89
updateUtxoSet: boolean;
@@ -20,7 +21,7 @@ export default class MockNetworkProvider implements NetworkProvider {
2021

2122
constructor(options?: Partial<MockNetworkProviderOptions>) {
2223
this.options = { updateUtxoSet: true, ...options };
23-
this.vmTarget = this.options.vmTarget ?? VmTarget.BCH_2025_05;
24+
this.vmTarget = this.options.vmTarget ?? DEFAULT_VM_TARGET;
2425
}
2526

2627
async getUtxos(address: string): Promise<Utxo[]> {

packages/cashscript/test/debugging.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
artifactTestZeroHandling,
1515
} from './fixture/debugging/debugging_contracts.js';
1616
import { sha256 } from '@cashscript/utils';
17+
import { DEFAULT_VM_TARGET } from 'cashscript/src/libauth-template/utils.js';
1718

1819
describe('Debugging tests', () => {
1920
describe('console.log statements', () => {
@@ -670,7 +671,7 @@ describe('Debugging tests', () => {
670671
.addInput(contractUtxo, contractTestLogs.unlock.transfer(new SignatureTemplate(alicePriv), 1000n))
671672
.addOutput({ to: contractTestLogs.address, amount: 10000n });
672673

673-
expect(transaction.getLibauthTemplate().supported[0]).toBe(vmTarget ?? 'BCH_2025_05');
674+
expect(transaction.getLibauthTemplate().supported[0]).toBe(vmTarget ?? DEFAULT_VM_TARGET);
674675

675676
const expectedLog = new RegExp(`^\\[Input #0] Test.cash:10 0x[0-9a-f]{130} 0x${binToHex(alicePub)} 1000 0xbeef 1 test true$`);
676677
expect(transaction).toLog(expectedLog);

packages/cashscript/test/fixture/libauth-template/fixtures.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const fixtures: Fixture[] = [
3333
'description': 'Imported from cashscript',
3434
'name': 'CashScript Generated Debugging Template',
3535
'supported': [
36-
'BCH_2025_05',
36+
'BCH_2026_05',
3737
],
3838
'version': 0,
3939
'entities': {
@@ -165,7 +165,7 @@ export const fixtures: Fixture[] = [
165165
'description': 'Imported from cashscript',
166166
'name': 'CashScript Generated Debugging Template',
167167
'supported': [
168-
'BCH_2025_05',
168+
'BCH_2026_05',
169169
],
170170
'version': 0,
171171
'entities': {
@@ -301,7 +301,7 @@ export const fixtures: Fixture[] = [
301301
'description': 'Imported from cashscript',
302302
'name': 'CashScript Generated Debugging Template',
303303
'supported': [
304-
'BCH_2025_05',
304+
'BCH_2026_05',
305305
],
306306
'version': 0,
307307
'entities': {
@@ -435,7 +435,7 @@ export const fixtures: Fixture[] = [
435435
'description': 'Imported from cashscript',
436436
'name': 'CashScript Generated Debugging Template',
437437
'supported': [
438-
'BCH_2025_05',
438+
'BCH_2026_05',
439439
],
440440
'version': 0,
441441
'entities': {
@@ -716,7 +716,7 @@ export const fixtures: Fixture[] = [
716716
'description': 'Imported from cashscript',
717717
'name': 'CashScript Generated Debugging Template',
718718
'supported': [
719-
'BCH_2025_05',
719+
'BCH_2026_05',
720720
],
721721
'version': 0,
722722
'entities': {
@@ -838,7 +838,7 @@ export const fixtures: Fixture[] = [
838838
'description': 'Imported from cashscript',
839839
'name': 'CashScript Generated Debugging Template',
840840
'supported': [
841-
'BCH_2025_05',
841+
'BCH_2026_05',
842842
],
843843
'version': 0,
844844
'entities': {
@@ -1139,7 +1139,7 @@ export const fixtures: Fixture[] = [
11391139
'description': 'Imported from cashscript',
11401140
'name': 'CashScript Generated Debugging Template',
11411141
'supported': [
1142-
'BCH_2025_05',
1142+
'BCH_2026_05',
11431143
],
11441144
'version': 0,
11451145
'entities': {
@@ -1316,7 +1316,7 @@ export const fixtures: Fixture[] = [
13161316
'description': 'Imported from cashscript',
13171317
'name': 'CashScript Generated Debugging Template',
13181318
'supported': [
1319-
'BCH_2025_05',
1319+
'BCH_2026_05',
13201320
],
13211321
'version': 0,
13221322
'entities': {

packages/cashscript/test/fixture/libauth-template/multi-contract-fixtures.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const fixtures: Fixture[] = [
6363
'description': 'Imported from cashscript',
6464
'name': 'CashScript Generated Debugging Template',
6565
'supported': [
66-
'BCH_2025_05',
66+
'BCH_2026_05',
6767
],
6868
'version': 0,
6969
'entities': {
@@ -2084,7 +2084,7 @@ export const fixtures: Fixture[] = [
20842084
'description': 'Imported from cashscript',
20852085
'name': 'CashScript Generated Debugging Template',
20862086
'supported': [
2087-
'BCH_2025_05',
2087+
'BCH_2026_05',
20882088
],
20892089
'version': 0,
20902090
'entities': {
@@ -2203,7 +2203,7 @@ export const fixtures: Fixture[] = [
22032203
'description': 'Imported from cashscript',
22042204
'name': 'CashScript Generated Debugging Template',
22052205
'supported': [
2206-
'BCH_2025_05',
2206+
'BCH_2026_05',
22072207
],
22082208
'version': 0,
22092209
'entities': {
@@ -2531,7 +2531,7 @@ export const fixtures: Fixture[] = [
25312531
'description': 'Imported from cashscript',
25322532
'name': 'CashScript Generated Debugging Template',
25332533
'supported': [
2534-
'BCH_2025_05',
2534+
'BCH_2026_05',
25352535
],
25362536
'version': 0,
25372537
'entities': {
@@ -3366,7 +3366,7 @@ export const fixtures: Fixture[] = [
33663366
'description': 'Imported from cashscript',
33673367
'name': 'CashScript Generated Debugging Template',
33683368
'supported': [
3369-
'BCH_2025_05',
3369+
'BCH_2026_05',
33703370
],
33713371
'version': 0,
33723372
'entities': {

website/docs/releases/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
title: Release Notes
33
---
44

5+
## v0.13.0-next.0
6+
7+
#### CashScript SDK
8+
9+
- :hammer_and_wrench: Update default VM target to `BCH_2026_05`.
10+
511
## v0.12.0
612

713
#### CashScript SDK

0 commit comments

Comments
 (0)