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
43 changes: 43 additions & 0 deletions .github/workflows/ci-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI - Contracts

on:
pull_request:
branches: [main, master]
paths:
- 'contracts/**'
- '.github/workflows/ci-contracts.yml'

jobs:
ci:
name: Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts

steps:
- uses: actions/checkout@v4

- name: Install Rust stable with wasm32
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: contracts

- name: Check formatting
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run Tests
run: cargo test --all-features

- name: Build WASM
run: cargo build --target wasm32-unknown-unknown --release
39 changes: 38 additions & 1 deletion backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ jsonwebtoken = "9.2.0"
base64 = "0.22.1"
hex = "0.4.3"

[dev-dependencies]
tower = { version = "0.4", features = ["util"] }
http-body-util = "0.1"
9 changes: 9 additions & 0 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// lib.rs — re-exports the internal modules so that `tests/` integration
// tests can access them via `zaps_backend::api::feed::*`.
#![allow(dead_code, unused_variables, unused_imports)]

pub mod api;
pub mod config;
pub mod db;
pub mod indexer;
pub mod services;
11 changes: 6 additions & 5 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ use tower_http::{classify::ServerErrorsFailureClass, trace::TraceLayer};
use tracing::Span;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

mod api;
mod config;
mod db;
mod indexer;
mod services;
// Bring modules in from the library crate (defined in src/lib.rs)
use zaps_backend::api;
use zaps_backend::config;
use zaps_backend::db;
use zaps_backend::indexer;
use zaps_backend::services;

// Rate limiter state: token bucket per client (IP address)
#[derive(Clone)]
Expand Down
Loading
Loading