Skip to content

Commit 6ab4457

Browse files
authored
feat: add lazer contracts and sdks (#2119)
* feat: add lazer contracts and sdks * forge install: forge-std v1.9.4 * forge install: openzeppelin-contracts-upgradeable v5.1.0 * chore: add CIs for lazer
1 parent 572bb8a commit 6ab4457

Some content is hidden

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

57 files changed

+11810
-99
lines changed

.github/workflows/ci-lazer-rust.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Lazer Rust Test Suite"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- lazer/**
8+
pull_request:
9+
paths:
10+
- lazer/**
11+
12+
jobs:
13+
lazer-rust-test-suite:
14+
name: Lazer Rust Test Suite
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: lazer
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
24+
with:
25+
toolchain: 1.81.0
26+
- name: Install Foundry
27+
uses: foundry-rs/foundry-toolchain@v1
28+
- name: install extra tools
29+
run: |
30+
cargo install --locked [email protected]
31+
sudo apt-get install -y protobuf-compiler
32+
- name: Install Solana Cli
33+
run: |
34+
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
35+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
36+
- name: check Cargo.toml formatting
37+
run: find . -name Cargo.toml -exec taplo fmt --check --diff {} \;
38+
- name: Build Solana programs
39+
run: cargo build-sbf
40+
- name: test
41+
run: cargo test
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Lazer EVM Test Suite"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- lazer/contracts/evm/**
8+
pull_request:
9+
paths:
10+
- lazer/contracts/evm/**
11+
12+
jobs:
13+
lazer-evm-test-suite:
14+
name: Lazer EVM Test Suite
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: lazer/contracts/evm
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
- name: Install Foundry
24+
uses: foundry-rs/foundry-toolchain@v1
25+
- name: Check build
26+
run: forge build --sizes
27+
- name: Run tests
28+
run: forge test -vvv

.github/workflows/ci-lazer-sdk-js.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Lazer JS SDK Test Suite"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- lazer/sdk/js/**
8+
pull_request:
9+
paths:
10+
- lazer/sdk/js/**
11+
12+
jobs:
13+
lazer-js-sdk-test-suite:
14+
name: Lazer JS SDK Test Suite
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: lazer/sdk/js
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.18.0
24+
- run: npm install --global [email protected]
25+
- run: pnpm install --frozen-lockfile
26+
- run: pnpm run test
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Lazer Solana contract test"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- lazer/**
8+
pull_request:
9+
paths:
10+
- lazer/**
11+
12+
jobs:
13+
lazer-solana-contract-test:
14+
name: Lazer Solana contract test
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: lazer/contracts/solana
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions-rust-lang/setup-rust-toolchain@v1
22+
with:
23+
toolchain: 1.81.0
24+
- name: install taplo
25+
run: cargo install --locked [email protected]
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20.18.0
29+
- name: Install Solana Cli
30+
run: |
31+
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
32+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
33+
- name: Set Solana Cli version
34+
run: agave-install init 1.18.26
35+
- name: Create Solana key
36+
run: solana-keygen new --no-bip39-passphrase
37+
- name: Install Anchor
38+
run: RUSTFLAGS= cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.1 anchor-cli
39+
- name: Install pnpm
40+
run: npm install --global [email protected]
41+
- name: Install test dependencies
42+
run: pnpm install --frozen-lockfile
43+
- name: Run tests
44+
run: pnpm run test

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "lazer/contracts/evm/lib/forge-std"]
2+
path = lazer/contracts/evm/lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std
4+
[submodule "lazer/contracts/evm/lib/openzeppelin-contracts-upgradeable"]
5+
path = lazer/contracts/evm/lib/openzeppelin-contracts-upgradeable
6+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,16 @@ repos:
150150
files: express_relay/sdk/python/express_relay
151151
exclude: express_relay/sdk/python/express_relay/svm/generated/
152152
language: "system"
153+
# For Lazer
154+
- id: cargo-fmt-lazer
155+
name: Cargo format for Lazer
156+
language: "rust"
157+
entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
158+
pass_filenames: false
159+
files: lazer
160+
- id: cargo-clippy-lazer
161+
name: Cargo clippy for Lazer
162+
language: "rust"
163+
entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
164+
pass_filenames: false
165+
files: lazer

0 commit comments

Comments
 (0)