Skip to content

Commit cab9173

Browse files
add starknet tests
1 parent 7ddc924 commit cab9173

7 files changed

Lines changed: 13045 additions & 12542 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Starknet Tests
2+
3+
on:
4+
push:
5+
branches: [ dev ]
6+
paths:
7+
- 'chains/starknet/**'
8+
pull_request:
9+
branches: [ dev ]
10+
paths:
11+
- 'chains/starknet/**'
12+
13+
jobs:
14+
run-starknet-tests:
15+
name: Run Starknet Tests
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 24
26+
27+
- name: Install Dependencies
28+
working-directory: chains/starknet/tests
29+
run: |
30+
rm -f package-lock.json
31+
npm install
32+
npm install typescript ts-node @types/node starknet
33+
34+
- name: Install Starkli CLI via starkliup
35+
run: |
36+
curl -fsSL https://get.starkli.sh | sh
37+
source "$HOME/.config/.starkli/env"
38+
starkliup
39+
echo "$HOME/.starkli/bin" >> $GITHUB_PATH
40+
41+
- name: Install Dojo (Katana)
42+
working-directory: chains/starknet/tests
43+
run: |
44+
curl -L https://install.dojoengine.org | bash
45+
source "$HOME/.config/.dojo/env"
46+
dojoup install 1.4.2
47+
echo "$HOME/.config/.dojo/bin" >> $GITHUB_PATH
48+
49+
- name: Install Scarb
50+
run: |
51+
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 2.9.4
52+
echo "$HOME/.scarb/bin" >> $GITHUB_PATH
53+
54+
- name: Add tools to PATH
55+
run: |
56+
echo "/home/runner/.config/.starkli/bin" >> $GITHUB_PATH
57+
echo "/home/runner/.local/bin" >> $GITHUB_PATH
58+
59+
- name: Verify installations
60+
working-directory: chains/starknet/tests
61+
run: |
62+
starkli --version
63+
scarb --version
64+
katana --version
65+
66+
- name: Run Katana
67+
working-directory: chains/starknet/tests
68+
run: |
69+
export PATH="$HOME/.config/.dojo/bin:$PATH"
70+
RUNNER_TRACKING_ID="" katana --dev --dev.no-fee &
71+
sleep 10
72+
curl http://127.0.0.1:5050
73+
74+
- name: Compile Starknet Contracts
75+
working-directory: chains/starknet/tests
76+
run: |
77+
npm run build
78+
79+
- name: Run Starknet Tests
80+
working-directory: chains/starknet/tests
81+
run: |
82+
npx ts-node starknet_tests.ts

chains/starknet/Scarb.lock

Lines changed: 55 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,157 +3,149 @@ version = 1
33

44
[[package]]
55
name = "alexandria_bytes"
6-
version = "0.1.0"
7-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
6+
version = "0.3.0"
7+
source = "registry+https://scarbs.xyz/"
8+
checksum = "sha256:be5d95de2b9b05a029b2539aa8bb39560374705652ee0a69e01397f6ef1a7d1a"
89
dependencies = [
910
"alexandria_data_structures",
1011
"alexandria_math",
1112
]
1213

1314
[[package]]
1415
name = "alexandria_data_structures"
15-
version = "0.2.0"
16-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
17-
dependencies = [
18-
"alexandria_encoding",
19-
]
20-
21-
[[package]]
22-
name = "alexandria_encoding"
23-
version = "0.1.0"
24-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
25-
dependencies = [
26-
"alexandria_bytes",
27-
"alexandria_math",
28-
"alexandria_numeric",
29-
]
16+
version = "0.3.0"
17+
source = "registry+https://scarbs.xyz/"
18+
checksum = "sha256:fca0cd0349fabef5d62e7b02d09332679c531058bf53f9be165bf0e832c62765"
3019

3120
[[package]]
3221
name = "alexandria_math"
33-
version = "0.2.0"
34-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
35-
dependencies = [
36-
"alexandria_data_structures",
37-
]
38-
39-
[[package]]
40-
name = "alexandria_numeric"
41-
version = "0.1.0"
42-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
43-
dependencies = [
44-
"alexandria_math",
45-
"alexandria_searching",
46-
]
47-
48-
[[package]]
49-
name = "alexandria_searching"
50-
version = "0.1.0"
51-
source = "git+https://github.com/keep-starknet-strange/alexandria.git#617087bbd80baeea4268bc56cf26e704f6b67a9f"
52-
dependencies = [
53-
"alexandria_data_structures",
54-
]
22+
version = "0.3.0"
23+
source = "registry+https://scarbs.xyz/"
24+
checksum = "sha256:9659d9bbe0f0713366abb479c3a0d182dc560d15355bfca1ac4ef25076b2d8b4"
5525

5626
[[package]]
5727
name = "openzeppelin"
58-
version = "0.16.0"
28+
version = "1.0.0"
5929
source = "registry+https://scarbs.xyz/"
60-
checksum = "sha256:5dc87a71f0f5d045e02e5bc5ea7a9b0360bbbc3f388b846006280d266feac192"
30+
checksum = "sha256:320185f3e17cf9fafda88b1ce490f5eaed0bfcc273036b56cd22ce4fb8de628f"
6131
dependencies = [
32+
"openzeppelin_access",
33+
"openzeppelin_account",
34+
"openzeppelin_finance",
35+
"openzeppelin_governance",
36+
"openzeppelin_introspection",
6237
"openzeppelin_merkle_tree",
6338
"openzeppelin_presets",
6439
"openzeppelin_security",
6540
"openzeppelin_token",
6641
"openzeppelin_upgrades",
42+
"openzeppelin_utils",
6743
]
6844

6945
[[package]]
7046
name = "openzeppelin_access"
71-
version = "0.16.0"
47+
version = "1.0.0"
7248
source = "registry+https://scarbs.xyz/"
73-
checksum = "sha256:b9139449e53d715992b2d9e887c0c723d886419bee7ceb5561648c70bd6d3174"
49+
checksum = "sha256:a39a4ea1582916c637bf7e3aee0832c3fe1ea3a3e39191955e8dc39d08327f9b"
7450
dependencies = [
7551
"openzeppelin_introspection",
7652
"openzeppelin_utils",
7753
]
7854

7955
[[package]]
8056
name = "openzeppelin_account"
81-
version = "0.16.0"
57+
version = "1.0.0"
8258
source = "registry+https://scarbs.xyz/"
83-
checksum = "sha256:841bb881adbe98b64fee1dc1329f6e3fbabdfbd9fa65c66ffb54c55f13764bce"
59+
checksum = "sha256:7e943a2de32ddca4d48e467e52790e380ab1f49c4daddbbbc4634dd930d0243f"
8460
dependencies = [
8561
"openzeppelin_introspection",
8662
"openzeppelin_utils",
8763
]
8864

65+
[[package]]
66+
name = "openzeppelin_finance"
67+
version = "1.0.0"
68+
source = "registry+https://scarbs.xyz/"
69+
checksum = "sha256:9fa9e91d39b6ccdfa31eef32fdc087cd06c0269cc9c6b86e32d57f5a6997d98b"
70+
dependencies = [
71+
"openzeppelin_access",
72+
"openzeppelin_token",
73+
]
74+
8975
[[package]]
9076
name = "openzeppelin_governance"
91-
version = "0.16.0"
77+
version = "1.0.0"
9278
source = "registry+https://scarbs.xyz/"
93-
checksum = "sha256:a9d9c983cfd4369e7bbb69433fb264edf376805ed873b1f70a287825a6bd1eaf"
79+
checksum = "sha256:c05add2974b3193c3a5c022b9586a84cf98c5970cdb884dcf201c77dbe359f55"
9480
dependencies = [
9581
"openzeppelin_access",
82+
"openzeppelin_account",
9683
"openzeppelin_introspection",
84+
"openzeppelin_token",
85+
"openzeppelin_utils",
9786
]
9887

9988
[[package]]
10089
name = "openzeppelin_introspection"
101-
version = "0.16.0"
90+
version = "1.0.0"
10291
source = "registry+https://scarbs.xyz/"
103-
checksum = "sha256:312bc2e531f036480ad7392dbb31042c38d875ef9dbb5578ea8de5c05e35b7d8"
92+
checksum = "sha256:34e088ecf19e0b3012481a29f1fbb20e600540cb9a5db1c3002a97ebb7f5a32a"
10493

10594
[[package]]
10695
name = "openzeppelin_merkle_tree"
107-
version = "0.16.0"
96+
version = "1.0.0"
10897
source = "registry+https://scarbs.xyz/"
109-
checksum = "sha256:8e264c8d5f0591262a235a445b8ca78dd5580c251707b218b829b6b4d6f84a34"
98+
checksum = "sha256:a5341705514a3d9beeeb39cf11464111f7355be621639740d2c5006786aa63dc"
11099

111100
[[package]]
112101
name = "openzeppelin_presets"
113-
version = "0.16.0"
102+
version = "1.0.0"
114103
source = "registry+https://scarbs.xyz/"
115-
checksum = "sha256:7bc9db7563e434535ebd06c7598ba0f8494e791c5f80401389b356a3ebd65a08"
104+
checksum = "sha256:4eb098e2ee3ac0e67b6828115a7de62f781418beab767d4e80b54e176808369d"
116105
dependencies = [
117106
"openzeppelin_access",
118107
"openzeppelin_account",
108+
"openzeppelin_finance",
119109
"openzeppelin_introspection",
120110
"openzeppelin_token",
121111
"openzeppelin_upgrades",
112+
"openzeppelin_utils",
122113
]
123114

124115
[[package]]
125116
name = "openzeppelin_security"
126-
version = "0.16.0"
117+
version = "1.0.0"
127118
source = "registry+https://scarbs.xyz/"
128-
checksum = "sha256:b7497f5e55c6d9f1d7606ad0d12719e3c04765e266fb91fb72740e0af41d03f3"
119+
checksum = "sha256:1deb811a239c4f9cc28fc302039e2ffcb19911698a8c612487207448d70d2e6e"
129120

130121
[[package]]
131122
name = "openzeppelin_token"
132-
version = "0.16.0"
123+
version = "1.0.0"
133124
source = "registry+https://scarbs.xyz/"
134-
checksum = "sha256:7074c23fbc300b3cccff1037264dfdbe976fb11ae42ce687f4a8ce469adc552a"
125+
checksum = "sha256:33fcb84a1a76d2d3fff9302094ff564f78d45b743548fd7568c130b272473f66"
135126
dependencies = [
127+
"openzeppelin_access",
136128
"openzeppelin_account",
137-
"openzeppelin_governance",
138129
"openzeppelin_introspection",
130+
"openzeppelin_utils",
139131
]
140132

141133
[[package]]
142134
name = "openzeppelin_upgrades"
143-
version = "0.16.0"
135+
version = "1.0.0"
144136
source = "registry+https://scarbs.xyz/"
145-
checksum = "sha256:4de95a7fb8955e63711f34bb954676f6cef127b44b570c0535d7781297821b44"
137+
checksum = "sha256:36f7a03e7e7111577916aacf31f88ad0053de20f33ee10b0ab3804849c3aa373"
146138

147139
[[package]]
148140
name = "openzeppelin_utils"
149-
version = "0.16.0"
141+
version = "1.0.0"
150142
source = "registry+https://scarbs.xyz/"
151-
checksum = "sha256:a494aeb5f1371db7f22e922196aa41d1d1698877a766a838350c0b6ffe49fda2"
143+
checksum = "sha256:fd348b31c4a4407add33adc3c2b8f26dca71dbd7431faaf726168f37a91db0c1"
152144

153145
[[package]]
154146
name = "train_protocol"
155147
version = "0.1.0"
156148
dependencies = [
157-
"alexandria_math",
149+
"alexandria_bytes",
158150
"openzeppelin",
159151
]

chains/starknet/Scarb.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ edition = "2023_11"
66
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
77

88
[dependencies]
9-
starknet = ">=2.11.0"
9+
starknet = ">=2.9.4"
1010
openzeppelin = "1.0.0"
11-
alexandria_bytes = "0.5.0"
11+
alexandria_bytes = "0.3.0"
1212
# snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.20.1" }
1313

1414
[[target.starknet-contract]]

0 commit comments

Comments
 (0)