Skip to content

Commit dfd7df5

Browse files
chore: v0.1.1 for token-interface (#2367)
1 parent 8ddf06b commit dfd7df5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+12268
-79
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- "*"
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
- ready_for_review
13+
14+
name: js-token-interface-v2
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
token-interface-js-v2:
25+
name: token-interface-js-v2
26+
if: github.event.pull_request.draft == false
27+
runs-on: ubuntu-latest
28+
29+
services:
30+
redis:
31+
image: redis:8.0.1
32+
ports:
33+
- 6379:6379
34+
options: >-
35+
--health-cmd "redis-cli ping"
36+
--health-interval 10s
37+
--health-timeout 5s
38+
--health-retries 5
39+
40+
env:
41+
LIGHT_PROTOCOL_VERSION: V2
42+
REDIS_URL: redis://localhost:6379
43+
CI: true
44+
45+
steps:
46+
- name: Checkout sources
47+
uses: actions/checkout@v6
48+
with:
49+
submodules: true
50+
51+
- name: Setup and build
52+
uses: ./.github/actions/setup-and-build
53+
with:
54+
skip-components: "redis,disk-cleanup,go"
55+
cache-key: "js"
56+
57+
- name: Build token-interface with V2
58+
run: |
59+
cd js/token-interface
60+
pnpm build:v2
61+
62+
- name: Build CLI
63+
run: |
64+
just cli build
65+
66+
- name: Run token-interface unit tests with V2
67+
run: |
68+
echo "Running token-interface unit tests with retry logic (max 2 attempts)..."
69+
attempt=1
70+
max_attempts=2
71+
until just js test-token-interface-unit-v2; do
72+
attempt=$((attempt + 1))
73+
if [ $attempt -gt $max_attempts ]; then
74+
echo "Tests failed after $max_attempts attempts"
75+
exit 1
76+
fi
77+
echo "Attempt $attempt/$max_attempts failed, retrying..."
78+
sleep 5
79+
done
80+
echo "Tests passed on attempt $attempt"
81+
82+
- name: Run token-interface e2e tests with V2
83+
run: |
84+
echo "Running token-interface e2e tests with retry logic (max 2 attempts)..."
85+
attempt=1
86+
max_attempts=2
87+
until just js test-token-interface-e2e-v2; do
88+
attempt=$((attempt + 1))
89+
if [ $attempt -gt $max_attempts ]; then
90+
echo "Tests failed after $max_attempts attempts"
91+
exit 1
92+
fi
93+
echo "Attempt $attempt/$max_attempts failed, retrying..."
94+
sleep 5
95+
done
96+
echo "Tests passed on attempt $attempt"
97+
98+
- name: Display prover logs on failure
99+
if: failure()
100+
run: |
101+
echo "=== Displaying prover logs ==="
102+
find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ api-docs/
6666
# Third-party dependencies
6767
/.local
6868
/.vscode
69+
.cursor/
6970

7071
**/.idea
7172
**/*.iml

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightprotocol/zk-compression-cli",
3-
"version": "0.28.1",
3+
"version": "0.28.3",
44
"description": "ZK Compression: Secure Scaling on Solana",
55
"maintainers": [
66
{

js/compressed-token/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightprotocol/compressed-token",
3-
"version": "0.23.1",
3+
"version": "0.23.3",
44
"description": "JS client to interact with the compressed-token program",
55
"sideEffects": false,
66
"main": "dist/cjs/node/index.cjs",

js/compressed-token/src/v3/instructions/unwrap.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export function createUnwrapInstruction(
7777
const SOURCE_INDEX = 2;
7878
const DESTINATION_INDEX = 3;
7979
const POOL_INDEX = 4;
80-
const _SPL_TOKEN_PROGRAM_INDEX = 5;
8180
const LIGHT_TOKEN_PROGRAM_INDEX = 6;
8281

8382
// Unwrap flow: compress from light-token, decompress to SPL

js/compressed-token/src/v3/instructions/wrap.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function createWrapInstruction(
4646
const SOURCE_INDEX = 2;
4747
const DESTINATION_INDEX = 3;
4848
const POOL_INDEX = 4;
49-
const _SPL_TOKEN_PROGRAM_INDEX = 5;
5049
const LIGHT_TOKEN_PROGRAM_INDEX = 6;
5150

5251
const compressions: Compression[] = [

js/compressed-token/tests/e2e/approve-revoke-light-token.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,9 @@ describe('LightToken approve/revoke - E2E', () => {
485485
const { blockhash } = await rpc.getLatestBlockhash();
486486
const tx = buildAndSignTx([ix], payer, blockhash, [wrongSigner]);
487487

488-
await expect(sendAndConfirmTx(rpc, tx)).rejects.toThrow();
488+
await expect(sendAndConfirmTx(rpc, tx)).rejects.toThrow(
489+
/owner|authority|custom program error|instruction error/i,
490+
);
489491
}, 60_000);
490492

491493
it('should work with separate fee payer', async () => {

js/compressed-token/tests/e2e/transfer-delegated-failures.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('transferDelegatedInterface - failure cases', () => {
9595
undefined,
9696
undefined,
9797
),
98-
).rejects.toThrow();
98+
).rejects.toThrow(/Insufficient delegated balance/);
9999
}, 30_000);
100100

101101
it('rejects transfer from unapproved signer', async () => {
@@ -112,7 +112,7 @@ describe('transferDelegatedInterface - failure cases', () => {
112112
undefined,
113113
undefined,
114114
),
115-
).rejects.toThrow();
115+
).rejects.toThrow(/Signer is not the owner or a delegate/);
116116
}, 30_000);
117117

118118
it('rejects transfer after revoke', async () => {
@@ -132,6 +132,6 @@ describe('transferDelegatedInterface - failure cases', () => {
132132
undefined,
133133
undefined,
134134
),
135-
).rejects.toThrow();
135+
).rejects.toThrow(/Signer is not the owner or a delegate/);
136136
}, 60_000);
137137
});

js/justfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,34 @@ default:
66
build:
77
cd stateless.js && pnpm build
88
cd compressed-token && pnpm build
9+
cd token-interface && pnpm build
910

10-
test: test-stateless test-compressed-token
11+
test: test-stateless test-compressed-token test-token-interface
1112

1213
test-stateless:
1314
cd stateless.js && pnpm test
1415

1516
test-compressed-token:
1617
cd compressed-token && pnpm test
1718

19+
test-token-interface:
20+
cd token-interface && pnpm test
21+
22+
test-token-interface-unit-v2:
23+
cd token-interface && pnpm test:unit:all
24+
25+
test-token-interface-e2e-v2:
26+
cd token-interface && pnpm test:e2e:all
27+
1828
test-compressed-token-unit-v2:
1929
cd compressed-token && pnpm test:unit:all:v2
2030

2131
lint:
2232
cd stateless.js && pnpm lint
2333
cd compressed-token && pnpm lint
34+
cd token-interface && pnpm lint
2435

2536
format:
2637
cd stateless.js && pnpm format
2738
cd compressed-token && pnpm format
39+
cd token-interface && pnpm format

js/stateless.js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightprotocol/stateless.js",
3-
"version": "0.23.1",
3+
"version": "0.23.3",
44
"description": "JavaScript API for Light & ZK Compression",
55
"sideEffects": false,
66
"main": "dist/cjs/node/index.cjs",

0 commit comments

Comments
 (0)