Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
- name: Install Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2025-04-01
profile: minimal
components: rustc
- name: Install packages
run: yarn install --frozen-lockfile && rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
run: yarn install --frozen-lockfile && rustup component add --toolchain nightly-2025-04-01-x86_64-unknown-linux-gnu rustfmt
- name: Lint js
shell: bash
run: yarn lint-js
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Install Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly-2025-04-01
profile: minimal
components: rustc
- name: Cache Cargo dependencies
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,25 @@
"lint": "yarn lint-solidity && yarn lint-js && yarn lint-rust",
"lint-solidity": "yarn solhint ./contracts/**/*.sol",
"lint-js": "yarn prettier --list-different **/*.js **/*.ts",
"lint-rust": "cargo +nightly fmt --all -- --check && cargo clippy",
"lint-fix": "yarn prettier --write **/*.js **/*.ts ./programs/**/*.rs ./contracts**/*.sol && cargo +nightly fmt --all && cargo clippy",
"lint-rust": "cargo +nightly-2025-04-01 fmt --all -- --check && cargo clippy",
"lint-fix": "yarn prettier --write **/*.js **/*.ts ./programs/**/*.rs ./contracts**/*.sol && cargo +nightly-2025-04-01 fmt --all && cargo clippy",
"clean-fast": "for dir in node_modules cache cache-zk artifacts artifacts-zk dist typechain; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" &; done",
"clean": "rm -rf node_modules cache cache-zk artifacts artifacts-zk dist typechain",
"generate-svm-assets": "sh ./scripts/generate-svm-assets.sh && yarn generate-svm-clients",
"generate-svm-clients": "yarn ts-node ./scripts/svm/utils/generate-svm-clients.ts && yarn ts-node ./scripts/svm/utils/rename-clients-imports.ts",
"build-evm": "hardhat compile",
"build-svm": "echo 'Generating IDLs...' && anchor build > /dev/null 2>&1 || true && anchor run generateExternalTypes && anchor build",
"build-svm": "echo 'Generating IDLs...' && yarn anchor-build > /dev/null 2>&1 || true && anchor run generateExternalTypes && yarn anchor-build",
"build-ts": "rm -rf ./dist && tsc && rsync -a --include '*/' --include '*.d.ts' --exclude '*' ./typechain ./dist/",
"copy-idl": "mkdir -p dist/src/svm/assets/idl && cp src/svm/assets/idl/*.json dist/src/svm/assets/idl/",
"build": "yarn build-evm && yarn build-svm && yarn generate-svm-assets && yarn build-ts && yarn copy-idl",
"test-evm": "IS_TEST=true hardhat test",
"test-svm": "anchor test -- --features test",
"test-svm": "sh ./scripts/anchor-test.sh",
"test": "yarn test-evm && yarn test-svm",
"test:report-gas": "IS_TEST=true REPORT_GAS=true hardhat test",
"generate-evm-assets": "rm -rf typechain && TYPECHAIN=ethers yarn hardhat typechain",
"prepublish": "yarn build && hardhat export --export-all ./cache/massExport.json && ts-node ./scripts/processHardhatExport.ts && prettier --write ./deployments/deployments.json && yarn generate-evm-assets",
"pre-commit-hook": "sh scripts/preCommitHook.sh"
"pre-commit-hook": "sh scripts/preCommitHook.sh",
"anchor-build": "sh ./scripts/anchor-build.sh"
},
"dependencies": {
"@across-protocol/constants": "^3.1.46",
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2025-04-01"
16 changes: 16 additions & 0 deletions scripts/anchor-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

echo "🔨 Building anchor programs (no IDL)..."
anchor build --no-idl

echo "📦 Generating IDLs (using nightly)..."

for program in programs/*; do
[ -d "$program" ] || continue

dir_name=$(basename "$program")
program_name=$(echo "$dir_name" | tr '-' '_')

echo "→ IDL for $program_name"
RUSTUP_TOOLCHAIN="nightly-2025-04-01" anchor idl build -p "$dir_name" -o "target/idl/$program_name.json" -t "target/types/$program_name.ts"
done
19 changes: 19 additions & 0 deletions scripts/anchor-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

echo "🔨 Building anchor programs (with test feature, no IDL)..."
anchor build --no-idl -- --features test

echo "📦 Generating IDLs (using nightly)..."

for program in programs/*; do
[ -d "$program" ] || continue

dir_name=$(basename "$program")
program_name=$(echo "$dir_name" | tr '-' '_')

echo "→ IDL for $program_name"
RUSTUP_TOOLCHAIN="nightly-2025-04-01" anchor idl build -p "$dir_name" -o "target/idl/$program_name.json" -t "target/types/$program_name.ts"
done

echo "🧪 Running anchor tests..."
anchor test --skip-build
Loading