Skip to content
Open
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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: wasm32-unknown-unknown

- name: Cache cargo
uses: actions/cache@v4
Expand All @@ -37,6 +38,9 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build settlement WASM for tests
run: cargo build --package callora-settlement --target wasm32-unknown-unknown --release

- name: Test (all workspace members)
run: cargo test --workspace

Expand All @@ -48,6 +52,8 @@ jobs:

- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-unknown-unknown

- name: Cache cargo
uses: actions/cache@v4
Expand All @@ -60,6 +66,9 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-nightly-

- name: Build settlement WASM for tests
run: cargo build --package callora-settlement --target wasm32-unknown-unknown --release

- name: Test (with proptest long runs)
run: cargo test --workspace -- --nocapture

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
# -----------------------------------------------------------------------
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

# -----------------------------------------------------------------------
# 3. Cache — speeds up subsequent runs considerably
Expand All @@ -52,6 +54,9 @@ jobs:
with:
tool: cargo-tarpaulin

- name: Build settlement WASM for tests
run: cargo build --package callora-settlement --target wasm32-unknown-unknown --release

# -----------------------------------------------------------------------
# 5. Run coverage
# Configuration lives in tarpaulin.toml (workspace root).
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: wasm32-unknown-unknown

- name: Cache cargo
uses: actions/cache@v4
Expand All @@ -34,5 +35,8 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build settlement WASM for tests
run: cargo build --package callora-settlement --target wasm32-unknown-unknown --release

- name: Run tests including E2E
run: cargo test --workspace
61 changes: 59 additions & 2 deletions EVENT_SCHEMA.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Event Schema
# Event Schema

Events emitted by all Callora contracts for indexers, frontends, and auditors.
All topic/data types refer to Soroban/Stellar XDR values.
Expand Down Expand Up @@ -809,7 +809,7 @@ the WASM swap and `ContractVersion` write were rolled back.
}
```

#### `upgraded` (legacy)
### `upgraded` (legacy)

| Index | Location | Type | Description |
|---------|----------|------------|---------------------------------------------------|
Expand Down Expand Up @@ -963,6 +963,63 @@ has left the vault on-ledger; `sweep_idle_balance` does **not** call

---

### `emergency_drain_proposed`

Emitted when the admin proposes an emergency drain to a destination address.

| Index | Location | Type | Description |
|---------|----------|---------|---------------------------------------|
| topic 0 | topics | Symbol | `"emergency_drain_proposed"` |
| topic 1 | topics | Address | `admin` — caller who proposed |
| data | data | Address | `destination` — where funds will go |

```json
{
"topics": ["emergency_drain_proposed", "GADMIN..."],
"data": "GDESTINATION..."
}
```

---

### `emergency_drain_executed`

Emitted when the admin executes a previously proposed emergency drain.

| Index | Location | Type | Description |
|---------|----------|---------|---------------------------------------|
| topic 0 | topics | Symbol | `"emergency_drain_executed"` |
| topic 1 | topics | Address | `admin` — caller who executed |
| data | data | i128 | `amount` — amount drained in stroops |

```json
{
"topics": ["emergency_drain_executed", "GADMIN..."],
"data": 1000000
}
```

---

### `emergency_drain_cancelled`

Emitted when the admin cancels a previously proposed emergency drain.

| Index | Location | Type | Description |
|---------|----------|---------|---------------------------------------|
| topic 0 | topics | Symbol | `"emergency_drain_cancelled"` |
| topic 1 | topics | Address | `admin` — caller who cancelled |
| data | data | () | empty |

```json
{
"topics": ["emergency_drain_cancelled", "GADMIN..."],
"data": null
}
```

---

## Contract: `callora-settlement` (v0.1.0)

Source: [`contracts/settlement/src/lib.rs`](contracts/settlement/src/lib.rs).
Expand Down
5 changes: 1 addition & 4 deletions contracts/revenue_pool/fuzz/targets/weighted_distribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,7 @@ fuzz_target!(|data: &[u8]| {
} else {
// Rejection: on any expected-invalid input the pool must be unchanged.
// (The call may either panic or return a typed Err — both are acceptable.)
let succeeded = result
.as_ref()
.map(|r| r.is_ok())
.unwrap_or(false);
let succeeded = result.as_ref().map(|r| r.is_ok()).unwrap_or(false);
if succeeded {
// If it somehow succeeded, balance arithmetic must still hold.
// This path fires if our expected_valid logic is too conservative,
Expand Down
Loading
Loading