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
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ jobs:
with:
targets: wasm32-unknown-unknown,wasm32v1-none

- name: Install Stellar CLI
run: |
cargo install --locked stellar-cli --version 22.8.1 || true
stellar --version

- name: Cache cargo
uses: actions/cache@v4
with:
Expand All @@ -110,12 +105,14 @@ jobs:
soroban/target
key: soroban-${{ runner.os }}-${{ hashFiles('soroban/Cargo.toml', 'soroban/contracts/**/Cargo.toml') }}

- name: Build WASM
run: stellar contract build
- name: Build Soroban contracts
run: cargo build --release --target wasm32-unknown-unknown

- name: Run unit tests
run: cargo test --release

- name: Verify deployment metadata script
run: node scripts/print-deployments.mjs testnet
- name: Generate CI evidence summary (Soroban)
env:
JOB_STATUS: ${{ job.status }}
Expand Down
20 changes: 0 additions & 20 deletions coordinator/src/persistence/orders-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,24 +595,4 @@ function deriveTransitions(status: OrderStatus): string[] {
default:
return [status];
}

async getMetrics(): Promise<OrderMetrics> {
const byStatus = await this.all<{ status: string; count: number }>(this.metricsByStatus);
const totalRow = await this.get<{ count: number }>(this.metricsTotal);
const lastUpdatedRow = await this.get<{ ts: number | null }>(this.metricsLastUpdated);

const statusMap: Record<string, number> = {};
for (const row of byStatus) {
statusMap[row.status] = Number(row.count);
}

return {
totalOrders: Number(totalRow?.count ?? 0),
byStatus: statusMap,
completedOrders: statusMap["completed"] ?? 0,
refundedOrders: statusMap["refunded"] ?? 0,
staleExpiredOrders: (statusMap["expired"] ?? 0) + (statusMap["failed"] ?? 0),
lastUpdatedTimestamp: lastUpdatedRow?.ts != null ? Number(lastUpdatedRow.ts) : null
};
}
}
9 changes: 9 additions & 0 deletions coordinator/src/server/routes/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ export function ordersRoutes(orders: OrderService): Router {
}
});

router.get("/orders/:id/transitions", async (req, res, next) => {
try {
const transitions = await orders.getTransitions(req.params.id);
res.json({ transitions });
} catch (err) {
next(err);
}
});

// Parameterized routes come AFTER specific routes
router.get("/orders/:id", async (req, res, next) => {
const id = req.params.id;
Expand Down
8 changes: 4 additions & 4 deletions coordinator/test/order-transitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ describe("OrderService transition summaries", () => {
orderId: "src-1",
txHash: "0xsrc",
blockNumber: 1,
timelock: 1000
timelock: 2000
});
await orders.recordDstLock({
publicId: order.publicId,
orderId: "dst-1",
txHash: "0xdst",
blockNumber: 2,
timelock: 2000,
timelock: 1000,
resolver: null
});
await orders.recordSecret(order.publicId, PREIMAGE, "0xsecret");
Expand Down Expand Up @@ -144,14 +144,14 @@ describe("GET /api/orders/:id/transitions", () => {
orderId: "src-3",
txHash: "0xsrc3",
blockNumber: 4,
timelock: 4000
timelock: 5000
});
await orders.recordDstLock({
publicId: order.publicId,
orderId: "dst-3",
txHash: "0xdst3",
blockNumber: 5,
timelock: 5000,
timelock: 4000,
resolver: null
});
await orders.recordSecret(order.publicId, PREIMAGE, "0xsecret3");
Expand Down
Loading
Loading