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
42 changes: 42 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: TypeScript Check

on:
pull_request:
branches: [main]

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Setup env files
run: |
for pkg in packages/*/; do
if [ -f "$pkg.env.example" ]; then
cp "$pkg.env.example" "$pkg.env"
fi
done

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build contracts
run: pnpm --filter 'contracts' run build

- name: Build libs
run: pnpm build:libs && pnpm --filter 'query-server' run build

- name: TypeScript check
# claim-frontend, auction-frontend: deprecated, events over
run: pnpm --filter '!claim-frontend' --filter '!auction-frontend' check
2 changes: 1 addition & 1 deletion packages/client/src/lib/components/Admin/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function calculateProfitLossForTrip(
const previousOutcome = tripOutcomes[i - 1]

const outcomeTime = new Date(outcome._createdAt).getTime()
const previousOutcomeValue = previousOutcome?.tripValue || Number(trip.tripCreationCost) // Value from the previous trip, and if it's the first outcome, creation cost of the trip
const previousOutcomeValue = previousOutcome?.tripValue ?? outcome.oldTripValue ?? Number(trip.tripCreationCost) // Value from the previous trip, or oldTripValue (accounts for boosts), or creation cost
const currentTripValue = outcome.tripValue || 0
const valueChange = currentTripValue - previousOutcomeValue

Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/external/swap-router/RatRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ contract RatRouter {
amountOutMinimum: 0
})
);
require(amountOut <= type(uint128).max, "amount overflow");
return uint128(amountOut);
}

Expand Down
1 change: 0 additions & 1 deletion packages/contracts/src/systems/RatSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
} from "../codegen/index.sol";
import { System } from "@latticexyz/world/src/System.sol";
import { LibUtils, LibRat, LibWorld } from "../libraries/Libraries.sol";
import { console2 as console } from "forge-std/console2.sol";

contract RatSystem is System {
/**
Expand Down